on master help sign in
Update t32 language queries to version 2.2.1 (#7811)
5a51036Christoph Sax
languages.toml+1−1
@@ -2691,7 +2691,7 @@ indent = { tab-width = 2, unit = " " }
2691
2691
2692[[grammar]]
2692[[grammar]]
2693name = "t32"
2693name = "t32"
2694−source = { git = "https://codeberg.org/xasc/tree-sitter-t32", rev = "1dd98248b01e4a3933c1b85b58bab0875e2ba437" }
2694+source = { git = "https://gitlab.com/xasc/tree-sitter-t32", rev = "6da5e3cbabd376b566d04282005e52ffe67ef74a" }
2695
2695
2696[[language]]
2696[[language]]
2697name = "webc"
2697name = "webc"
runtime/queries/t32/highlights.scm+108−26
@@ -1,3 +1,28 @@
1+; Operators in command and conditional HLL expressions
2+(hll_comma_expression
3+ "," @operator)
4+
5+(hll_conditional_expression
6+ [
7+ "?"
8+ ":"
9+] @operator)
10+
11+
12+; Keywords, punctuation and operators
13+[
14+ "enum"
15+ "struct"
16+ "union"
17+] @keyword.storage.type
18+
19+"sizeof" @keyword.operator
20+
21+[
22+ "const"
23+ "volatile"
24+] @keyword.storage.modifier
25+
1[
26[
2 "="
27 "="
3 "^^"
28 "^^"
@@ -28,49 +53,89 @@
28 "&"
53 "&"
29 "->"
54 "->"
30 "*"
55 "*"
56+ "-="
57+ "+="
58+ "*="
59+ "/="
60+ "%="
61+ "|="
62+ "&="
63+ "^="
64+ ">>="
65+ "<<="
66+ "--"
67+ "++"
31] @operator
68] @operator
32
69
33[
70[
34− "("
71+ "("
35− ")"
72+ ")"
36− "{"
73+ "{"
37− "}"
74+ "}"
38− "["
75+ "["
39− "]"
76+ "]"
40] @punctuation.bracket
77] @punctuation.bracket
41
78
42[
79[
43 ","
80 ","
44 "."
81 "."
45− ";"
46] @punctuation.delimiter
82] @punctuation.delimiter
47
83
48−; Constants
84+
85+; Strings and others literal types
86+(access_class) @constant.builtin
87+
49[
88[
50− (access_class)
51 (address)
89 (address)
52 (bitmask)
90 (bitmask)
53 (file_handle)
91 (file_handle)
54− (frequency)
92+ (integer)
55− (time)
93+ (hll_number_literal)
56−] @constant.builtin
94+] @constant.numeric.integer
57
95
58[
96[
59 (float)
97 (float)
98+ (frequency)
60 (percentage)
99 (percentage)
100+ (time)
61] @constant.numeric.float
101] @constant.numeric.float
62
102
63−(integer) @constant.numeric.integer
103+[
64−
104+ (string)
65−(character) @constant.character
105+ (hll_string_literal)
106+] @string
66
107
67−; Strings
108+(hll_escape_sequence) @constant.character.escape
68−(string) @string
69
109
70(path) @string.special.path
110(path) @string.special.path
71−
72(symbol) @string.special.symbol
111(symbol) @string.special.symbol
73
112
113+[
114+ (character)
115+ (hll_char_literal)
116+] @constant.character
117+
118+
119+; Types in HLL expressions
120+[
121+ (hll_type_identifier)
122+ (hll_type_descriptor)
123+] @type
124+
125+(hll_type_qualifier) @keyword.storage.modifier
126+
127+(hll_primitive_type) @type.builtin
128+
129+
130+; HLL call expressions
131+(hll_call_expression
132+ function: (hll_field_expression
133+ field: (hll_field_identifier) @function))
134+
135+(hll_call_expression
136+ function: (identifier) @function)
137+
138+
74; Returns
139; Returns
75(
140(
76 (command_expression
141 (command_expression
@@ -83,11 +148,13 @@
83 (#match? @keyword.return "^[rR][eE][tT][uU][rR][nN]$")
148 (#match? @keyword.return "^[rR][eE][tT][uU][rR][nN]$")
84)
149)
85
150
151+
86; Subroutine calls
152; Subroutine calls
87(subroutine_call_expression
153(subroutine_call_expression
88 command: (identifier) @keyword
154 command: (identifier) @keyword
89 subroutine: (identifier) @function)
155 subroutine: (identifier) @function)
90
156
157+
91; Subroutine blocks
158; Subroutine blocks
92(subroutine_block
159(subroutine_block
93 command: (identifier) @keyword
160 command: (identifier) @keyword
@@ -97,15 +164,17 @@
97 label: (identifier) @function
164 label: (identifier) @function
98 (block))
165 (block))
99
166
167+
100; Parameter declarations
168; Parameter declarations
101(parameter_declaration
169(parameter_declaration
102 command: (identifier) @keyword
170 command: (identifier) @keyword
103 (identifier)? @constant.builtin
171 (identifier)? @constant.builtin
104 macro: (macro) @variable.parameter)
172 macro: (macro) @variable.parameter)
105
173
174+
106; Variables, constants and labels
175; Variables, constants and labels
107−(macro) @variable
176+(macro) @variable.builtin
108−(internal_c_variable) @variable
177+(trace32_hll_variable) @variable.builtin
109
178
110(
179(
111 (command_expression
180 (command_expression
@@ -116,17 +185,28 @@
116(labeled_expression
185(labeled_expression
117 label: (identifier) @label)
186 label: (identifier) @label)
118
187
188+(option_expression
189+ (identifier) @constant.builtin)
190+
191+(format_expression
192+ (identifier) @constant.builtin)
193+
119(
194(
120− (argument_list (identifier) @constant.builtin)
195+ (argument_list (identifier) @constant.builtin)
121− (#match? @constant.builtin "^[%/][a-zA-Z][a-zA-Z0-9.]*$")
196+ (#match? @constant.builtin "^[%/][a-zA-Z][a-zA-Z0-9.]*$")
122)
197)
123(argument_list
198(argument_list
124− (identifier) @constant)
199+ (identifier) @constant.builtin)
200+
125
201
126; Commands
202; Commands
127(command_expression command: (identifier) @keyword)
203(command_expression command: (identifier) @keyword)
128(macro_definition command: (identifier) @keyword)
204(macro_definition command: (identifier) @keyword)
129
205
206+(call_expression
207+ function: (identifier) @function.builtin)
208+
209+
130; Control flow
210; Control flow
131(if_block
211(if_block
132 command: (identifier) @keyword.control.conditional.if)
212 command: (identifier) @keyword.control.conditional.if)
@@ -138,8 +218,10 @@
138(repeat_block
218(repeat_block
139 command: (identifier) @keyword.control.loop)
219 command: (identifier) @keyword.control.loop)
140
220
141−(call_expression
142− function: (identifier) @function)
143
221
144−(type_identifier) @type
222+; HLL variables
223+(identifier) @variable
224+(hll_field_identifier) @variable.other.member
225+
226+
145(comment) @comment
227(comment) @comment