ts-wasms 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README +2 -0
- package/out/bash/highlights.scm +56 -0
- package/out/bash/tree-sitter-bash.wasm +0 -0
- package/out/c/highlights.scm +81 -0
- package/out/c/tags.scm +9 -0
- package/out/c/tree-sitter-c.wasm +0 -0
- package/out/c-sharp/highlights.scm +213 -0
- package/out/c-sharp/tags.scm +23 -0
- package/out/c-sharp/tree-sitter-c_sharp.wasm +0 -0
- package/out/cpp/highlights.scm +70 -0
- package/out/cpp/injections.scm +3 -0
- package/out/cpp/tags.scm +15 -0
- package/out/cpp/tree-sitter-cpp.wasm +0 -0
- package/out/css/highlights.scm +76 -0
- package/out/css/tree-sitter-css.wasm +0 -0
- package/out/dart/folds.scm +8 -0
- package/out/dart/highlights.scm +224 -0
- package/out/dart/tree-sitter-dart.wasm +0 -0
- package/out/elisp/highlights.scm +72 -0
- package/out/elisp/tags.scm +5 -0
- package/out/elisp/tree-sitter-elisp.wasm +0 -0
- package/out/elixir/highlights.scm +223 -0
- package/out/elixir/injections.scm +55 -0
- package/out/elixir/tags.scm +54 -0
- package/out/elixir/tree-sitter-elixir.wasm +0 -0
- package/out/embedded-template/highlights.scm +12 -0
- package/out/embedded-template/injections-ejs.scm +7 -0
- package/out/embedded-template/injections-erb.scm +7 -0
- package/out/embedded-template/injections-etlua.scm +7 -0
- package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
- package/out/go/highlights.scm +123 -0
- package/out/go/tags.scm +42 -0
- package/out/go/tree-sitter-go.wasm +0 -0
- package/out/haskell/highlights.scm +443 -0
- package/out/haskell/injections.scm +76 -0
- package/out/haskell/locals.scm +4 -0
- package/out/haskell/tree-sitter-haskell.wasm +0 -0
- package/out/html/highlights.scm +13 -0
- package/out/html/injections.scm +7 -0
- package/out/html/tree-sitter-html.wasm +0 -0
- package/out/java/highlights.scm +149 -0
- package/out/java/tags.scm +20 -0
- package/out/java/tree-sitter-java.wasm +0 -0
- package/out/javascript/highlights-jsx.scm +8 -0
- package/out/javascript/highlights-params.scm +12 -0
- package/out/javascript/highlights.scm +204 -0
- package/out/javascript/injections.scm +31 -0
- package/out/javascript/locals.scm +23 -0
- package/out/javascript/tags.scm +99 -0
- package/out/javascript/tree-sitter-javascript.wasm +0 -0
- package/out/json/highlights.scm +16 -0
- package/out/json/tree-sitter-json.wasm +0 -0
- package/out/kotlin/highlights.scm +380 -0
- package/out/kotlin/tree-sitter-kotlin.wasm +0 -0
- package/out/objc/folds.scm +20 -0
- package/out/objc/highlights.scm +216 -0
- package/out/objc/indents.scm +1 -0
- package/out/objc/injections.scm +10 -0
- package/out/objc/locals.scm +1 -0
- package/out/objc/tree-sitter-objc.wasm +0 -0
- package/out/php/tree-sitter-php.wasm +0 -0
- package/out/php_only/tree-sitter-php_only.wasm +0 -0
- package/out/python/highlights.scm +137 -0
- package/out/python/tags.scm +14 -0
- package/out/python/tree-sitter-python.wasm +0 -0
- package/out/regex/highlights.scm +63 -0
- package/out/regex/tree-sitter-regex.wasm +0 -0
- package/out/ruby/highlights.scm +154 -0
- package/out/ruby/locals.scm +27 -0
- package/out/ruby/tags.scm +64 -0
- package/out/ruby/tree-sitter-ruby.wasm +0 -0
- package/out/rust/highlights.scm +161 -0
- package/out/rust/injections.scm +9 -0
- package/out/rust/tags.scm +60 -0
- package/out/rust/tree-sitter-rust.wasm +0 -0
- package/out/scala/highlights.scm +260 -0
- package/out/scala/indents.scm +30 -0
- package/out/scala/locals.scm +30 -0
- package/out/scala/tags.scm +66 -0
- package/out/scala/tree-sitter-scala.wasm +0 -0
- package/out/swift/folds.scm +35 -0
- package/out/swift/highlights.scm +336 -0
- package/out/swift/indents.scm +123 -0
- package/out/swift/injections.scm +10 -0
- package/out/swift/locals.scm +23 -0
- package/out/swift/outline.scm +66 -0
- package/out/swift/tags.scm +51 -0
- package/out/swift/textobjects.scm +19 -0
- package/out/swift/tree-sitter-swift.wasm +0 -0
- package/out/tsx/tree-sitter-tsx.wasm +0 -0
- package/out/typescript/tree-sitter-typescript.wasm +0 -0
- package/out/vue/tree-sitter-vue.wasm +0 -0
- package/package.json +64 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
;; Based on the nvim-treesitter highlighting, which is under the Apache license.
|
|
2
|
+
;; See https://github.com/nvim-treesitter/nvim-treesitter/blob/f8ab59861eed4a1c168505e3433462ed800f2bae/queries/kotlin/highlights.scm
|
|
3
|
+
;;
|
|
4
|
+
;; The only difference in this file is that queries using #lua-match?
|
|
5
|
+
;; have been removed.
|
|
6
|
+
|
|
7
|
+
;;; Identifiers
|
|
8
|
+
|
|
9
|
+
(simple_identifier) @variable
|
|
10
|
+
|
|
11
|
+
; `it` keyword inside lambdas
|
|
12
|
+
; FIXME: This will highlight the keyword outside of lambdas since tree-sitter
|
|
13
|
+
; does not allow us to check for arbitrary nestation
|
|
14
|
+
((simple_identifier) @variable.builtin
|
|
15
|
+
(#eq? @variable.builtin "it"))
|
|
16
|
+
|
|
17
|
+
; `field` keyword inside property getter/setter
|
|
18
|
+
; FIXME: This will highlight the keyword outside of getters and setters
|
|
19
|
+
; since tree-sitter does not allow us to check for arbitrary nestation
|
|
20
|
+
((simple_identifier) @variable.builtin
|
|
21
|
+
(#eq? @variable.builtin "field"))
|
|
22
|
+
|
|
23
|
+
; `this` this keyword inside classes
|
|
24
|
+
(this_expression) @variable.builtin
|
|
25
|
+
|
|
26
|
+
; `super` keyword inside classes
|
|
27
|
+
(super_expression) @variable.builtin
|
|
28
|
+
|
|
29
|
+
(class_parameter
|
|
30
|
+
(simple_identifier) @property)
|
|
31
|
+
|
|
32
|
+
(class_body
|
|
33
|
+
(property_declaration
|
|
34
|
+
(variable_declaration
|
|
35
|
+
(simple_identifier) @property)))
|
|
36
|
+
|
|
37
|
+
; id_1.id_2.id_3: `id_2` and `id_3` are assumed as object properties
|
|
38
|
+
(_
|
|
39
|
+
(navigation_suffix
|
|
40
|
+
(simple_identifier) @property))
|
|
41
|
+
|
|
42
|
+
(enum_entry
|
|
43
|
+
(simple_identifier) @constant)
|
|
44
|
+
|
|
45
|
+
(type_identifier) @type
|
|
46
|
+
|
|
47
|
+
((type_identifier) @type.builtin
|
|
48
|
+
(#any-of? @type.builtin
|
|
49
|
+
"Byte"
|
|
50
|
+
"Short"
|
|
51
|
+
"Int"
|
|
52
|
+
"Long"
|
|
53
|
+
"UByte"
|
|
54
|
+
"UShort"
|
|
55
|
+
"UInt"
|
|
56
|
+
"ULong"
|
|
57
|
+
"Float"
|
|
58
|
+
"Double"
|
|
59
|
+
"Boolean"
|
|
60
|
+
"Char"
|
|
61
|
+
"String"
|
|
62
|
+
"Array"
|
|
63
|
+
"ByteArray"
|
|
64
|
+
"ShortArray"
|
|
65
|
+
"IntArray"
|
|
66
|
+
"LongArray"
|
|
67
|
+
"UByteArray"
|
|
68
|
+
"UShortArray"
|
|
69
|
+
"UIntArray"
|
|
70
|
+
"ULongArray"
|
|
71
|
+
"FloatArray"
|
|
72
|
+
"DoubleArray"
|
|
73
|
+
"BooleanArray"
|
|
74
|
+
"CharArray"
|
|
75
|
+
"Map"
|
|
76
|
+
"Set"
|
|
77
|
+
"List"
|
|
78
|
+
"EmptyMap"
|
|
79
|
+
"EmptySet"
|
|
80
|
+
"EmptyList"
|
|
81
|
+
"MutableMap"
|
|
82
|
+
"MutableSet"
|
|
83
|
+
"MutableList"
|
|
84
|
+
))
|
|
85
|
+
|
|
86
|
+
(package_header
|
|
87
|
+
. (identifier)) @namespace
|
|
88
|
+
|
|
89
|
+
(import_header
|
|
90
|
+
"import" @include)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
; TODO: Seperate labeled returns/breaks/continue/super/this
|
|
94
|
+
; Must be implemented in the parser first
|
|
95
|
+
(label) @label
|
|
96
|
+
|
|
97
|
+
;;; Function definitions
|
|
98
|
+
|
|
99
|
+
(function_declaration
|
|
100
|
+
. (simple_identifier) @function)
|
|
101
|
+
|
|
102
|
+
(getter
|
|
103
|
+
("get") @function.builtin)
|
|
104
|
+
(setter
|
|
105
|
+
("set") @function.builtin)
|
|
106
|
+
|
|
107
|
+
(primary_constructor) @constructor
|
|
108
|
+
(secondary_constructor
|
|
109
|
+
("constructor") @constructor)
|
|
110
|
+
|
|
111
|
+
(constructor_invocation
|
|
112
|
+
(user_type
|
|
113
|
+
(type_identifier) @constructor))
|
|
114
|
+
|
|
115
|
+
(anonymous_initializer
|
|
116
|
+
("init") @constructor)
|
|
117
|
+
|
|
118
|
+
(parameter
|
|
119
|
+
(simple_identifier) @parameter)
|
|
120
|
+
|
|
121
|
+
(parameter_with_optional_type
|
|
122
|
+
(simple_identifier) @parameter)
|
|
123
|
+
|
|
124
|
+
; lambda parameters
|
|
125
|
+
(lambda_literal
|
|
126
|
+
(lambda_parameters
|
|
127
|
+
(variable_declaration
|
|
128
|
+
(simple_identifier) @parameter)))
|
|
129
|
+
|
|
130
|
+
;;; Function calls
|
|
131
|
+
|
|
132
|
+
; function()
|
|
133
|
+
(call_expression
|
|
134
|
+
. (simple_identifier) @function)
|
|
135
|
+
|
|
136
|
+
; object.function() or object.property.function()
|
|
137
|
+
(call_expression
|
|
138
|
+
(navigation_expression
|
|
139
|
+
(navigation_suffix
|
|
140
|
+
(simple_identifier) @function) . ))
|
|
141
|
+
|
|
142
|
+
(call_expression
|
|
143
|
+
. (simple_identifier) @function.builtin
|
|
144
|
+
(#any-of? @function.builtin
|
|
145
|
+
"arrayOf"
|
|
146
|
+
"arrayOfNulls"
|
|
147
|
+
"byteArrayOf"
|
|
148
|
+
"shortArrayOf"
|
|
149
|
+
"intArrayOf"
|
|
150
|
+
"longArrayOf"
|
|
151
|
+
"ubyteArrayOf"
|
|
152
|
+
"ushortArrayOf"
|
|
153
|
+
"uintArrayOf"
|
|
154
|
+
"ulongArrayOf"
|
|
155
|
+
"floatArrayOf"
|
|
156
|
+
"doubleArrayOf"
|
|
157
|
+
"booleanArrayOf"
|
|
158
|
+
"charArrayOf"
|
|
159
|
+
"emptyArray"
|
|
160
|
+
"mapOf"
|
|
161
|
+
"setOf"
|
|
162
|
+
"listOf"
|
|
163
|
+
"emptyMap"
|
|
164
|
+
"emptySet"
|
|
165
|
+
"emptyList"
|
|
166
|
+
"mutableMapOf"
|
|
167
|
+
"mutableSetOf"
|
|
168
|
+
"mutableListOf"
|
|
169
|
+
"print"
|
|
170
|
+
"println"
|
|
171
|
+
"error"
|
|
172
|
+
"TODO"
|
|
173
|
+
"run"
|
|
174
|
+
"runCatching"
|
|
175
|
+
"repeat"
|
|
176
|
+
"lazy"
|
|
177
|
+
"lazyOf"
|
|
178
|
+
"enumValues"
|
|
179
|
+
"enumValueOf"
|
|
180
|
+
"assert"
|
|
181
|
+
"check"
|
|
182
|
+
"checkNotNull"
|
|
183
|
+
"require"
|
|
184
|
+
"requireNotNull"
|
|
185
|
+
"with"
|
|
186
|
+
"suspend"
|
|
187
|
+
"synchronized"
|
|
188
|
+
))
|
|
189
|
+
|
|
190
|
+
;;; Literals
|
|
191
|
+
|
|
192
|
+
[
|
|
193
|
+
(line_comment)
|
|
194
|
+
(multiline_comment)
|
|
195
|
+
(shebang_line)
|
|
196
|
+
] @comment
|
|
197
|
+
|
|
198
|
+
(real_literal) @float
|
|
199
|
+
[
|
|
200
|
+
(integer_literal)
|
|
201
|
+
(long_literal)
|
|
202
|
+
(hex_literal)
|
|
203
|
+
(bin_literal)
|
|
204
|
+
(unsigned_literal)
|
|
205
|
+
] @number
|
|
206
|
+
|
|
207
|
+
[
|
|
208
|
+
"null" ; should be highlighted the same as booleans
|
|
209
|
+
(boolean_literal)
|
|
210
|
+
] @boolean
|
|
211
|
+
|
|
212
|
+
(character_literal) @character
|
|
213
|
+
|
|
214
|
+
(string_literal) @string
|
|
215
|
+
|
|
216
|
+
(character_escape_seq) @string.escape
|
|
217
|
+
|
|
218
|
+
; There are 3 ways to define a regex
|
|
219
|
+
; - "[abc]?".toRegex()
|
|
220
|
+
(call_expression
|
|
221
|
+
(navigation_expression
|
|
222
|
+
((string_literal) @string.regex)
|
|
223
|
+
(navigation_suffix
|
|
224
|
+
((simple_identifier) @_function
|
|
225
|
+
(#eq? @_function "toRegex")))))
|
|
226
|
+
|
|
227
|
+
; - Regex("[abc]?")
|
|
228
|
+
(call_expression
|
|
229
|
+
((simple_identifier) @_function
|
|
230
|
+
(#eq? @_function "Regex"))
|
|
231
|
+
(call_suffix
|
|
232
|
+
(value_arguments
|
|
233
|
+
(value_argument
|
|
234
|
+
(string_literal) @string.regex))))
|
|
235
|
+
|
|
236
|
+
; - Regex.fromLiteral("[abc]?")
|
|
237
|
+
(call_expression
|
|
238
|
+
(navigation_expression
|
|
239
|
+
((simple_identifier) @_class
|
|
240
|
+
(#eq? @_class "Regex"))
|
|
241
|
+
(navigation_suffix
|
|
242
|
+
((simple_identifier) @_function
|
|
243
|
+
(#eq? @_function "fromLiteral"))))
|
|
244
|
+
(call_suffix
|
|
245
|
+
(value_arguments
|
|
246
|
+
(value_argument
|
|
247
|
+
(string_literal) @string.regex))))
|
|
248
|
+
|
|
249
|
+
;;; Keywords
|
|
250
|
+
|
|
251
|
+
(type_alias "typealias" @keyword)
|
|
252
|
+
[
|
|
253
|
+
(class_modifier)
|
|
254
|
+
(member_modifier)
|
|
255
|
+
(function_modifier)
|
|
256
|
+
(property_modifier)
|
|
257
|
+
(platform_modifier)
|
|
258
|
+
(variance_modifier)
|
|
259
|
+
(parameter_modifier)
|
|
260
|
+
(visibility_modifier)
|
|
261
|
+
(reification_modifier)
|
|
262
|
+
(inheritance_modifier)
|
|
263
|
+
]@keyword
|
|
264
|
+
|
|
265
|
+
[
|
|
266
|
+
"val"
|
|
267
|
+
"var"
|
|
268
|
+
"enum"
|
|
269
|
+
"class"
|
|
270
|
+
"object"
|
|
271
|
+
"interface"
|
|
272
|
+
; "typeof" ; NOTE: It is reserved for future use
|
|
273
|
+
] @keyword
|
|
274
|
+
|
|
275
|
+
("fun") @keyword.function
|
|
276
|
+
|
|
277
|
+
(jump_expression) @keyword.return
|
|
278
|
+
|
|
279
|
+
[
|
|
280
|
+
"if"
|
|
281
|
+
"else"
|
|
282
|
+
"when"
|
|
283
|
+
] @conditional
|
|
284
|
+
|
|
285
|
+
[
|
|
286
|
+
"for"
|
|
287
|
+
"do"
|
|
288
|
+
"while"
|
|
289
|
+
] @repeat
|
|
290
|
+
|
|
291
|
+
[
|
|
292
|
+
"try"
|
|
293
|
+
"catch"
|
|
294
|
+
"throw"
|
|
295
|
+
"finally"
|
|
296
|
+
] @exception
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
(annotation
|
|
300
|
+
"@" @attribute (use_site_target)? @attribute)
|
|
301
|
+
(annotation
|
|
302
|
+
(user_type
|
|
303
|
+
(type_identifier) @attribute))
|
|
304
|
+
(annotation
|
|
305
|
+
(constructor_invocation
|
|
306
|
+
(user_type
|
|
307
|
+
(type_identifier) @attribute)))
|
|
308
|
+
|
|
309
|
+
(file_annotation
|
|
310
|
+
"@" @attribute "file" @attribute ":" @attribute)
|
|
311
|
+
(file_annotation
|
|
312
|
+
(user_type
|
|
313
|
+
(type_identifier) @attribute))
|
|
314
|
+
(file_annotation
|
|
315
|
+
(constructor_invocation
|
|
316
|
+
(user_type
|
|
317
|
+
(type_identifier) @attribute)))
|
|
318
|
+
|
|
319
|
+
;;; Operators & Punctuation
|
|
320
|
+
|
|
321
|
+
[
|
|
322
|
+
"!"
|
|
323
|
+
"!="
|
|
324
|
+
"!=="
|
|
325
|
+
"="
|
|
326
|
+
"=="
|
|
327
|
+
"==="
|
|
328
|
+
">"
|
|
329
|
+
">="
|
|
330
|
+
"<"
|
|
331
|
+
"<="
|
|
332
|
+
"||"
|
|
333
|
+
"&&"
|
|
334
|
+
"+"
|
|
335
|
+
"++"
|
|
336
|
+
"+="
|
|
337
|
+
"-"
|
|
338
|
+
"--"
|
|
339
|
+
"-="
|
|
340
|
+
"*"
|
|
341
|
+
"*="
|
|
342
|
+
"/"
|
|
343
|
+
"/="
|
|
344
|
+
"%"
|
|
345
|
+
"%="
|
|
346
|
+
"?."
|
|
347
|
+
"?:"
|
|
348
|
+
"!!"
|
|
349
|
+
"is"
|
|
350
|
+
"!is"
|
|
351
|
+
"in"
|
|
352
|
+
"!in"
|
|
353
|
+
"as"
|
|
354
|
+
"as?"
|
|
355
|
+
".."
|
|
356
|
+
"->"
|
|
357
|
+
] @operator
|
|
358
|
+
|
|
359
|
+
[
|
|
360
|
+
"(" ")"
|
|
361
|
+
"[" "]"
|
|
362
|
+
"{" "}"
|
|
363
|
+
] @punctuation.bracket
|
|
364
|
+
|
|
365
|
+
[
|
|
366
|
+
"."
|
|
367
|
+
","
|
|
368
|
+
";"
|
|
369
|
+
":"
|
|
370
|
+
"::"
|
|
371
|
+
] @punctuation.delimiter
|
|
372
|
+
|
|
373
|
+
; NOTE: `interpolated_identifier`s can be highlighted in any way
|
|
374
|
+
(string_literal
|
|
375
|
+
"$" @punctuation.special
|
|
376
|
+
(interpolated_identifier) @none)
|
|
377
|
+
(string_literal
|
|
378
|
+
"${" @punctuation.special
|
|
379
|
+
(interpolated_expression) @none
|
|
380
|
+
"}" @punctuation.special)
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
; inherits: c
|
|
2
|
+
|
|
3
|
+
[
|
|
4
|
+
(class_declaration)
|
|
5
|
+
(class_interface)
|
|
6
|
+
(class_implementation)
|
|
7
|
+
(protocol_declaration)
|
|
8
|
+
(property_declaration)
|
|
9
|
+
(method_declaration)
|
|
10
|
+
(struct_declaration)
|
|
11
|
+
(struct_declarator)
|
|
12
|
+
(try_statement)
|
|
13
|
+
(catch_clause)
|
|
14
|
+
(finally_clause)
|
|
15
|
+
(throw_statement)
|
|
16
|
+
(block_literal)
|
|
17
|
+
(ms_asm_block)
|
|
18
|
+
(dictionary_literal)
|
|
19
|
+
(array_literal)
|
|
20
|
+
] @fold
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
; inherits: c
|
|
2
|
+
|
|
3
|
+
; Preprocs
|
|
4
|
+
|
|
5
|
+
(preproc_undef
|
|
6
|
+
name: (_) @constant) @preproc
|
|
7
|
+
|
|
8
|
+
; Includes
|
|
9
|
+
|
|
10
|
+
(module_import "@import" @include path: (identifier) @namespace)
|
|
11
|
+
|
|
12
|
+
((preproc_include
|
|
13
|
+
_ @include path: (_))
|
|
14
|
+
(#any-of? @include "#include" "#import"))
|
|
15
|
+
|
|
16
|
+
; Type Qualifiers
|
|
17
|
+
|
|
18
|
+
[
|
|
19
|
+
"@optional"
|
|
20
|
+
"@required"
|
|
21
|
+
"__covariant"
|
|
22
|
+
"__contravariant"
|
|
23
|
+
(visibility_specification)
|
|
24
|
+
] @type.qualifier
|
|
25
|
+
|
|
26
|
+
; Storageclasses
|
|
27
|
+
|
|
28
|
+
[
|
|
29
|
+
"@autoreleasepool"
|
|
30
|
+
"@synthesize"
|
|
31
|
+
"@dynamic"
|
|
32
|
+
"volatile"
|
|
33
|
+
(protocol_qualifier)
|
|
34
|
+
] @storageclass
|
|
35
|
+
|
|
36
|
+
; Keywords
|
|
37
|
+
|
|
38
|
+
[
|
|
39
|
+
"@protocol"
|
|
40
|
+
"@interface"
|
|
41
|
+
"@implementation"
|
|
42
|
+
"@compatibility_alias"
|
|
43
|
+
"@property"
|
|
44
|
+
"@selector"
|
|
45
|
+
"@defs"
|
|
46
|
+
"availability"
|
|
47
|
+
"@end"
|
|
48
|
+
] @keyword
|
|
49
|
+
|
|
50
|
+
(class_declaration "@" @keyword "class" @keyword) ; I hate Obj-C for allowing "@ class" :)
|
|
51
|
+
|
|
52
|
+
(method_definition ["+" "-"] @keyword.function)
|
|
53
|
+
(method_declaration ["+" "-"] @keyword.function)
|
|
54
|
+
|
|
55
|
+
[
|
|
56
|
+
"__typeof__"
|
|
57
|
+
"__typeof"
|
|
58
|
+
"typeof"
|
|
59
|
+
"in"
|
|
60
|
+
] @keyword.operator
|
|
61
|
+
|
|
62
|
+
[
|
|
63
|
+
"@synchronized"
|
|
64
|
+
"oneway"
|
|
65
|
+
] @keyword.coroutine
|
|
66
|
+
|
|
67
|
+
; Exceptions
|
|
68
|
+
|
|
69
|
+
[
|
|
70
|
+
"@try"
|
|
71
|
+
"__try"
|
|
72
|
+
"@catch"
|
|
73
|
+
"__catch"
|
|
74
|
+
"@finally"
|
|
75
|
+
"__finally"
|
|
76
|
+
"@throw"
|
|
77
|
+
] @exception
|
|
78
|
+
|
|
79
|
+
; Variables
|
|
80
|
+
|
|
81
|
+
((identifier) @variable.builtin
|
|
82
|
+
(#any-of? @variable.builtin "self" "super"))
|
|
83
|
+
|
|
84
|
+
; Functions & Methods
|
|
85
|
+
|
|
86
|
+
[
|
|
87
|
+
"objc_bridge_related"
|
|
88
|
+
"@available"
|
|
89
|
+
"__builtin_available"
|
|
90
|
+
"va_arg"
|
|
91
|
+
"asm"
|
|
92
|
+
] @function.builtin
|
|
93
|
+
|
|
94
|
+
(method_definition (identifier) @method)
|
|
95
|
+
|
|
96
|
+
(method_declaration (identifier) @method)
|
|
97
|
+
|
|
98
|
+
(method_identifier (identifier)? @method ":" @method (identifier)? @method)
|
|
99
|
+
|
|
100
|
+
(message_expression method: (identifier) @method.call)
|
|
101
|
+
|
|
102
|
+
; Constructors
|
|
103
|
+
|
|
104
|
+
((message_expression method: (identifier) @constructor)
|
|
105
|
+
(#eq? @constructor "init"))
|
|
106
|
+
|
|
107
|
+
; Attributes
|
|
108
|
+
|
|
109
|
+
(availability_attribute_specifier
|
|
110
|
+
[
|
|
111
|
+
"CF_FORMAT_FUNCTION" "NS_AVAILABLE" "__IOS_AVAILABLE" "NS_AVAILABLE_IOS"
|
|
112
|
+
"API_AVAILABLE" "API_UNAVAILABLE" "API_DEPRECATED" "NS_ENUM_AVAILABLE_IOS"
|
|
113
|
+
"NS_DEPRECATED_IOS" "NS_ENUM_DEPRECATED_IOS" "NS_FORMAT_FUNCTION" "DEPRECATED_MSG_ATTRIBUTE"
|
|
114
|
+
"__deprecated_msg" "__deprecated_enum_msg" "NS_SWIFT_NAME" "NS_SWIFT_UNAVAILABLE"
|
|
115
|
+
"NS_EXTENSION_UNAVAILABLE_IOS" "NS_CLASS_AVAILABLE_IOS" "NS_CLASS_DEPRECATED_IOS" "__OSX_AVAILABLE_STARTING"
|
|
116
|
+
"NS_ROOT_CLASS" "NS_UNAVAILABLE" "NS_REQUIRES_NIL_TERMINATION" "CF_RETURNS_RETAINED"
|
|
117
|
+
"CF_RETURNS_NOT_RETAINED" "DEPRECATED_ATTRIBUTE" "UI_APPEARANCE_SELECTOR" "UNAVAILABLE_ATTRIBUTE"
|
|
118
|
+
]) @attribute
|
|
119
|
+
|
|
120
|
+
; Macros
|
|
121
|
+
|
|
122
|
+
(type_qualifier
|
|
123
|
+
[
|
|
124
|
+
"_Complex"
|
|
125
|
+
"_Nonnull"
|
|
126
|
+
"_Nullable"
|
|
127
|
+
"_Nullable_result"
|
|
128
|
+
"_Null_unspecified"
|
|
129
|
+
"__autoreleasing"
|
|
130
|
+
"__block"
|
|
131
|
+
"__bridge"
|
|
132
|
+
"__bridge_retained"
|
|
133
|
+
"__bridge_transfer"
|
|
134
|
+
"__complex"
|
|
135
|
+
"__kindof"
|
|
136
|
+
"__nonnull"
|
|
137
|
+
"__nullable"
|
|
138
|
+
"__ptrauth_objc_class_ro"
|
|
139
|
+
"__ptrauth_objc_isa_pointer"
|
|
140
|
+
"__ptrauth_objc_super_pointer"
|
|
141
|
+
"__strong"
|
|
142
|
+
"__thread"
|
|
143
|
+
"__unsafe_unretained"
|
|
144
|
+
"__unused"
|
|
145
|
+
"__weak"
|
|
146
|
+
]) @function.macro.builtin
|
|
147
|
+
|
|
148
|
+
[ "__real" "__imag" ] @function.macro.builtin
|
|
149
|
+
|
|
150
|
+
((call_expression function: (identifier) @function.macro)
|
|
151
|
+
(#eq? @function.macro "testassert"))
|
|
152
|
+
|
|
153
|
+
; Types
|
|
154
|
+
|
|
155
|
+
(class_declaration (identifier) @type)
|
|
156
|
+
|
|
157
|
+
(class_interface "@interface" . (identifier) @type superclass: _? @type category: _? @namespace)
|
|
158
|
+
|
|
159
|
+
(class_implementation "@implementation" . (identifier) @type superclass: _? @type category: _? @namespace)
|
|
160
|
+
|
|
161
|
+
(protocol_forward_declaration (identifier) @type) ; @interface :(
|
|
162
|
+
|
|
163
|
+
(protocol_reference_list (identifier) @type) ; ^
|
|
164
|
+
|
|
165
|
+
[
|
|
166
|
+
"BOOL"
|
|
167
|
+
"IMP"
|
|
168
|
+
"SEL"
|
|
169
|
+
"Class"
|
|
170
|
+
"id"
|
|
171
|
+
] @type.builtin
|
|
172
|
+
|
|
173
|
+
; Constants
|
|
174
|
+
|
|
175
|
+
(property_attribute (identifier) @constant "="?)
|
|
176
|
+
|
|
177
|
+
[ "__asm" "__asm__" ] @constant.macro
|
|
178
|
+
|
|
179
|
+
; Properties
|
|
180
|
+
|
|
181
|
+
(property_implementation "@synthesize" (identifier) @property)
|
|
182
|
+
|
|
183
|
+
((identifier) @property
|
|
184
|
+
(#has-ancestor? @property struct_declaration))
|
|
185
|
+
|
|
186
|
+
; Parameters
|
|
187
|
+
|
|
188
|
+
(method_parameter ":" @method (identifier) @parameter)
|
|
189
|
+
|
|
190
|
+
(method_parameter declarator: (identifier) @parameter)
|
|
191
|
+
|
|
192
|
+
(parameter_declaration
|
|
193
|
+
declarator: (function_declarator
|
|
194
|
+
declarator: (parenthesized_declarator
|
|
195
|
+
(block_pointer_declarator
|
|
196
|
+
declarator: (identifier) @parameter))))
|
|
197
|
+
|
|
198
|
+
"..." @parameter.builtin
|
|
199
|
+
|
|
200
|
+
; Operators
|
|
201
|
+
|
|
202
|
+
[
|
|
203
|
+
"^"
|
|
204
|
+
] @operator
|
|
205
|
+
|
|
206
|
+
; Literals
|
|
207
|
+
|
|
208
|
+
(platform) @string.special
|
|
209
|
+
|
|
210
|
+
(version_number) @text.uri @number
|
|
211
|
+
|
|
212
|
+
; Punctuation
|
|
213
|
+
|
|
214
|
+
"@" @punctuation.special
|
|
215
|
+
|
|
216
|
+
[ "<" ">" ] @punctuation.bracket
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: c
|
|
Binary file
|
|
Binary file
|
|
Binary file
|