(match nil "argument_list" nil nil 0 0)
@end example
+In addition, @var{node-type} can be a special value @code{null},
+which matches when the value of @var{node} is @code{nil}.
+
@item n-p-gp
Short for ``node-parent-grandparent'', this matcher is a function of 3
arguments: @var{node-type}, @var{parent-type}, and
((parent-is "field_declaration_list") c-ts-mode--anchor-prev-sibling 0)
;; Statement in {} blocks.
- ((match nil "compound_statement" nil 1 1) standalone-parent c-ts-mode-indent-offset)
+ ((or (match nil "compound_statement" nil 1 1)
+ (match null "compound_statement"))
+ standalone-parent c-ts-mode-indent-offset)
((parent-is "compound_statement") c-ts-mode--anchor-prev-sibling 0)
;; Opening bracket.
((node-is "compound_statement") standalone-parent c-ts-mode-indent-offset)
(&optional node-type parent-type node-field
node-index-min node-index-max)
(lambda (node parent &rest _)
- (and (or (null node-type)
- (string-match-p
- node-type (or (treesit-node-type node) "")))
+ (and (pcase node-type
+ ('nil t)
+ ('null (null node))
+ (_ (string-match-p
+ node-type (or (treesit-node-type node) ""))))
(or (null parent-type)
(string-match-p
parent-type (treesit-node-type parent)))
(match nil \"argument_list\" nil nil 0 0).
NODE-TYPE, PARENT-TYPE, and NODE-FIELD are regexps.
+ NODE-TYPE can also be `null', which matches when NODE is nil.
no-node
|
}
=-=-=
+
+Name: Empty Line
+
+=-=
+int
+main (void)
+{
+|
+}
+=-=
+int
+main (void)
+{
+ |
+}
+=-=-=