11;; Keywords
22
3- "return" @keyword.return
4-
5- [
6- "goto"
7- "in"
8- "local"
9- ] @keyword
10-
11- (label_statement) @label
12-
13- (break_statement) @keyword
14-
15- (do_statement
163[
174 "do"
18- "end"
19- ] @keyword )
20-
21- (while_statement
22- [
23- "while"
24- "do"
25- "end"
26- ] @repeat )
27-
28- (repeat_statement
29- [
30- "repeat"
31- "until"
32- ] @repeat )
33-
34- (if_statement
35- [
36- "if"
37- "elseif"
385 "else"
39- "then"
40- "end"
41- ] @conditional )
42-
43- (elseif_statement
44- [
456 "elseif"
46- "then"
477 "end"
48- ] @conditional )
49-
50- (else_statement
51- [
52- "else"
53- "end"
54- ] @conditional )
55-
56- (for_statement
57- [
588 "for"
59- "do"
60- "end"
61- ] @repeat )
62-
63- (function_declaration
64- [
659 "function"
66- "end"
67- ] @keyword.function )
68-
69- (function_definition
70- [
71- "function"
72- "end"
73- ] @keyword.function )
10+ "goto"
11+ "if"
12+ "in"
13+ "local"
14+ "repeat"
15+ "return"
16+ "then"
17+ "until"
18+ "while"
19+ (break_statement)
20+ ] @keyword
7421
7522;; Operators
7623
77- (binary_expression operator: _ @operator )
78-
79- (unary_expression operator: _ @operator )
80-
8124[
8225 "and"
8326 "not"
8427 "or"
8528] @keyword.operator
8629
30+ [
31+ "+"
32+ "-"
33+ "*"
34+ "/"
35+ "%"
36+ "^"
37+ "#"
38+ "=="
39+ "~="
40+ "<="
41+ ">="
42+ "<"
43+ ">"
44+ "="
45+ "&"
46+ "~"
47+ "|"
48+ "<<"
49+ ">>"
50+ "//"
51+ ".."
52+ ] @operator
53+
8754;; Punctuations
8855
8956[
10875
10976(identifier) @variable
11077
111- ((identifier) @variable.builtin
112- (#eq? @variable.builtin "self"))
78+ ((identifier) @variable.special
79+ (#eq? @variable.special "self"))
11380
11481(variable_list
115- (attribute
116- "<" @punctuation.bracket
117- (identifier) @attribute
118- ">" @punctuation.bracket ))
82+ attribute: (attribute
83+ (["<" ">"] @punctuation.bracket
84+ (identifier) @attribute )))
11985
12086;; Constants
12187
13399
134100;; Tables
135101
136- (field name: (identifier) @field )
102+ (field name: (identifier) @property )
137103
138- (dot_index_expression field: (identifier) @field )
104+ (dot_index_expression field: (identifier) @property )
139105
140106(table_constructor
141107[
147113
148114(parameters (identifier) @parameter )
149115
150- (function_declaration
116+ (function_call
151117 name: [
152118 (identifier) @function
153- (dot_index_expression
154- field: (identifier) @function )
119+ (dot_index_expression field: (identifier) @function )
155120 ])
156121
157122(function_declaration
158- name: (method_index_expression
159- method: (identifier) @method ))
160-
161- (assignment_statement
162- (variable_list .
163- name: [
164- (identifier) @function
165- (dot_index_expression
166- field: (identifier) @function )
167- ])
168- (expression_list .
169- value: (function_definition)))
170-
171- (table_constructor
172- (field
173- name: (identifier) @function
174- value: (function_definition)))
175-
176- (function_call
177123 name: [
178- (identifier) @function.call
179- (dot_index_expression
180- field: (identifier) @function.call )
181- (method_index_expression
182- method: (identifier) @method.call )
124+ (identifier) @function.definition
125+ (dot_index_expression field: (identifier) @function.definition )
183126 ])
184127
128+ (method_index_expression method: (identifier) @function.method )
129+
185130(function_call
186131 (identifier) @function.builtin
187132 (#any-of? @function.builtin
200145(number) @number
201146
202147(string) @string
203-
204- (escape_sequence) @string.escape
148+ (escape_sequence) @string.escape
0 commit comments