@@ -0,0 +1,198 @@
1+[
2+ (container_doc_comment)
3+ (doc_comment)
4+ (line_comment)
5+] @comment
6+
7+; field in top level decl, and in struct, union...
8+(ContainerField
9+ (IDENTIFIER) @property
10+ (SuffixExpr (IDENTIFIER) @type)?
11+)
12+
13+; error.OutOfMemory;
14+(SuffixExpr
15+ "error"
16+ "."
17+ (IDENTIFIER) @constant
18+)
19+
20+; var x: IDENTIFIER
21+type: (SuffixExpr (IDENTIFIER) @type)
22+
23+; IDENTIFIER{}
24+constructor: (SuffixExpr (IDENTIFIER) @constructor)
25+
26+; fields
27+(FieldInit (IDENTIFIER) @property)
28+
29+; foo.bar.baz.function() calls
30+(
31+ (SuffixOp
32+ (IDENTIFIER) @function
33+ )
34+ .
35+ (FnCallArguments)
36+)
37+
38+; function() calls
39+(
40+ (
41+ (IDENTIFIER) @function
42+ )
43+ .
44+ (FnCallArguments)
45+)
46+
47+; functionn decl
48+(FnProto
49+ (IDENTIFIER) @function
50+ (SuffixExpr (IDENTIFIER) @type)?
51+ ("!")? @function.macro
52+)
53+
54+; function parameters and types
55+(ParamDecl
56+ (IDENTIFIER) @variable.parameter
57+ ":"
58+ [
59+ (ParamType (SuffixExpr (IDENTIFIER) @type))
60+ (ParamType)
61+ ]
62+)
63+
64+; switch
65+(SwitchItem
66+ (SuffixExpr
67+ "."
68+ .
69+ (IDENTIFIER) @constant
70+ )
71+)
72+
73+(INTEGER) @number
74+
75+(FLOAT) @number
76+
77+[
78+ (STRINGLITERAL)
79+ (STRINGLITERALSINGLE)
80+] @string
81+
82+(CHAR_LITERAL) @string
83+
84+[
85+ "allowzero"
86+ "volatile"
87+ "anytype"
88+ "anyframe"
89+ (BuildinTypeExpr)
90+] @type.builtin
91+
92+(BreakLabel (IDENTIFIER) @label)
93+(BlockLabel (IDENTIFIER) @label)
94+
95+[
96+ "true"
97+ "false"
98+ "undefined"
99+ "unreachable"
100+ "null"
101+] @constant.builtin
102+
103+[
104+ "else"
105+ "if"
106+ "switch"
107+ "for"
108+ "while"
109+ "return"
110+ "break"
111+ "continue"
112+ "defer"
113+ "errdefer"
114+ "async"
115+ "nosuspend"
116+ "await"
117+ "suspend"
118+ "resume"
119+ "try"
120+ "catch"
121+] @keyword.control
122+
123+[
124+ "struct"
125+ "enum"
126+ "union"
127+ "error"
128+ "packed"
129+ "opaque"
130+ "test"
131+ "usingnamespace"
132+ "export"
133+ "extern"
134+ "const"
135+ "var"
136+ "comptime"
137+ "threadlocal"
138+] @keyword
139+
140+[
141+ "pub"
142+ "fn"
143+] @keyword.function
144+
145+; PrecProc
146+[
147+ "inline"
148+ "noinline"
149+ "asm"
150+ "callconv"
151+ "noalias"
152+] @attribute
153+
154+[
155+ (BUILTINIDENTIFIER)
156+ "linksection"
157+ "align"
158+] @function.builtin
159+
160+[
161+ (CompareOp)
162+ (BitwiseOp)
163+ (BitShiftOp)
164+ (AdditionOp)
165+ (MultiplyOp)
166+ (PrefixOp)
167+ "or"
168+ "and"
169+ "orelse"
170+ "*"
171+ "**"
172+ "->"
173+ "=>"
174+ ".?"
175+ ".*"
176+ "="
177+] @operator
178+
179+[
180+ ";"
181+ "."
182+ ","
183+ ":"
184+] @punctuation.delimiter
185+
186+[
187+ ".."
188+ "..."
189+ "["
190+ "]"
191+ "("
192+ ")"
193+ "{"
194+ "}"
195+ (Payload "|")
196+ (PtrPayload "|")
197+ (PtrIndexPayload "|")
198+] @punctuation