Function: markdown-ts--table-parse-error-p

markdown-ts--table-parse-error-p is a byte-compiled function defined in markdown-ts-mode.el.gz.

Signature

(markdown-ts--table-parse-error-p &optional NODE POS)

Documentation

Return non-nil if named NODE at POS is in an "ERROR" subtree.

NODE must be a table element; i.e., its type prefix is "pipe_table". If NODE is a table, return nil (it shouldn't be in ERROR). If NODE is not a table element, return nil. If NODE's nearby ancestor is an "ERROR" node, return t. Otherwise, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts--table-parse-error-p (&optional node pos)
  "Return non-nil if named NODE at POS is in an \"ERROR\" subtree.
NODE must be a table element; i.e., its type prefix is \"pipe_table\".
If NODE is a table, return nil (it shouldn't be in ERROR).
If NODE is not a table element, return nil.
If NODE's nearby ancestor is an \"ERROR\" node, return t.
Otherwise, return nil."
  ;; We could sanity check via `treesit-node-named' and error if not.
  (when-let* ((row (markdown-ts--table-node-row node pos))
              (type (treesit-node-type row))
              (parent (treesit-node-parent row))
              (parent-type (treesit-node-type parent)))
    (cond ((equal type "pipe_table")
           nil)
          ((equal parent-type "pipe_table")
           nil)
          ((equal parent-type "ERROR")
           t)
          (t
           (error "Should never happen")))))