Function: c-ts-mode--standalone-parent-skip-preproc
c-ts-mode--standalone-parent-skip-preproc is a byte-compiled function
defined in c-ts-mode.el.gz.
Signature
(c-ts-mode--standalone-parent-skip-preproc N PARENT &rest _)
Documentation
Like the standalone-parent anchor but skips preproc nodes.
PARENT is the same as other anchor functions.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/c-ts-mode.el.gz
(defun c-ts-mode--standalone-parent-skip-preproc (_n parent &rest _)
"Like the standalone-parent anchor but skips preproc nodes.
PARENT is the same as other anchor functions."
(save-excursion
(treesit-node-start
(treesit-parent-until
;; Use PARENT rather than NODE, to handle the case where NODE is
;; nil.
parent (lambda (node)
(and node
(not (string-match "preproc" (treesit-node-type node)))
(progn
(goto-char (treesit-node-start node))
(looking-back (rx bol (* whitespace))
(line-beginning-position)))))
t))))