summaryrefslogtreecommitdiff
path: root/queries/cpp/highlights.scm
diff options
context:
space:
mode:
authorSteven Sojka <steelsojka@gmail.com>2020-08-15 09:24:24 -0500
committerSteven Sojka <steelsojka@gmail.com>2020-08-16 09:04:07 -0500
commit579c9936d617ca1d7f01542a4b8000972c1ce73c (patch)
tree8b9cbb24ab959ad45a8e8611edd7cf20d707b327 /queries/cpp/highlights.scm
parent994baf45396972d9eb6b918e0757d2eceecc8130 (diff)
feat(highlights): add is predicate
Diffstat (limited to 'queries/cpp/highlights.scm')
-rw-r--r--queries/cpp/highlights.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm
index 0eb54126..fe728313 100644
--- a/queries/cpp/highlights.scm
+++ b/queries/cpp/highlights.scm
@@ -8,7 +8,12 @@
(#match? @field "_$"))
; function(Foo ...foo)
-(variadic_parameter_declaration) @parameter
+(variadic_parameter_declaration
+ declarator: (variadic_declarator
+ (identifier) @parameter))
+; int foo = 0
+(optional_parameter_declaration
+ declarator: (identifier) @parameter)
;(field_expression) @parameter ;; How to highlight this?
(template_function
@@ -42,20 +47,20 @@
(#match? @constructor "^[A-Z]"))
(call_expression
- function: (scoped_identifier
+ function: (scoped_identifier
name: (identifier) @function))
(call_expression
- function: (field_expression
+ function: (field_expression
field: (field_identifier) @function))
((call_expression
- function: (scoped_identifier
+ function: (scoped_identifier
name: (identifier) @constructor))
(#match? @constructor "^[A-Z]"))
((call_expression
- function: (field_expression
+ function: (field_expression
field: (field_identifier) @constructor))
(#match? @constructor "^[A-Z]"))