File tree Expand file tree Collapse file tree 1 file changed +19
-18
lines changed Expand file tree Collapse file tree 1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change 1+ ;; Adapted from nvim-treesitter
12;; Keywords
23
3- "return" @keyword.return
44
55[
66 "goto"
77 "in"
88 "local"
9+ "return"
910] @keyword
1011
1112(label_statement) @label
2324 "while"
2425 "do"
2526 "end"
26- ] @repeat )
27+ ] @keyword )
2728
2829(repeat_statement
2930[
3031 "repeat"
3132 "until"
32- ] @repeat )
33+ ] @keyword )
3334
3435(if_statement
3536[
3839 "else"
3940 "then"
4041 "end"
41- ] @conditional )
42+ ] @keyword )
4243
4344(elseif_statement
4445[
4546 "elseif"
4647 "then"
4748 "end"
48- ] @conditional )
49+ ] @keyword )
4950
5051(else_statement
5152[
5253 "else"
5354 "end"
54- ] @conditional )
55+ ] @keyword )
5556
5657(for_statement
5758[
5859 "for"
5960 "do"
6061 "end"
61- ] @repeat )
62+ ] @keyword )
6263
6364(function_declaration
6465[
6566 "function"
6667 "end"
67- ] @keyword.function )
68+ ] @keyword )
6869
6970(function_definition
7071[
7172 "function"
7273 "end"
73- ] @keyword.function )
74+ ] @keyword )
7475
7576;; Operators
7677
7778[
7879 "and"
7980 "not"
8081 "or"
81- ] @keyword. operator
82+ ] @operator
8283
8384[
8485 "+"
134135;; Constants
135136
136137((identifier) @constant
137- (#lua- match? @constant "^[A-Z][A-Z_0-9]*$"))
138+ (#match? @constant "^[A-Z][A-Z_0-9]*$"))
138139
139140(vararg_expression) @constant
140141
143144[
144145 (false)
145146 (true)
146- ] @boolean
147+ ] @constant.builtin
147148
148149;; Tables
149150
150- (field name: (identifier) @field )
151+ (field name: (identifier) @variable )
151152
152- (dot_index_expression field: (identifier) @field )
153+ (dot_index_expression field: (identifier) @variable )
153154
154155(table_constructor
155156[
159160
160161;; Functions
161162
162- (parameters (identifier) @parameter )
163+ (parameters (identifier) @variable. parameter )
163164
164- (function_call name: (identifier) @function )
165+ (function_call name: (identifier) @function.call )
165166(function_declaration name: (identifier) @function )
166167
167168(function_call name: (dot_index_expression field: (identifier) @function ))
188189
189190(string) @string
190191
191- ;; Error
192- (ERROR) @error
192+ ;; Error TODO
193+ ;; (ERROR) @error
You can’t perform that action at this time.
0 commit comments