tree-sitter-wasm 1.0.2 → 1.0.3

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/index.d.ts CHANGED
@@ -57,6 +57,7 @@ export type QueryMap = {
57
57
  "just": "folds" | "highlights" | "indents" | "injections" | "locals";
58
58
  "kdl": "folds" | "highlights" | "indents" | "injections" | "locals";
59
59
  "kotlin": "folds" | "highlights" | "injections" | "locals";
60
+ "latex": "folds" | "highlights" | "injections";
60
61
  "liquid": "highlights" | "injections";
61
62
  "lua": "folds" | "highlights" | "indents" | "injections" | "locals" | "tags";
62
63
  "make": "folds" | "highlights" | "injections";
package/manifest.json CHANGED
@@ -366,6 +366,11 @@
366
366
  "injections",
367
367
  "locals"
368
368
  ],
369
+ "latex": [
370
+ "folds",
371
+ "highlights",
372
+ "injections"
373
+ ],
369
374
  "liquid": [
370
375
  "highlights",
371
376
  "injections"
@@ -0,0 +1,14 @@
1
+ [
2
+ (chapter)
3
+ (part)
4
+ (section)
5
+ (subsection)
6
+ (subsubsection)
7
+ (paragraph)
8
+ (subparagraph)
9
+ (generic_environment)
10
+ (math_environment)
11
+ (comment_environment)
12
+ (block_comment)
13
+ (displayed_equation)
14
+ ] @fold
@@ -0,0 +1,401 @@
1
+ ; General syntax
2
+ (command_name) @function @nospell
3
+
4
+ (caption
5
+ command: _ @function)
6
+
7
+ ; Turn spelling on for text
8
+ (text) @spell
9
+
10
+ ; \text, \intertext, \shortintertext, ...
11
+ (text_mode
12
+ command: _ @function @nospell
13
+ content: (curly_group
14
+ (_) @none @spell))
15
+
16
+ ; Variables, parameters
17
+ (placeholder) @variable
18
+
19
+ (key_value_pair
20
+ key: (_) @variable.parameter @nospell
21
+ value: (_))
22
+
23
+ (curly_group_spec
24
+ (text) @variable.parameter)
25
+
26
+ (curly_group_value
27
+ (value_literal) @constant)
28
+
29
+ (brack_group_argc) @variable.parameter
30
+
31
+ [
32
+ (operator)
33
+ "="
34
+ "_"
35
+ "^"
36
+ ] @operator
37
+
38
+ "\\item" @punctuation.special
39
+
40
+ (delimiter) @punctuation.delimiter
41
+
42
+ (math_delimiter
43
+ left_command: _ @punctuation.delimiter
44
+ left_delimiter: _ @punctuation.delimiter
45
+ right_command: _ @punctuation.delimiter
46
+ right_delimiter: _ @punctuation.delimiter)
47
+
48
+ [
49
+ "["
50
+ "]"
51
+ "{"
52
+ "}"
53
+ ] @punctuation.bracket ; "(" ")" has no syntactical meaning in LaTeX
54
+
55
+ ; General environments
56
+ (begin
57
+ command: _ @module
58
+ name: (curly_group_text
59
+ (text) @label @nospell))
60
+
61
+ (end
62
+ command: _ @module
63
+ name: (curly_group_text
64
+ (text) @label @nospell))
65
+
66
+ ; Definitions and references
67
+ (new_command_definition
68
+ command: _ @function.macro @nospell)
69
+
70
+ (old_command_definition
71
+ command: _ @function.macro @nospell)
72
+
73
+ (let_command_definition
74
+ command: _ @function.macro @nospell)
75
+
76
+ (environment_definition
77
+ command: _ @function.macro @nospell
78
+ name: (curly_group_text
79
+ (_) @label @nospell))
80
+
81
+ (theorem_definition
82
+ command: _ @function.macro @nospell
83
+ name: (curly_group_text_list
84
+ (_) @label @nospell))
85
+
86
+ (paired_delimiter_definition
87
+ command: _ @function.macro @nospell
88
+ declaration: (curly_group_command_name
89
+ (_) @function))
90
+
91
+ (counter_declaration
92
+ command: _ @function.macro @nospell
93
+ counter: (curly_group_word
94
+ (word) @variable)
95
+ supercounter: (brack_group_word
96
+ (word) @variable)?)
97
+
98
+ (counter_within_declaration
99
+ command: _ @function.macro @nospell
100
+ counter: (curly_group_word
101
+ (word) @variable)
102
+ supercounter: (curly_group_word
103
+ (word) @variable))
104
+
105
+ (counter_without_declaration
106
+ command: _ @function.macro @nospell
107
+ counter: (curly_group_word
108
+ (word) @variable)
109
+ supercounter: (curly_group_word
110
+ (word) @variable))
111
+
112
+ (counter_value
113
+ command: _ @function.macro @nospell
114
+ counter: (curly_group_word
115
+ (word) @variable))
116
+
117
+ ; The 'value' fields for the two following highlights
118
+ ; are handled by counter_value and curly_group_value.
119
+ (counter_definition
120
+ command: _ @function.macro @nospell
121
+ counter: (curly_group_word
122
+ (word) @variable))
123
+
124
+ (counter_addition
125
+ command: _ @function.macro @nospell
126
+ counter: (curly_group_word
127
+ (word) @variable))
128
+
129
+ (counter_increment
130
+ command: _ @function.macro @nospell
131
+ counter: (curly_group_word
132
+ (word) @variable))
133
+
134
+ (counter_typesetting
135
+ command: _ @function.macro @nospell
136
+ counter: (curly_group_word
137
+ (word) @variable))
138
+
139
+ (label_definition
140
+ command: _ @function.macro
141
+ name: (curly_group_label
142
+ (_) @markup.link @nospell))
143
+
144
+ (label_reference_range
145
+ command: _ @function.macro
146
+ from: (curly_group_label
147
+ (_) @markup.link)
148
+ to: (curly_group_label
149
+ (_) @markup.link))
150
+
151
+ (label_reference
152
+ command: _ @function.macro
153
+ names: (curly_group_label_list
154
+ (_) @markup.link))
155
+
156
+ (label_number
157
+ command: _ @function.macro
158
+ name: (curly_group_label
159
+ (_) @markup.link)
160
+ number: (_) @markup.link)
161
+
162
+ (citation
163
+ command: _ @function.macro @nospell
164
+ keys: (curly_group_text_list) @markup.link @nospell)
165
+
166
+ ((hyperlink
167
+ command: _ @function @nospell
168
+ uri: (curly_group_uri
169
+ (_) @markup.link.url @nospell)) @_hyperlink
170
+ (#set! @_hyperlink url @markup.link.url))
171
+
172
+ (glossary_entry_definition
173
+ command: _ @function.macro @nospell
174
+ name: (curly_group_text
175
+ (_) @markup.link @nospell))
176
+
177
+ (glossary_entry_reference
178
+ command: _ @function.macro
179
+ name: (curly_group_text
180
+ (_) @markup.link))
181
+
182
+ (acronym_definition
183
+ command: _ @function.macro @nospell
184
+ name: (curly_group_text
185
+ (_) @markup.link @nospell))
186
+
187
+ (acronym_reference
188
+ command: _ @function.macro
189
+ name: (curly_group_text
190
+ (_) @markup.link))
191
+
192
+ (color_definition
193
+ command: _ @function.macro
194
+ name: (curly_group_text
195
+ (_) @markup.link))
196
+
197
+ (color_reference
198
+ command: _ @function.macro
199
+ name: (curly_group_text
200
+ (_) @markup.link)?)
201
+
202
+ ; Sectioning
203
+ (title_declaration
204
+ command: _ @module
205
+ options: (brack_group
206
+ (_) @markup.heading.1)?
207
+ text: (curly_group
208
+ (_) @markup.heading.1))
209
+
210
+ (author_declaration
211
+ command: _ @module
212
+ authors: (curly_group_author_list
213
+ (author)+ @markup.heading.1))
214
+
215
+ (chapter
216
+ command: _ @module
217
+ toc: (brack_group
218
+ (_) @markup.heading.2)?
219
+ text: (curly_group
220
+ (_) @markup.heading.2))
221
+
222
+ (part
223
+ command: _ @module
224
+ toc: (brack_group
225
+ (_) @markup.heading.2)?
226
+ text: (curly_group
227
+ (_) @markup.heading.2))
228
+
229
+ (section
230
+ command: _ @module
231
+ toc: (brack_group
232
+ (_) @markup.heading.3)?
233
+ text: (curly_group
234
+ (_) @markup.heading.3))
235
+
236
+ (subsection
237
+ command: _ @module
238
+ toc: (brack_group
239
+ (_) @markup.heading.4)?
240
+ text: (curly_group
241
+ (_) @markup.heading.4))
242
+
243
+ (subsubsection
244
+ command: _ @module
245
+ toc: (brack_group
246
+ (_) @markup.heading.5)?
247
+ text: (curly_group
248
+ (_) @markup.heading.5))
249
+
250
+ (paragraph
251
+ command: _ @module
252
+ toc: (brack_group
253
+ (_) @markup.heading.6)?
254
+ text: (curly_group
255
+ (_) @markup.heading.6))
256
+
257
+ (subparagraph
258
+ command: _ @module
259
+ toc: (brack_group
260
+ (_) @markup.heading.6)?
261
+ text: (curly_group
262
+ (_) @markup.heading.6))
263
+
264
+ ; Beamer frames
265
+ (generic_environment
266
+ (begin
267
+ name: (curly_group_text
268
+ (text) @label)
269
+ (#eq? @label "frame"))
270
+ .
271
+ (curly_group
272
+ (_) @markup.heading))
273
+
274
+ ((generic_command
275
+ command: (command_name) @_name
276
+ arg: (curly_group
277
+ (_) @markup.heading))
278
+ (#eq? @_name "\\frametitle"))
279
+
280
+ ((generic_command
281
+ command: (command_name) @_name
282
+ arg: (curly_group
283
+ (_) @markup.italic))
284
+ (#any-of? @_name "\\emph" "\\textit" "\\mathit"))
285
+
286
+ ((generic_command
287
+ command: (command_name) @_name
288
+ arg: (curly_group
289
+ (_) @markup.strong))
290
+ (#any-of? @_name "\\textbf" "\\mathbf"))
291
+
292
+ (generic_command
293
+ (command_name) @keyword.conditional
294
+ (#lua-match? @keyword.conditional "^\\if[a-zA-Z@]+$"))
295
+
296
+ (generic_command
297
+ (command_name) @keyword.conditional
298
+ (#any-of? @keyword.conditional "\\fi" "\\else"))
299
+
300
+ ; File inclusion commands
301
+ (class_include
302
+ command: _ @keyword.import
303
+ path: (curly_group_path) @string)
304
+
305
+ (package_include
306
+ command: _ @keyword.import
307
+ paths: (curly_group_path_list) @string)
308
+
309
+ (latex_include
310
+ command: _ @keyword.import
311
+ path: (curly_group_path) @string.special.path)
312
+
313
+ (verbatim_include
314
+ command: _ @keyword.import
315
+ path: (curly_group_path) @string.special.path)
316
+
317
+ (import_include
318
+ command: _ @keyword.import
319
+ directory: (curly_group_path) @string.special.path
320
+ file: (curly_group_path) @string.special.path)
321
+
322
+ (bibstyle_include
323
+ command: _ @keyword.import
324
+ path: (curly_group_path) @string)
325
+
326
+ (bibtex_include
327
+ command: _ @keyword.import
328
+ paths: (curly_group_path_list) @string.special.path)
329
+
330
+ (biblatex_include
331
+ "\\addbibresource" @keyword.import
332
+ glob: (curly_group_glob_pattern) @string.regexp)
333
+
334
+ (graphics_include
335
+ command: _ @keyword.import
336
+ path: (curly_group_path) @string.special.path)
337
+
338
+ (svg_include
339
+ command: _ @keyword.import
340
+ path: (curly_group_path) @string.special.path)
341
+
342
+ (inkscape_include
343
+ command: _ @keyword.import
344
+ path: (curly_group_path) @string.special.path)
345
+
346
+ (tikz_library_import
347
+ command: _ @keyword.import
348
+ paths: (curly_group_path_list) @string)
349
+
350
+ ; Turn spelling off for whole nodes
351
+ [
352
+ (counter_declaration)
353
+ (counter_within_declaration)
354
+ (counter_without_declaration)
355
+ (counter_value)
356
+ (counter_definition)
357
+ (counter_addition)
358
+ (counter_increment)
359
+ (counter_typesetting)
360
+ (label_reference)
361
+ (label_reference_range)
362
+ (label_number)
363
+ (glossary_entry_reference)
364
+ (acronym_reference)
365
+ (color_definition)
366
+ (color_reference)
367
+ (class_include)
368
+ (package_include)
369
+ (latex_include)
370
+ (verbatim_include)
371
+ (import_include)
372
+ (bibstyle_include)
373
+ (bibtex_include)
374
+ (biblatex_include)
375
+ (graphics_include)
376
+ (svg_include)
377
+ (inkscape_include)
378
+ (tikz_library_import)
379
+ ] @nospell
380
+
381
+ ; Math
382
+ [
383
+ (displayed_equation)
384
+ (inline_formula)
385
+ ] @markup.math @nospell
386
+
387
+ (math_environment
388
+ (_) @markup.math)
389
+
390
+ ; Comments
391
+ [
392
+ (line_comment)
393
+ (block_comment)
394
+ (comment_environment)
395
+ ] @comment @spell
396
+
397
+ ((line_comment) @keyword.directive @nospell
398
+ (#lua-match? @keyword.directive "^%% !TeX"))
399
+
400
+ ((line_comment) @keyword.directive @nospell
401
+ (#lua-match? @keyword.directive "^%%&"))
@@ -0,0 +1,36 @@
1
+ ([
2
+ (line_comment)
3
+ (block_comment)
4
+ (comment_environment)
5
+ ] @injection.content
6
+ (#set! injection.language "comment"))
7
+
8
+ (pycode_environment
9
+ code: (source_code) @injection.content
10
+ (#set! injection.language "python"))
11
+
12
+ (sagesilent_environment
13
+ code: (source_code) @injection.content
14
+ (#set! injection.language "python"))
15
+
16
+ (sageblock_environment
17
+ code: (source_code) @injection.content
18
+ (#set! injection.language "python"))
19
+
20
+ (luacode_environment
21
+ code: (source_code) @injection.content
22
+ (#set! injection.language "lua"))
23
+
24
+ (asy_environment
25
+ code: (source_code) @injection.content
26
+ (#set! injection.language "c"))
27
+
28
+ (asydef_environment
29
+ code: (source_code) @injection.content
30
+ (#set! injection.language "c"))
31
+
32
+ (minted_environment
33
+ (begin
34
+ language: (curly_group_text
35
+ (text) @injection.language))
36
+ (source_code) @injection.content)
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-wasm",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Pre-built WebAssembly binaries and queries for tree-sitter grammars.",
5
5
  "keywords": [
6
6
  "incremental",