aboutsummaryrefslogtreecommitdiff
path: root/Queries/highlights.scm
blob: b366bc7fade0a00fd797d77e3f4384c33593fa99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
(comment) @comment

[
  (string)
  (multiline_string)
  (character)
] @string

[
  (integer)
  (float)
] @value.number

[
  "true"
  "false"
] @value.boolean

[
  "null"
  "undefined"
  "unreachable"
] @value.null

(builtin_type) @identifier.type
(builtin_identifier) @identifier.core

((builtin_identifier) @processing
  (#match? @processing "^@(import|cImport)$"))

((identifier) @identifier.core
  (#eq? @identifier.core "_"))

(parameter
  name: (identifier) @identifier.argument)

(payload
  (identifier) @identifier.argument)

(field_expression
  member: (identifier) @identifier.property)

(field_initializer
  (identifier) @identifier.property)

(function_declaration
  name: (identifier) @identifier.function)

(call_expression
  function: (identifier) @identifier.function)

(call_expression
  function: (field_expression
    member: (identifier) @identifier.function))

((identifier) @identifier.type
  (#match? @identifier.type "^[A-Z][A-Za-z0-9_]*$"))

((identifier) @identifier.constant
  (#match? @identifier.constant "^[A-Z][A-Z0-9_]+$"))

[
  "asm"
  "const"
  "defer"
  "errdefer"
  "error"
  "return"
  "test"
  "var"
] @keyword

[
  "struct"
  "union"
  "enum"
  "opaque"
  "fn"
] @keyword.construct

[
  "if"
  "else"
  "switch"
  "for"
  "while"
  "try"
  "catch"
  "break"
  "continue"
] @keyword.condition

[
  "usingnamespace"
  "export"
  "comptime"
  "inline"
  "noinline"
  "extern"
  "pub"
  "packed"
  "threadlocal"
  "volatile"
  "allowzero"
  "noalias"
  "addrspace"
  "align"
  "callconv"
  "linksection"
  "async"
  "await"
  "suspend"
  "nosuspend"
  "resume"
] @keyword.modifier

[
  "and"
  "or"
  "orelse"
] @keyword.operator

(ERROR) @invalid