Debian Codegraph @

runtime/queries/tact/highlights.scm

raw symbols SCIP
1 ; See: https://docs.helix-editor.com/master/themes.html#syntax-highlighting
2 ; -------------------------------------------------------------------------
3
4 ; attribute
5 ; ---------
6
7 [
8 "@name"
9 "@interface"
10 ] @attribute
11
12 ; operator
13 ; --------
14
15 [
16 "-" "-="
17 "+" "+="
18 "*" "*="
19 "/" "/="
20 "%" "%="
21 "=" "=="
22 "!" "!=" "!!"
23 "<" "<=" "<<"
24 ">" ">=" ">>"
25 "&" "|"
26 "&&" "||"
27 ] @operator
28
29 ; punctuation.bracket
30 ; -------------------
31
32 [
33 "(" ")"
34 "{" "}"
35 ] @punctuation.bracket
36
37 ; punctuation.delimiter
38 ; ---------------------
39
40 [
41 ";"
42 ","
43 "."
44 ":"
45 "?"
46 ] @punctuation.delimiter
47
48 ; variable
49 ; --------
50
51 (identifier) @variable
52
53 ; variable.builtin
54 ; ----------------
55
56 (self) @variable.builtin
57
58 ; variable.parameter
59 ; ------------------
60
61 (parameter
62 name: (identifier) @variable.parameter)
63
64 ; variable.other.member
65 ; ---------------------
66
67 (field
68 name: (identifier) @variable.other.member)
69
70 (contract_body
71 (constant
72 name: (identifier) @variable.other.member))
73
74 (trait_body
75 (constant
76 name: (identifier) @variable.other.member))
77
78 (field_access_expression
79 name: (identifier) @variable.other.member)
80
81 (lvalue (_) (_) @variable.other.member)
82
83 (instance_argument
84 name: (identifier) @variable.other.member)
85
86 ; comment.block
87 ; -------------
88
89 (comment) @comment.block
90
91 ; comment.line
92 ; ------------
93
94 ((comment) @comment.line
95 (#match? @comment.line "^//"))
96
97 ; function
98 ; --------
99
100 (func_identifier) @function
101
102 (native_function
103 name: (identifier) @function)
104
105 (static_function
106 name: (identifier) @function)
107
108 (static_call_expression
109 name: (identifier) @function)
110
111 (init_function
112 "init" @function.method)
113
114 (receive_function
115 "receive" @function.method)
116
117 (bounced_function
118 "bounced" @function.method)
119
120 (external_function
121 "external" @function.method)
122
123 (function
124 name: (identifier) @function.method)
125
126 ; function.method
127 ; ---------------
128
129 (method_call_expression
130 name: (identifier) @function.method)
131
132 ; function.builtin
133 ; ----------------
134
135 ((identifier) @function.builtin
136 (#any-of? @function.builtin
137 "send" "sender" "require" "now"
138 "myBalance" "myAddress" "newAddress"
139 "contractAddress" "contractAddressExt"
140 "emit" "cell" "ton"
141 "beginString" "beginComment" "beginTailString" "beginStringFromBuilder" "beginCell" "emptyCell"
142 "randomInt" "random"
143 "checkSignature" "checkDataSignature" "sha256"
144 "min" "max" "abs" "pow"
145 "throw" "dump" "getConfigParam"
146 "nativeThrowWhen" "nativeThrowUnless" "nativeReserve"
147 "nativeRandomize" "nativeRandomizeLt" "nativePrepareRandom" "nativeRandom" "nativeRandomInterval")
148 (#is-not? local))
149
150 ; keyword.control.conditional
151 ; ---------------------------
152
153 [
154 "if" "else"
155 ] @keyword.control.conditional
156
157 ; keyword.control.repeat
158 ; ----------------------
159
160 [
161 "while" "repeat" "do" "until"
162 ] @keyword.control.repeat
163
164 ; keyword.control.import
165 ; ----------------------
166
167 "import" @keyword.control.import
168
169 ; keyword.control.return
170 ; ----------------------
171
172 "return" @keyword.control.return
173
174 ; keyword.operator
175 ; ----------------
176
177 "initOf" @keyword.operator
178
179 ; keyword.directive
180 ; -----------------
181
182 "primitive" @keyword.directive
183
184 ; keyword.function
185 ; ----------------
186
187 [
188 "fun"
189 "native"
190 ] @keyword.function
191
192 ; keyword.storage.type
193 ; --------------------
194
195 [
196 "contract" "trait" "struct" "message" "with"
197 "const" "let"
198 ] @keyword.storage.type
199
200 ; keyword.storage.modifier
201 ; ------------------------
202
203 [
204 "get" "mutates" "extends" "virtual" "override" "inline" "abstract"
205 ] @keyword.storage.modifier
206
207 ; keyword
208 ; -------
209
210 [
211 "with"
212 ; "public" ; -- not used, but declared in grammar.ohm
213 ; "extend" ; -- not used, but declared in grammar.ohm
214 ] @keyword
215
216 ; constant.builtin.boolean
217 ; ------------------------
218
219 (boolean) @constant.builtin.boolean
220
221 ; constant.builtin
222 ; ----------------
223
224 ((identifier) @constant.builtin
225 (#any-of? @constant.builtin
226 "SendPayGasSeparately"
227 "SendIgnoreErrors"
228 "SendDestroyIfZero"
229 "SendRemainingValue"
230 "SendRemainingBalance")
231 (#is-not? local))
232
233 (null) @constant.builtin
234
235 ; constant.numeric.integer
236 ; ------------------------
237
238 (integer) @constant.numeric.integer
239
240 ; constant
241 ; --------
242
243 (constant
244 name: (identifier) @constant)
245
246 ; string
247 ; ------
248
249 (string) @string
250
251 ; string.special.path
252 ; -------------------
253
254 (import_statement
255 library: (string) @string.special.path)
256
257 ; type
258 ; ----
259
260 (type_identifier) @type
261
262 ; type.builtin
263 ; ------------
264
265 (tlb_serialization
266 "as" @keyword
267 type: (identifier) @type.builtin
268 (#any-of? @type.builtin
269 "int8" "int16" "int32" "int64" "int128" "int256" "int257"
270 "uint8" "uint16" "uint32" "uint64" "uint128" "uint256"
271 "coins" "remaining" "bytes32" "bytes64"))
272
273 ((type_identifier) @type.builtin
274 (#any-of? @type.builtin
275 "Address" "Bool" "Builder" "Cell" "Int" "Slice" "String" "StringBuilder"))
276
277 (map_type
278 "map" @type.builtin
279 "<" @punctuation.bracket
280 ">" @punctuation.bracket)
281
282 (bounced_type
283 "bounced" @type.builtin
284 "<" @punctuation.bracket
285 ">" @punctuation.bracket)
286
287 ((identifier) @type.builtin
288 (#eq? @type.builtin "SendParameters")
289 (#is-not? local))
290
291 ; constructor
292 ; -----------
293
294 (instance_expression
295 name: (identifier) @constructor)
296
297 (initOf
298 name: (identifier) @constructor)