Function: c-ts-common--line-comment-p

c-ts-common--line-comment-p is a byte-compiled function defined in c-ts-common.el.gz.

Signature

(c-ts-common--line-comment-p NODE)

Documentation

Return non-nil if NODE is a comment node.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/c-ts-common.el.gz
(defun c-ts-common--line-comment-p (node)
  "Return non-nil if NODE is a comment node."
  (or (save-excursion
        (goto-char (treesit-node-start node))
        (looking-at "//"))
      ;; In rust, NODE will be the body of a comment, and the
      ;; parent will be the whole comment.
      (let* ((parent (treesit-node-parent node))
             (parent-start (treesit-node-start parent)))
        (when (and (treesit-node-match-p
                    parent c-ts-common--comment-regexp)
                   parent parent-start)
          (save-excursion
            (goto-char parent-start)
            (looking-at "//"))))))