aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--queries/zig/highlights.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm
index a7f1071a2..24c41d6d3 100644
--- a/queries/zig/highlights.scm
+++ b/queries/zig/highlights.scm
@@ -23,7 +23,7 @@ parameter: (IDENTIFIER) @parameter
field_access: (IDENTIFIER)
parameter: (IDENTIFIER)
] @type
- (#match? @type "^[A-Z]")
+ (#match? @type "^[A-Z]([a-z0-9]+[A-Za-z0-9]*)*$")
)
;; assume camelCase is a function
(
@@ -35,6 +35,15 @@ parameter: (IDENTIFIER) @parameter
(#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$")
)
+;; assume all CAPS_1 is a constant
+(
+ [
+ variable_type_function: (IDENTIFIER)
+ field_access: (IDENTIFIER)
+ ] @constant
+ (#match? @constant "^[A-Z][A-Z_0-9]+$")
+)
+
[
function_call: (IDENTIFIER)
function: (IDENTIFIER)