Function: c-ts-mode--top-level-declarator
c-ts-mode--top-level-declarator is a byte-compiled function defined in
c-ts-mode.el.gz.
Signature
(c-ts-mode--top-level-declarator NODE)
Documentation
Return non-nil if NODE is a top-level function_declarator.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/c-ts-mode.el.gz
(defun c-ts-mode--top-level-declarator (node)
"Return non-nil if NODE is a top-level function_declarator."
;; These criterion are observed in
;; xterm.c:x_draw_glyphless_glyph_string_foreground on emacs-29
;; branch, described in bug#63390. They might not cover all cases
;; where a function_declarator is at top-level, outside of a
;; function_definition. We might need to amend them as we discover
;; more cases.
(let* ((parent (treesit-node-parent node))
(grandparent (treesit-node-parent parent)))
(and (equal (treesit-node-type parent) "ERROR")
(null grandparent))))