Debian Codegraph @

runtime/queries/c3/highlights.scm

raw symbols SCIP
1 ; Punctuation
2 [
3 "("
4 ")"
5 "["
6 "]"
7 "{"
8 "}"
9 "[<"
10 ">]"
11 ] @punctuation.bracket
12
13 [
14 ";"
15 ","
16 ":"
17 "::"
18 ] @punctuation.delimiter
19
20 ; Constant
21 (const_ident) @constant
22
23 [
24 "true"
25 "false"
26 ] @constant.builtin.boolean
27
28 "null" @constant.builtin
29
30 ; Variable
31 [
32 (ident)
33 (ct_ident)
34 (hash_ident)
35 ] @variable
36
37 ; 1) Member
38 (field_expr
39 field: (access_ident
40 (ident) @variable.other.member))
41
42 (struct_member_declaration
43 (ident) @variable.other.member)
44
45 (struct_member_declaration
46 (identifier_list
47 (ident) @variable.other.member))
48
49 (bitstruct_member_declaration
50 (ident) @variable.other.member)
51
52 (initializer_list
53 (initializer_element
54 (param_path
55 (param_path_element
56 (access_ident
57 (ident) @variable.other.member)))))
58
59 ; 2) Parameter
60 (param
61 name: (_) @variable.parameter)
62
63 (trailing_block_param
64 (at_ident) @variable.parameter)
65
66 (call_arg_list
67 (call_arg
68 name: (_) @variable.parameter))
69
70 (enum_param
71 (ident) @variable.parameter)
72
73 ; Keyword (from `c3c --list-keywords`)
74 [
75 "alias"
76 "asm"
77 "attrdef"
78 "catch"
79 "defer"
80 "try"
81 "var"
82 ] @keyword
83
84 [
85 "$alignof"
86 "$assert"
87 "$assignable"
88 "$case"
89 "$default"
90 "$defined"
91 "$echo"
92 "$else"
93 "$embed"
94 "$endfor"
95 "$endforeach"
96 "$endif"
97 "$endswitch"
98 "$eval"
99 "$evaltype"
100 "$error"
101 "$exec"
102 "$extnameof"
103 "$feature"
104 "$for"
105 "$foreach"
106 "$if"
107 "$include"
108 "$is_const"
109 "$kindof"
110 "$nameof"
111 "$offsetof"
112 "$qnameof"
113 "$sizeof"
114 "$stringify"
115 "$switch"
116 "$typefrom"
117 "$typeof"
118 "$vacount"
119 "$vatype"
120 "$vaconst"
121 "$vaarg"
122 "$vaexpr"
123 "$vasplat"
124 ] @keyword.directive
125
126 "assert" @keyword.debug
127
128 "fn" @keyword.function
129
130 "macro" @keyword.function
131
132 "return" @keyword.control.return
133
134 [
135 "import"
136 "module"
137 ] @keyword.control.import
138
139 [
140 "bitstruct"
141 "enum"
142 "faultdef"
143 "interface"
144 "struct"
145 "typedef"
146 "union"
147 ] @keyword.storage.type
148
149 [
150 "case"
151 "default"
152 "else"
153 "if"
154 "nextcase"
155 "switch"
156 ] @keyword.control.conditional
157
158 [
159 "break"
160 "continue"
161 "do"
162 "for"
163 "foreach"
164 "foreach_r"
165 "while"
166 ] @keyword.control.repeat
167
168 [
169 "const"
170 "extern"
171 "inline"
172 "static"
173 "tlocal"
174 ] @keyword.storage.modifier
175
176 ; Operator (from `c3c --list-operators`)
177 [
178 "&"
179 "!"
180 "~"
181 "|"
182 "^"
183 "="
184 ">"
185 "/"
186 "."
187 "<"
188 "-"
189 "%"
190 "+"
191 "?"
192 "*"
193 "&&"
194 "!!"
195 "&="
196 "|="
197 "^="
198 "/="
199 ".."
200 "?:"
201 "=="
202 ">="
203 "=>"
204 "<="
205 "-="
206 "--"
207 "%="
208 "*="
209 "!="
210 "||"
211 "+="
212 "++"
213 "??"
214 "<<"
215 ">>"
216 "..."
217 "<<="
218 ">>="
219 "&&&"
220 "+++"
221 "|||"
222 "???"
223 "+++="
224 ] @operator
225
226 (range_expr
227 ":" @operator)
228
229 (foreach_cond
230 ":" @operator)
231
232 (ct_foreach_cond
233 ":" @operator)
234
235 (ternary_expr
236 [
237 "?"
238 "???"
239 ":"
240 ] @keyword.control.conditional.ternary)
241
242 (elvis_orelse_expr
243 [
244 "?:"
245 "??"
246 ] @keyword.control.conditional.ternary)
247
248 ; Literal
249 (integer_literal) @constant.numeric.integer
250
251 (real_literal) @constant.numeric.float
252
253 (char_literal) @constant.character
254
255 (bytes_literal) @constant.numeric
256
257 ; String
258 (string_literal) @string
259
260 (raw_string_literal) @string
261
262 ; Escape Sequence
263 (escape_sequence) @constant.character.escape
264
265 ; Builtin (constants)
266 (builtin_const) @constant.builtin
267
268 ; Type Property (from `c3c --list-type-properties`)
269 (type_access_expr
270 (access_ident
271 (ident) @variable.builtin
272 (#any-of? @variable.builtin
273 "alignof" "associated" "elements" "extnameof" "from_ordinal" "get" "inf" "is_eq" "is_ordered"
274 "is_substruct" "len" "lookup" "lookup_field" "max" "membersof" "methodsof" "min" "nan" "inner"
275 "kindof" "names" "nameof" "params" "paramsof" "parentof" "qnameof" "returns" "sizeof" "set"
276 "tagof" "has_tagof" "values" "typeid")))
277
278 ; Label
279 (label
280 (const_ident) @label)
281
282 (label_target
283 (const_ident) @label)
284
285 ; Module
286 (module_resolution
287 (ident) @namespace)
288
289 (module_declaration
290 (path_ident
291 (ident) @namespace))
292
293 (import_path
294 (path_ident
295 (ident) @namespace))
296
297 ; Attribute
298 (attribute
299 name: (at_ident) @attribute)
300
301 (at_type_ident) @attribute
302
303 (call_inline_attributes
304 (at_ident) @attribute)
305
306 (type_suffix
307 (at_ident) @attribute)
308
309 (asm_block_stmt
310 (at_ident) @attribute)
311
312 ; Type
313 [
314 (type_ident)
315 (ct_type_ident)
316 ] @type
317
318 (base_type_name) @type.builtin
319
320 ; Function Definition
321 (func_header
322 name: (_) @function)
323
324 (func_header
325 method_type: (_)
326 name: (_) @function.method)
327
328 (macro_header
329 name: (_) @function)
330
331 (macro_header
332 method_type: (_)
333 name: (_) @function.method)
334
335 ; Function Call
336 (call_expr
337 function: (ident_expr
338 [
339 (ident)
340 (at_ident)
341 ] @function))
342
343 (call_expr
344 function: (trailing_generic_expr
345 argument: (ident_expr
346 [
347 (ident)
348 (at_ident)
349 ] @function)))
350
351 ; Method call
352 (call_expr
353 function: (field_expr
354 field: (access_ident
355 [
356 (ident)
357 (at_ident)
358 ] @function)))
359
360 ; Method on type
361 (call_expr
362 function: (type_access_expr
363 field: (access_ident
364 [
365 (ident)
366 (at_ident)
367 ] @function)))
368
369 ; Builtin call
370 (call_expr
371 function: (builtin) @function.builtin)
372
373 ; Asm
374 (asm_instr
375 [
376 (ident)
377 "int"
378 ] @function.builtin)
379
380 (asm_expr
381 [
382 (ct_ident)
383 (ct_const_ident)
384 ] @variable.builtin)
385
386 ; Comment
387 (line_comment) @comment.line
388 (block_comment) @comment.block
389 (doc_comment) @comment.block.documentation
390
391 (doc_comment_contract
392 name: (_) @attribute)
393
394 (doc_comment_contract
395 parameter: [
396 (ident)
397 (ct_ident)
398 (hash_ident)
399 ] @variable.parameter)
400
401 (doc_comment_contract
402 [
403 ":"
404 "?"
405 ] @comment.block.documentation)
406
407 (doc_comment_contract
408 description: (string_expr
409 [
410 (string_literal)
411 (raw_string_literal)
412 ] @comment.block.documentation))