ts-wasms 1.0.2 → 1.0.4
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/README.md +33 -0
- package/out/bash/tree-sitter-bash.wasm +0 -0
- package/out/c/tree-sitter-c.wasm +0 -0
- package/out/c-sharp/tree-sitter-c_sharp.wasm +0 -0
- package/out/clojure/highlights.scm +29 -0
- package/out/clojure/tree-sitter-clojure.wasm +0 -0
- package/out/clojurescript/highlights.scm +29 -0
- package/out/clojurescript/tree-sitter-clojure.wasm +0 -0
- package/out/commonlisp/tags.scm +122 -0
- package/out/commonlisp/tree-sitter-commonlisp.wasm +0 -0
- package/out/cpp/tree-sitter-cpp.wasm +0 -0
- package/out/css/tree-sitter-css.wasm +0 -0
- package/out/dart/tree-sitter-dart.wasm +0 -0
- package/out/elisp/tree-sitter-elisp.wasm +0 -0
- package/out/elixir/tree-sitter-elixir.wasm +0 -0
- package/out/elm/highlights.scm +76 -0
- package/out/elm/injections.scm +4 -0
- package/out/elm/locals.scm +15 -0
- package/out/elm/tags.scm +19 -0
- package/out/elm/tree-sitter-elm.wasm +0 -0
- package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
- package/out/erlang/highlights.scm +230 -0
- package/out/erlang/tree-sitter-erlang.wasm +0 -0
- package/out/go/tree-sitter-go.wasm +0 -0
- package/out/graphql/tree-sitter-graphql.wasm +0 -0
- package/out/haskell/tree-sitter-haskell.wasm +0 -0
- package/out/hcl/tree-sitter-hcl.wasm +0 -0
- package/out/hcl-terraform/tree-sitter-terraform.wasm +0 -0
- package/out/html/tree-sitter-html.wasm +0 -0
- package/out/java/tree-sitter-java.wasm +0 -0
- package/out/javascript/tree-sitter-javascript.wasm +0 -0
- package/out/json/tree-sitter-json.wasm +0 -0
- package/out/julia/highlights.scm +375 -0
- package/out/julia/injections.scm +42 -0
- package/out/julia/locals.scm +71 -0
- package/out/julia/tree-sitter-julia.wasm +0 -0
- package/out/kotlin/tree-sitter-kotlin.wasm +0 -0
- package/out/lua/highlights.scm +201 -0
- package/out/lua/injections.scm +12 -0
- package/out/lua/locals.scm +32 -0
- package/out/lua/tags.scm +36 -0
- package/out/lua/tree-sitter-lua.wasm +0 -0
- package/out/markdown/highlights.scm +52 -0
- package/out/markdown/injections.scm +12 -0
- package/out/markdown/tree-sitter-markdown.wasm +0 -0
- package/out/markdown-inline/highlights.scm +37 -0
- package/out/markdown-inline/injections.scm +2 -0
- package/out/markdown-inline/tree-sitter-markdown_inline.wasm +0 -0
- package/out/nix/highlights.scm +99 -0
- package/out/nix/injections.scm +39 -0
- package/out/nix/locals.scm +33 -0
- package/out/nix/tags.scm +16 -0
- package/out/nix/tree-sitter-nix.wasm +0 -0
- package/out/objc/tree-sitter-objc.wasm +0 -0
- package/out/ocaml/highlights.scm +148 -0
- package/out/ocaml/locals.scm +24 -0
- package/out/ocaml/tags.scm +170 -0
- package/out/ocaml/tree-sitter-ocaml.wasm +0 -0
- package/out/ocaml-interface/highlights.scm +148 -0
- package/out/ocaml-interface/locals.scm +24 -0
- package/out/ocaml-interface/tags.scm +170 -0
- package/out/ocaml-interface/tree-sitter-ocaml_interface.wasm +0 -0
- package/out/ocaml-type/highlights.scm +148 -0
- package/out/ocaml-type/locals.scm +24 -0
- package/out/ocaml-type/tags.scm +170 -0
- package/out/ocaml-type/tree-sitter-ocaml_type.wasm +0 -0
- package/out/perl/folds.scm +27 -0
- package/out/perl/highlights.scm +162 -0
- package/out/perl/injections.scm +14 -0
- package/out/perl/matchup.scm +30 -0
- package/out/perl/tree-sitter-perl.wasm +0 -0
- package/out/php/highlights.scm +203 -0
- package/out/php/injections-text.scm +3 -0
- package/out/php/injections.scm +10 -0
- package/out/php/tags.scm +40 -0
- package/out/php/tree-sitter-php.wasm +0 -0
- package/out/php-only/highlights.scm +203 -0
- package/out/php-only/injections-text.scm +3 -0
- package/out/php-only/injections.scm +10 -0
- package/out/php-only/tags.scm +40 -0
- package/out/{php_only → php-only}/tree-sitter-php_only.wasm +0 -0
- package/out/prisma/highlights.scm +39 -0
- package/out/prisma/tree-sitter-prisma.wasm +0 -0
- package/out/python/tree-sitter-python.wasm +0 -0
- package/out/query/tree-sitter-query.wasm +0 -0
- package/out/r/highlights.scm +112 -0
- package/out/r/locals.scm +18 -0
- package/out/r/tags.scm +21 -0
- package/out/r/tree-sitter-r.wasm +0 -0
- package/out/racket/highlights.scm +108 -0
- package/out/racket/locals.scm +34 -0
- package/out/racket/tags.scm +12 -0
- package/out/racket/tree-sitter-racket.wasm +0 -0
- package/out/regex/tree-sitter-regex.wasm +0 -0
- package/out/ruby/tree-sitter-ruby.wasm +0 -0
- package/out/rust/tree-sitter-rust.wasm +0 -0
- package/out/scala/tree-sitter-scala.wasm +0 -0
- package/out/scheme/highlights.scm +84 -0
- package/out/scheme/tree-sitter-scheme.wasm +0 -0
- package/out/scss/highlights.scm +69 -0
- package/out/scss/tree-sitter-scss.wasm +0 -0
- package/out/sql/tree-sitter-SQL.wasm +0 -0
- package/out/swift/tree-sitter-swift.wasm +0 -0
- package/out/toml/highlights.scm +53 -0
- package/out/toml/tree-sitter-toml.wasm +0 -0
- package/out/typescript/highlights.scm +35 -0
- package/out/typescript/locals.scm +2 -0
- package/out/typescript/tags.scm +23 -0
- package/out/typescript/tree-sitter-typescript.wasm +0 -0
- package/out/typescript-tsx/highlights.scm +35 -0
- package/out/typescript-tsx/locals.scm +2 -0
- package/out/typescript-tsx/tags.scm +23 -0
- package/out/{tsx → typescript-tsx}/tree-sitter-tsx.wasm +0 -0
- package/out/vimdoc/tree-sitter-vimdoc.wasm +0 -0
- package/out/vue/tree-sitter-vue.wasm +0 -0
- package/out/xml/tree-sitter-xml.wasm +0 -0
- package/out/xml-dtd/tree-sitter-dtd.wasm +0 -0
- package/out/yaml/tree-sitter-yaml.wasm +0 -0
- package/out/zig/folds.scm +23 -0
- package/out/zig/highlights.scm +291 -0
- package/out/zig/indents.scm +22 -0
- package/out/zig/injections.scm +10 -0
- package/out/zig/tree-sitter-zig.wasm +0 -0
- package/package.json +79 -63
- package/README +0 -2
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
; Identifiers
|
|
2
|
+
(identifier) @variable
|
|
3
|
+
|
|
4
|
+
(field_expression
|
|
5
|
+
(identifier) @variable.member .)
|
|
6
|
+
|
|
7
|
+
; Symbols
|
|
8
|
+
(quote_expression
|
|
9
|
+
":" @string.special.symbol
|
|
10
|
+
[
|
|
11
|
+
(identifier)
|
|
12
|
+
(operator)
|
|
13
|
+
] @string.special.symbol)
|
|
14
|
+
|
|
15
|
+
; Function calls
|
|
16
|
+
(call_expression
|
|
17
|
+
(identifier) @function.call)
|
|
18
|
+
|
|
19
|
+
(call_expression
|
|
20
|
+
(field_expression
|
|
21
|
+
(identifier) @function.call .))
|
|
22
|
+
|
|
23
|
+
(broadcast_call_expression
|
|
24
|
+
(identifier) @function.call)
|
|
25
|
+
|
|
26
|
+
(broadcast_call_expression
|
|
27
|
+
(field_expression
|
|
28
|
+
(identifier) @function.call .))
|
|
29
|
+
|
|
30
|
+
(binary_expression
|
|
31
|
+
(_)
|
|
32
|
+
(operator) @_pipe
|
|
33
|
+
(identifier) @function.call
|
|
34
|
+
(#any-of? @_pipe "|>" ".|>"))
|
|
35
|
+
|
|
36
|
+
; Macros
|
|
37
|
+
(macro_identifier
|
|
38
|
+
"@" @function.macro
|
|
39
|
+
(identifier) @function.macro)
|
|
40
|
+
|
|
41
|
+
(macro_definition
|
|
42
|
+
(signature
|
|
43
|
+
(call_expression
|
|
44
|
+
.
|
|
45
|
+
(identifier) @function.macro)))
|
|
46
|
+
|
|
47
|
+
; Built-in functions
|
|
48
|
+
; print.("\"", filter(name -> getglobal(Core, name) isa Core.Builtin, names(Core)), "\" ")
|
|
49
|
+
((identifier) @function.builtin
|
|
50
|
+
(#any-of? @function.builtin
|
|
51
|
+
"applicable" "fieldtype" "getfield" "getglobal" "invoke" "isa" "isdefined" "isdefinedglobal"
|
|
52
|
+
"modifyfield!" "modifyglobal!" "nfields" "replacefield!" "replaceglobal!" "setfield!"
|
|
53
|
+
"setfieldonce!" "setglobal!" "setglobalonce!" "swapfield!" "swapglobal!" "throw" "tuple"
|
|
54
|
+
"typeassert" "typeof"))
|
|
55
|
+
|
|
56
|
+
; Type definitions
|
|
57
|
+
(type_head
|
|
58
|
+
(_) @type.definition)
|
|
59
|
+
|
|
60
|
+
; Type annotations
|
|
61
|
+
(parametrized_type_expression
|
|
62
|
+
[
|
|
63
|
+
(identifier) @type
|
|
64
|
+
(field_expression
|
|
65
|
+
(identifier) @type .)
|
|
66
|
+
]
|
|
67
|
+
(curly_expression
|
|
68
|
+
(_) @type))
|
|
69
|
+
|
|
70
|
+
(typed_expression
|
|
71
|
+
(identifier) @type .)
|
|
72
|
+
|
|
73
|
+
(unary_typed_expression
|
|
74
|
+
(identifier) @type .)
|
|
75
|
+
|
|
76
|
+
(where_expression
|
|
77
|
+
[
|
|
78
|
+
(curly_expression
|
|
79
|
+
(_) @type)
|
|
80
|
+
(_) @type
|
|
81
|
+
] .)
|
|
82
|
+
|
|
83
|
+
(unary_expression
|
|
84
|
+
(operator) @operator
|
|
85
|
+
(_) @type
|
|
86
|
+
(#any-of? @operator "<:" ">:"))
|
|
87
|
+
|
|
88
|
+
(binary_expression
|
|
89
|
+
(_) @type
|
|
90
|
+
(operator) @operator
|
|
91
|
+
(_) @type
|
|
92
|
+
(#any-of? @operator "<:" ">:"))
|
|
93
|
+
|
|
94
|
+
; Built-in types
|
|
95
|
+
; print.("\"", filter(name -> typeof(Base.eval(Core, name)) in [DataType, UnionAll], names(Core)), "\" ")
|
|
96
|
+
((identifier) @type.builtin
|
|
97
|
+
(#any-of? @type.builtin
|
|
98
|
+
"AbstractArray" "AbstractChar" "AbstractFloat" "AbstractString" "Any" "ArgumentError" "Array"
|
|
99
|
+
"AssertionError" "AtomicMemory" "AtomicMemoryRef" "Bool" "BoundsError" "Char"
|
|
100
|
+
"ConcurrencyViolationError" "Cvoid" "DataType" "DenseArray" "DivideError" "DomainError"
|
|
101
|
+
"ErrorException" "Exception" "Expr" "FieldError" "Float16" "Float32" "Float64" "Function"
|
|
102
|
+
"GenericMemory" "GenericMemoryRef" "GlobalRef" "IO" "InexactError" "InitError" "Int" "Int128"
|
|
103
|
+
"Int16" "Int32" "Int64" "Int8" "Integer" "InterruptException" "LineNumberNode" "LoadError"
|
|
104
|
+
"Memory" "MemoryRef" "Method" "MethodError" "Module" "NTuple" "NamedTuple" "Nothing" "Number"
|
|
105
|
+
"OutOfMemoryError" "OverflowError" "Pair" "Ptr" "QuoteNode" "ReadOnlyMemoryError" "Real" "Ref"
|
|
106
|
+
"SegmentationFault" "Signed" "StackOverflowError" "String" "Symbol" "Task" "Tuple" "Type"
|
|
107
|
+
"TypeError" "TypeVar" "UInt" "UInt128" "UInt16" "UInt32" "UInt64" "UInt8" "UndefInitializer"
|
|
108
|
+
"UndefKeywordError" "UndefRefError" "UndefVarError" "Union" "UnionAll" "Unsigned" "VecElement"
|
|
109
|
+
"WeakRef"))
|
|
110
|
+
|
|
111
|
+
; Keywords
|
|
112
|
+
[
|
|
113
|
+
"global"
|
|
114
|
+
"local"
|
|
115
|
+
] @keyword
|
|
116
|
+
|
|
117
|
+
(compound_statement
|
|
118
|
+
[
|
|
119
|
+
"begin"
|
|
120
|
+
"end"
|
|
121
|
+
] @keyword)
|
|
122
|
+
|
|
123
|
+
(quote_statement
|
|
124
|
+
[
|
|
125
|
+
"quote"
|
|
126
|
+
"end"
|
|
127
|
+
] @keyword)
|
|
128
|
+
|
|
129
|
+
(let_statement
|
|
130
|
+
[
|
|
131
|
+
"let"
|
|
132
|
+
"end"
|
|
133
|
+
] @keyword)
|
|
134
|
+
|
|
135
|
+
(if_statement
|
|
136
|
+
[
|
|
137
|
+
"if"
|
|
138
|
+
"end"
|
|
139
|
+
] @keyword.conditional)
|
|
140
|
+
|
|
141
|
+
(elseif_clause
|
|
142
|
+
"elseif" @keyword.conditional)
|
|
143
|
+
|
|
144
|
+
(else_clause
|
|
145
|
+
"else" @keyword.conditional)
|
|
146
|
+
|
|
147
|
+
(ternary_expression
|
|
148
|
+
[
|
|
149
|
+
"?"
|
|
150
|
+
":"
|
|
151
|
+
] @keyword.conditional.ternary)
|
|
152
|
+
|
|
153
|
+
(try_statement
|
|
154
|
+
[
|
|
155
|
+
"try"
|
|
156
|
+
"end"
|
|
157
|
+
] @keyword.exception)
|
|
158
|
+
|
|
159
|
+
(catch_clause
|
|
160
|
+
"catch" @keyword.exception)
|
|
161
|
+
|
|
162
|
+
(finally_clause
|
|
163
|
+
"finally" @keyword.exception)
|
|
164
|
+
|
|
165
|
+
(for_statement
|
|
166
|
+
[
|
|
167
|
+
"for"
|
|
168
|
+
"end"
|
|
169
|
+
] @keyword.repeat)
|
|
170
|
+
|
|
171
|
+
(for_binding
|
|
172
|
+
"outer" @keyword.repeat)
|
|
173
|
+
|
|
174
|
+
; comprehensions
|
|
175
|
+
(for_clause
|
|
176
|
+
"for" @keyword.repeat)
|
|
177
|
+
|
|
178
|
+
(if_clause
|
|
179
|
+
"if" @keyword.conditional)
|
|
180
|
+
|
|
181
|
+
(while_statement
|
|
182
|
+
[
|
|
183
|
+
"while"
|
|
184
|
+
"end"
|
|
185
|
+
] @keyword.repeat)
|
|
186
|
+
|
|
187
|
+
[
|
|
188
|
+
(break_statement)
|
|
189
|
+
(continue_statement)
|
|
190
|
+
] @keyword.repeat
|
|
191
|
+
|
|
192
|
+
[
|
|
193
|
+
"const"
|
|
194
|
+
"mutable"
|
|
195
|
+
] @keyword.modifier
|
|
196
|
+
|
|
197
|
+
(function_definition
|
|
198
|
+
[
|
|
199
|
+
"function"
|
|
200
|
+
"end"
|
|
201
|
+
] @keyword.function)
|
|
202
|
+
|
|
203
|
+
(do_clause
|
|
204
|
+
[
|
|
205
|
+
"do"
|
|
206
|
+
"end"
|
|
207
|
+
] @keyword.function)
|
|
208
|
+
|
|
209
|
+
(macro_definition
|
|
210
|
+
[
|
|
211
|
+
"macro"
|
|
212
|
+
"end"
|
|
213
|
+
] @keyword)
|
|
214
|
+
|
|
215
|
+
(return_statement
|
|
216
|
+
"return" @keyword.return)
|
|
217
|
+
|
|
218
|
+
(module_definition
|
|
219
|
+
[
|
|
220
|
+
"module"
|
|
221
|
+
"baremodule"
|
|
222
|
+
"end"
|
|
223
|
+
] @keyword.import)
|
|
224
|
+
|
|
225
|
+
(export_statement
|
|
226
|
+
"export" @keyword.import)
|
|
227
|
+
|
|
228
|
+
(public_statement
|
|
229
|
+
"public" @keyword.import)
|
|
230
|
+
|
|
231
|
+
(import_statement
|
|
232
|
+
"import" @keyword.import)
|
|
233
|
+
|
|
234
|
+
(using_statement
|
|
235
|
+
"using" @keyword.import)
|
|
236
|
+
|
|
237
|
+
(import_alias
|
|
238
|
+
"as" @keyword.import)
|
|
239
|
+
|
|
240
|
+
(selected_import
|
|
241
|
+
":" @punctuation.delimiter)
|
|
242
|
+
|
|
243
|
+
(struct_definition
|
|
244
|
+
[
|
|
245
|
+
"mutable"
|
|
246
|
+
"struct"
|
|
247
|
+
"end"
|
|
248
|
+
] @keyword.type)
|
|
249
|
+
|
|
250
|
+
(abstract_definition
|
|
251
|
+
[
|
|
252
|
+
"abstract"
|
|
253
|
+
"type"
|
|
254
|
+
"end"
|
|
255
|
+
] @keyword.type)
|
|
256
|
+
|
|
257
|
+
(primitive_definition
|
|
258
|
+
[
|
|
259
|
+
"primitive"
|
|
260
|
+
"type"
|
|
261
|
+
"end"
|
|
262
|
+
] @keyword.type)
|
|
263
|
+
|
|
264
|
+
; Operators & Punctuation
|
|
265
|
+
(operator) @operator
|
|
266
|
+
|
|
267
|
+
(adjoint_expression
|
|
268
|
+
"'" @operator)
|
|
269
|
+
|
|
270
|
+
(range_expression
|
|
271
|
+
":" @operator)
|
|
272
|
+
|
|
273
|
+
(arrow_function_expression
|
|
274
|
+
"->" @operator)
|
|
275
|
+
|
|
276
|
+
[
|
|
277
|
+
"."
|
|
278
|
+
"..."
|
|
279
|
+
] @punctuation.special
|
|
280
|
+
|
|
281
|
+
[
|
|
282
|
+
","
|
|
283
|
+
";"
|
|
284
|
+
"::"
|
|
285
|
+
] @punctuation.delimiter
|
|
286
|
+
|
|
287
|
+
; Treat `::` as operator in type contexts, see
|
|
288
|
+
; https://github.com/nvim-treesitter/nvim-treesitter/pull/7392
|
|
289
|
+
(typed_expression
|
|
290
|
+
"::" @operator)
|
|
291
|
+
|
|
292
|
+
(unary_typed_expression
|
|
293
|
+
"::" @operator)
|
|
294
|
+
|
|
295
|
+
[
|
|
296
|
+
"("
|
|
297
|
+
")"
|
|
298
|
+
"["
|
|
299
|
+
"]"
|
|
300
|
+
"{"
|
|
301
|
+
"}"
|
|
302
|
+
] @punctuation.bracket
|
|
303
|
+
|
|
304
|
+
; Interpolation
|
|
305
|
+
(string_interpolation
|
|
306
|
+
.
|
|
307
|
+
"$" @punctuation.special)
|
|
308
|
+
|
|
309
|
+
(interpolation_expression
|
|
310
|
+
.
|
|
311
|
+
"$" @punctuation.special)
|
|
312
|
+
|
|
313
|
+
; Keyword operators
|
|
314
|
+
((operator) @keyword.operator
|
|
315
|
+
(#any-of? @keyword.operator "in" "isa"))
|
|
316
|
+
|
|
317
|
+
(where_expression
|
|
318
|
+
"where" @keyword.operator)
|
|
319
|
+
|
|
320
|
+
; Built-in constants
|
|
321
|
+
((identifier) @constant.builtin
|
|
322
|
+
(#any-of? @constant.builtin "nothing" "missing"))
|
|
323
|
+
|
|
324
|
+
((identifier) @variable.builtin
|
|
325
|
+
(#any-of? @variable.builtin "begin" "end")
|
|
326
|
+
(#has-ancestor? @variable.builtin index_expression))
|
|
327
|
+
|
|
328
|
+
; Literals
|
|
329
|
+
(boolean_literal) @boolean
|
|
330
|
+
|
|
331
|
+
(integer_literal) @number
|
|
332
|
+
|
|
333
|
+
(float_literal) @number.float
|
|
334
|
+
|
|
335
|
+
((identifier) @number.float
|
|
336
|
+
(#any-of? @number.float "NaN" "NaN16" "NaN32" "Inf" "Inf16" "Inf32"))
|
|
337
|
+
|
|
338
|
+
(character_literal) @character
|
|
339
|
+
|
|
340
|
+
(escape_sequence) @string.escape
|
|
341
|
+
|
|
342
|
+
(string_literal) @string
|
|
343
|
+
|
|
344
|
+
(prefixed_string_literal
|
|
345
|
+
prefix: (identifier) @function.macro) @string
|
|
346
|
+
|
|
347
|
+
(command_literal) @string.special
|
|
348
|
+
|
|
349
|
+
(prefixed_command_literal
|
|
350
|
+
prefix: (identifier) @function.macro) @string.special
|
|
351
|
+
|
|
352
|
+
((string_literal) @string.documentation
|
|
353
|
+
.
|
|
354
|
+
[
|
|
355
|
+
(abstract_definition)
|
|
356
|
+
(assignment)
|
|
357
|
+
(const_statement)
|
|
358
|
+
(function_definition)
|
|
359
|
+
(macro_definition)
|
|
360
|
+
(module_definition)
|
|
361
|
+
(struct_definition)
|
|
362
|
+
])
|
|
363
|
+
|
|
364
|
+
(source_file
|
|
365
|
+
(string_literal) @string.documentation
|
|
366
|
+
.
|
|
367
|
+
[
|
|
368
|
+
(identifier)
|
|
369
|
+
(call_expression)
|
|
370
|
+
])
|
|
371
|
+
|
|
372
|
+
[
|
|
373
|
+
(line_comment)
|
|
374
|
+
(block_comment)
|
|
375
|
+
] @comment
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
; Inject markdown in docstrings
|
|
2
|
+
((string_literal
|
|
3
|
+
(content) @injection.content)
|
|
4
|
+
.
|
|
5
|
+
[
|
|
6
|
+
(module_definition)
|
|
7
|
+
(abstract_definition)
|
|
8
|
+
(struct_definition)
|
|
9
|
+
(function_definition)
|
|
10
|
+
(macro_definition)
|
|
11
|
+
(assignment)
|
|
12
|
+
(const_statement)
|
|
13
|
+
(call_expression)
|
|
14
|
+
(identifier)
|
|
15
|
+
]
|
|
16
|
+
(#set! injection.language "markdown"))
|
|
17
|
+
|
|
18
|
+
; Inject comments
|
|
19
|
+
([
|
|
20
|
+
(line_comment)
|
|
21
|
+
(block_comment)
|
|
22
|
+
] @injection.content
|
|
23
|
+
(#set! injection.language "comment"))
|
|
24
|
+
|
|
25
|
+
; Inject regex in r"..." and r"""...""" (e.g. r"hello\bworld")
|
|
26
|
+
(prefixed_string_literal
|
|
27
|
+
prefix: (identifier) @_prefix
|
|
28
|
+
(content) @injection.content
|
|
29
|
+
(#eq? @_prefix "r")
|
|
30
|
+
(#set! injection.language "regex"))
|
|
31
|
+
|
|
32
|
+
; Inject markdown in md"..." and md"""...""" (e.g. md"**Bold** and _Italics_")
|
|
33
|
+
(prefixed_string_literal
|
|
34
|
+
prefix: (identifier) @_prefix
|
|
35
|
+
(content) @injection.content
|
|
36
|
+
(#eq? @_prefix "md")
|
|
37
|
+
(#set! injection.language "markdown"))
|
|
38
|
+
|
|
39
|
+
; Inject bash in `...` and ```...``` (e.g. `git add --help`)
|
|
40
|
+
(command_literal
|
|
41
|
+
(content) @injection.content
|
|
42
|
+
(#set! injection.language "bash"))
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
; References
|
|
2
|
+
(identifier) @local.reference
|
|
3
|
+
|
|
4
|
+
; Definitions
|
|
5
|
+
(assignment
|
|
6
|
+
.
|
|
7
|
+
(identifier) @local.definition)
|
|
8
|
+
|
|
9
|
+
(assignment
|
|
10
|
+
.
|
|
11
|
+
(tuple_expression
|
|
12
|
+
(identifier) @local.definition))
|
|
13
|
+
|
|
14
|
+
(assignment
|
|
15
|
+
.
|
|
16
|
+
(open_tuple
|
|
17
|
+
(identifier) @local.definition))
|
|
18
|
+
|
|
19
|
+
(for_binding
|
|
20
|
+
.
|
|
21
|
+
(identifier) @local.definition)
|
|
22
|
+
|
|
23
|
+
(for_binding
|
|
24
|
+
.
|
|
25
|
+
(tuple_expression
|
|
26
|
+
(identifier) @local.definition))
|
|
27
|
+
|
|
28
|
+
(import_statement
|
|
29
|
+
(identifier) @local.definition)
|
|
30
|
+
|
|
31
|
+
(using_statement
|
|
32
|
+
(identifier) @local.definition)
|
|
33
|
+
|
|
34
|
+
(selected_import
|
|
35
|
+
(identifier) @local.definition)
|
|
36
|
+
|
|
37
|
+
(module_definition
|
|
38
|
+
.
|
|
39
|
+
(identifier) @local.definition)
|
|
40
|
+
|
|
41
|
+
(type_head
|
|
42
|
+
(identifier) @local.definition)
|
|
43
|
+
|
|
44
|
+
(type_head
|
|
45
|
+
(binary_expression
|
|
46
|
+
.
|
|
47
|
+
(identifier) @local.definition))
|
|
48
|
+
|
|
49
|
+
(function_definition
|
|
50
|
+
(signature
|
|
51
|
+
(call_expression
|
|
52
|
+
.
|
|
53
|
+
(identifier) @local.definition.function))) @local.scope
|
|
54
|
+
|
|
55
|
+
(macro_definition
|
|
56
|
+
(signature
|
|
57
|
+
(call_expression
|
|
58
|
+
.
|
|
59
|
+
(identifier) @local.definition.function))) @local.scope
|
|
60
|
+
|
|
61
|
+
; Scopes
|
|
62
|
+
[
|
|
63
|
+
(quote_statement)
|
|
64
|
+
(let_statement)
|
|
65
|
+
(for_statement)
|
|
66
|
+
(while_statement)
|
|
67
|
+
(try_statement)
|
|
68
|
+
(catch_clause)
|
|
69
|
+
(finally_clause)
|
|
70
|
+
(do_clause)
|
|
71
|
+
] @local.scope
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
; Keywords
|
|
2
|
+
"return" @keyword.return
|
|
3
|
+
|
|
4
|
+
[
|
|
5
|
+
"goto"
|
|
6
|
+
"in"
|
|
7
|
+
"local"
|
|
8
|
+
] @keyword
|
|
9
|
+
|
|
10
|
+
(label_statement) @label
|
|
11
|
+
|
|
12
|
+
(break_statement) @keyword
|
|
13
|
+
|
|
14
|
+
(do_statement
|
|
15
|
+
[
|
|
16
|
+
"do"
|
|
17
|
+
"end"
|
|
18
|
+
] @keyword)
|
|
19
|
+
|
|
20
|
+
(while_statement
|
|
21
|
+
[
|
|
22
|
+
"while"
|
|
23
|
+
"do"
|
|
24
|
+
"end"
|
|
25
|
+
] @repeat)
|
|
26
|
+
|
|
27
|
+
(repeat_statement
|
|
28
|
+
[
|
|
29
|
+
"repeat"
|
|
30
|
+
"until"
|
|
31
|
+
] @repeat)
|
|
32
|
+
|
|
33
|
+
(if_statement
|
|
34
|
+
[
|
|
35
|
+
"if"
|
|
36
|
+
"elseif"
|
|
37
|
+
"else"
|
|
38
|
+
"then"
|
|
39
|
+
"end"
|
|
40
|
+
] @conditional)
|
|
41
|
+
|
|
42
|
+
(elseif_statement
|
|
43
|
+
[
|
|
44
|
+
"elseif"
|
|
45
|
+
"then"
|
|
46
|
+
"end"
|
|
47
|
+
] @conditional)
|
|
48
|
+
|
|
49
|
+
(else_statement
|
|
50
|
+
[
|
|
51
|
+
"else"
|
|
52
|
+
"end"
|
|
53
|
+
] @conditional)
|
|
54
|
+
|
|
55
|
+
(for_statement
|
|
56
|
+
[
|
|
57
|
+
"for"
|
|
58
|
+
"do"
|
|
59
|
+
"end"
|
|
60
|
+
] @repeat)
|
|
61
|
+
|
|
62
|
+
(function_declaration
|
|
63
|
+
[
|
|
64
|
+
"function"
|
|
65
|
+
"end"
|
|
66
|
+
] @keyword.function)
|
|
67
|
+
|
|
68
|
+
(function_definition
|
|
69
|
+
[
|
|
70
|
+
"function"
|
|
71
|
+
"end"
|
|
72
|
+
] @keyword.function)
|
|
73
|
+
|
|
74
|
+
; Operators
|
|
75
|
+
(binary_expression
|
|
76
|
+
operator: _ @operator)
|
|
77
|
+
|
|
78
|
+
(unary_expression
|
|
79
|
+
operator: _ @operator)
|
|
80
|
+
|
|
81
|
+
[
|
|
82
|
+
"and"
|
|
83
|
+
"not"
|
|
84
|
+
"or"
|
|
85
|
+
] @keyword.operator
|
|
86
|
+
|
|
87
|
+
; Punctuations
|
|
88
|
+
[
|
|
89
|
+
";"
|
|
90
|
+
":"
|
|
91
|
+
","
|
|
92
|
+
"."
|
|
93
|
+
] @punctuation.delimiter
|
|
94
|
+
|
|
95
|
+
; Brackets
|
|
96
|
+
[
|
|
97
|
+
"("
|
|
98
|
+
")"
|
|
99
|
+
"["
|
|
100
|
+
"]"
|
|
101
|
+
"{"
|
|
102
|
+
"}"
|
|
103
|
+
] @punctuation.bracket
|
|
104
|
+
|
|
105
|
+
; Variables
|
|
106
|
+
(identifier) @variable
|
|
107
|
+
|
|
108
|
+
((identifier) @variable.builtin
|
|
109
|
+
(#eq? @variable.builtin "self"))
|
|
110
|
+
|
|
111
|
+
(variable_list
|
|
112
|
+
(attribute
|
|
113
|
+
"<" @punctuation.bracket
|
|
114
|
+
(identifier) @attribute
|
|
115
|
+
">" @punctuation.bracket))
|
|
116
|
+
|
|
117
|
+
; Constants
|
|
118
|
+
((identifier) @constant
|
|
119
|
+
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
|
120
|
+
|
|
121
|
+
(vararg_expression) @constant
|
|
122
|
+
|
|
123
|
+
(nil) @constant.builtin
|
|
124
|
+
|
|
125
|
+
[
|
|
126
|
+
(false)
|
|
127
|
+
(true)
|
|
128
|
+
] @boolean
|
|
129
|
+
|
|
130
|
+
; Tables
|
|
131
|
+
(field
|
|
132
|
+
name: (identifier) @field)
|
|
133
|
+
|
|
134
|
+
(dot_index_expression
|
|
135
|
+
field: (identifier) @field)
|
|
136
|
+
|
|
137
|
+
(table_constructor
|
|
138
|
+
[
|
|
139
|
+
"{"
|
|
140
|
+
"}"
|
|
141
|
+
] @constructor)
|
|
142
|
+
|
|
143
|
+
; Functions
|
|
144
|
+
(parameters
|
|
145
|
+
(identifier) @parameter)
|
|
146
|
+
|
|
147
|
+
(function_declaration
|
|
148
|
+
name: [
|
|
149
|
+
(identifier) @function
|
|
150
|
+
(dot_index_expression
|
|
151
|
+
field: (identifier) @function)
|
|
152
|
+
])
|
|
153
|
+
|
|
154
|
+
(function_declaration
|
|
155
|
+
name: (method_index_expression
|
|
156
|
+
method: (identifier) @method))
|
|
157
|
+
|
|
158
|
+
(assignment_statement
|
|
159
|
+
(variable_list
|
|
160
|
+
.
|
|
161
|
+
name: [
|
|
162
|
+
(identifier) @function
|
|
163
|
+
(dot_index_expression
|
|
164
|
+
field: (identifier) @function)
|
|
165
|
+
])
|
|
166
|
+
(expression_list
|
|
167
|
+
.
|
|
168
|
+
value: (function_definition)))
|
|
169
|
+
|
|
170
|
+
(table_constructor
|
|
171
|
+
(field
|
|
172
|
+
name: (identifier) @function
|
|
173
|
+
value: (function_definition)))
|
|
174
|
+
|
|
175
|
+
(function_call
|
|
176
|
+
name: [
|
|
177
|
+
(identifier) @function.call
|
|
178
|
+
(dot_index_expression
|
|
179
|
+
field: (identifier) @function.call)
|
|
180
|
+
(method_index_expression
|
|
181
|
+
method: (identifier) @method.call)
|
|
182
|
+
])
|
|
183
|
+
|
|
184
|
+
(function_call
|
|
185
|
+
(identifier) @function.builtin
|
|
186
|
+
(#any-of? @function.builtin
|
|
187
|
+
; built-in functions in Lua 5.1
|
|
188
|
+
"assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable" "ipairs" "load" "loadfile"
|
|
189
|
+
"loadstring" "module" "next" "pairs" "pcall" "print" "rawequal" "rawget" "rawset" "require"
|
|
190
|
+
"select" "setfenv" "setmetatable" "tonumber" "tostring" "type" "unpack" "xpcall"))
|
|
191
|
+
|
|
192
|
+
; Others
|
|
193
|
+
(comment) @comment
|
|
194
|
+
|
|
195
|
+
(hash_bang_line) @preproc
|
|
196
|
+
|
|
197
|
+
(number) @number
|
|
198
|
+
|
|
199
|
+
(string) @string
|
|
200
|
+
|
|
201
|
+
(escape_sequence) @string.escape
|