@@ -14,71 +14,130 @@
1414
1515(field_identifier) @variable.other.member
1616(selector_expression
17+ operand: (identifier) @variable
1718 field: (identifier) @variable.other.member)
1819
1920(int_literal) @constant.numeric.integer
20−(interpreted_string_literal) @string
21−(rune_literal) @string
21+
22+(attribute_declaration) @attribute
23+(comment) @comment
24+[
25+ (c_string_literal)
26+ (raw_string_literal)
27+ (interpreted_string_literal)
28+ (string_interpolation)
29+ (rune_literal)
30+] @string
31+
2232(escape_sequence) @constant.character.escape
2333
2434[
25− (type_identifier)
26− (builtin_type)
2735 (pointer_type)
2836 (array_type)
2937] @type
3038
39+(const_spec name: (identifier) @constant)
40+(global_var_type_initializer name: (identifier) @constant)
41+(global_var_spec name: (identifier) @constant)
42+((identifier) @constant (#match? @constant "^[A-Z][A-Z\\d_]*$"))
43+
44+
45+[
46+ (generic_type)
47+ (type_identifier)
48+] @constructor
49+
50+(builtin_type) @type.builtin
51+
52+[
53+ (true)
54+ (false)
55+] @constant.builtin.boolean
56+
57+
3158[
32− (identifier)
3359 (module_identifier)
3460 (import_path)
61+] @namespace
62+
63+[
64+ (pseudo_comptime_identifier)
65+ (label_name)
66+] @label
67+
68+[
69+ (identifier)
3570] @variable
3671
72+
3773[
38− "as"
39− "asm"
40− "assert"
41− ;"atomic"
42− ;"break"
43− "const"
44− ;"continue"
45− "defer"
46− "else"
47− "enum"
48− "fn"
49− "for"
50− "$for"
51− "go"
52− "goto"
53− "if"
54− "$if"
55− "import"
56− "in"
57− "!in"
58− "interface"
59− "is"
60− "!is"
61− "lock"
62− "match"
63− "module"
64− "mut"
65− "or"
66− "pub"
67− "return"
68− "rlock"
69− "select"
70− ;"shared"
71− ;"static"
72− "struct"
73− "type"
74− ;"union"
75− "unsafe"
74+ "pub"
75+ "assert"
76+ "go"
77+ "asm"
78+ "defer"
79+ "unsafe"
80+ "sql"
81+ (none)
7682] @keyword
7783
7884[
79− (true)
80− (false)
81−] @boolean
85+ "interface"
86+ "enum"
87+ "type"
88+ "union"
89+ "struct"
90+ "module"
91+] @keyword.storage.type
92+
93+[
94+ "static"
95+ "const"
96+ "__global"
97+] @keyword.storage.modifier
98+
99+[
100+ "mut"
101+] @keyword.storage.modifier.mut
102+
103+[
104+ "shared"
105+ "lock"
106+ "rlock"
107+ "spawn"
108+] @keyword.control
109+
110+[
111+ "if"
112+ "select"
113+ "else"
114+ "match"
115+] @keyword.control.conditional
116+
117+[
118+ "for"
119+] @keyword.control.repeat
120+
121+[
122+ "goto"
123+ "return"
124+] @keyword.control.return
125+
126+[
127+ "fn"
128+] @keyword.control.function
129+
130+
131+[
132+ "import"
133+] @keyword.control.import
134+
135+[
136+ "as"
137+ "in"
138+ "is"
139+ "or"
140+] @keyword.operator
82141
83142[
84143 "."
@@ -146,5 +205,3 @@
146205 ".."
147206 "..."
148207] @operator
149−
150−(comment) @comment