@nvl/tree-sitter-sveltex 0.2.0

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.
@@ -0,0 +1,742 @@
1
+ {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
3
+ "name": "sveltex",
4
+ "word": "_word",
5
+ "rules": {
6
+ "document": {
7
+ "type": "SEQ",
8
+ "members": [
9
+ {
10
+ "type": "CHOICE",
11
+ "members": [
12
+ {
13
+ "type": "SYMBOL",
14
+ "name": "frontmatter"
15
+ },
16
+ {
17
+ "type": "BLANK"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "type": "REPEAT",
23
+ "content": {
24
+ "type": "SYMBOL",
25
+ "name": "_block"
26
+ }
27
+ }
28
+ ]
29
+ },
30
+ "frontmatter": {
31
+ "type": "SEQ",
32
+ "members": [
33
+ {
34
+ "type": "FIELD",
35
+ "name": "open",
36
+ "content": {
37
+ "type": "ALIAS",
38
+ "content": {
39
+ "type": "SYMBOL",
40
+ "name": "_frontmatter_start"
41
+ },
42
+ "named": true,
43
+ "value": "frontmatter_fence"
44
+ }
45
+ },
46
+ {
47
+ "type": "CHOICE",
48
+ "members": [
49
+ {
50
+ "type": "FIELD",
51
+ "name": "language",
52
+ "content": {
53
+ "type": "SYMBOL",
54
+ "name": "frontmatter_language"
55
+ }
56
+ },
57
+ {
58
+ "type": "BLANK"
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "type": "CHOICE",
64
+ "members": [
65
+ {
66
+ "type": "FIELD",
67
+ "name": "content",
68
+ "content": {
69
+ "type": "SYMBOL",
70
+ "name": "frontmatter_content"
71
+ }
72
+ },
73
+ {
74
+ "type": "BLANK"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "type": "FIELD",
80
+ "name": "close",
81
+ "content": {
82
+ "type": "ALIAS",
83
+ "content": {
84
+ "type": "SYMBOL",
85
+ "name": "_frontmatter_end"
86
+ },
87
+ "named": true,
88
+ "value": "frontmatter_fence"
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ "frontmatter_language": {
94
+ "type": "IMMEDIATE_TOKEN",
95
+ "content": {
96
+ "type": "CHOICE",
97
+ "members": [
98
+ {
99
+ "type": "STRING",
100
+ "value": "yaml"
101
+ },
102
+ {
103
+ "type": "STRING",
104
+ "value": "toml"
105
+ },
106
+ {
107
+ "type": "STRING",
108
+ "value": "json"
109
+ }
110
+ ]
111
+ }
112
+ },
113
+ "frontmatter_content": {
114
+ "type": "SYMBOL",
115
+ "name": "_frontmatter_body"
116
+ },
117
+ "_block": {
118
+ "type": "CHOICE",
119
+ "members": [
120
+ {
121
+ "type": "SYMBOL",
122
+ "name": "verbatim_environment"
123
+ },
124
+ {
125
+ "type": "SYMBOL",
126
+ "name": "display_math"
127
+ },
128
+ {
129
+ "type": "SYMBOL",
130
+ "name": "inline_math"
131
+ },
132
+ {
133
+ "type": "SYMBOL",
134
+ "name": "markdown_chunk"
135
+ }
136
+ ]
137
+ },
138
+ "verbatim_environment": {
139
+ "type": "CHOICE",
140
+ "members": [
141
+ {
142
+ "type": "SYMBOL",
143
+ "name": "_verbatim_tex"
144
+ },
145
+ {
146
+ "type": "SYMBOL",
147
+ "name": "_verbatim_plain"
148
+ }
149
+ ]
150
+ },
151
+ "_verbatim_tex": {
152
+ "type": "SEQ",
153
+ "members": [
154
+ {
155
+ "type": "FIELD",
156
+ "name": "open",
157
+ "content": {
158
+ "type": "SYMBOL",
159
+ "name": "verbatim_tex_open_tag"
160
+ }
161
+ },
162
+ {
163
+ "type": "CHOICE",
164
+ "members": [
165
+ {
166
+ "type": "FIELD",
167
+ "name": "body",
168
+ "content": {
169
+ "type": "SYMBOL",
170
+ "name": "tex_verbatim_body"
171
+ }
172
+ },
173
+ {
174
+ "type": "BLANK"
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "type": "FIELD",
180
+ "name": "close",
181
+ "content": {
182
+ "type": "SYMBOL",
183
+ "name": "verbatim_close_tag"
184
+ }
185
+ }
186
+ ]
187
+ },
188
+ "_verbatim_plain": {
189
+ "type": "SEQ",
190
+ "members": [
191
+ {
192
+ "type": "FIELD",
193
+ "name": "open",
194
+ "content": {
195
+ "type": "SYMBOL",
196
+ "name": "verbatim_plain_open_tag"
197
+ }
198
+ },
199
+ {
200
+ "type": "CHOICE",
201
+ "members": [
202
+ {
203
+ "type": "FIELD",
204
+ "name": "body",
205
+ "content": {
206
+ "type": "SYMBOL",
207
+ "name": "plain_verbatim_body"
208
+ }
209
+ },
210
+ {
211
+ "type": "BLANK"
212
+ }
213
+ ]
214
+ },
215
+ {
216
+ "type": "FIELD",
217
+ "name": "close",
218
+ "content": {
219
+ "type": "SYMBOL",
220
+ "name": "verbatim_close_tag"
221
+ }
222
+ }
223
+ ]
224
+ },
225
+ "verbatim_tex_open_tag": {
226
+ "type": "SEQ",
227
+ "members": [
228
+ {
229
+ "type": "STRING",
230
+ "value": "<"
231
+ },
232
+ {
233
+ "type": "FIELD",
234
+ "name": "name",
235
+ "content": {
236
+ "type": "ALIAS",
237
+ "content": {
238
+ "type": "SYMBOL",
239
+ "name": "_tex_tag_name"
240
+ },
241
+ "named": true,
242
+ "value": "tag_name"
243
+ }
244
+ },
245
+ {
246
+ "type": "CHOICE",
247
+ "members": [
248
+ {
249
+ "type": "FIELD",
250
+ "name": "attributes",
251
+ "content": {
252
+ "type": "SYMBOL",
253
+ "name": "verbatim_attributes"
254
+ }
255
+ },
256
+ {
257
+ "type": "BLANK"
258
+ }
259
+ ]
260
+ },
261
+ {
262
+ "type": "IMMEDIATE_TOKEN",
263
+ "content": {
264
+ "type": "STRING",
265
+ "value": ">"
266
+ }
267
+ }
268
+ ]
269
+ },
270
+ "verbatim_plain_open_tag": {
271
+ "type": "SEQ",
272
+ "members": [
273
+ {
274
+ "type": "STRING",
275
+ "value": "<"
276
+ },
277
+ {
278
+ "type": "FIELD",
279
+ "name": "name",
280
+ "content": {
281
+ "type": "ALIAS",
282
+ "content": {
283
+ "type": "SYMBOL",
284
+ "name": "_plain_tag_name"
285
+ },
286
+ "named": true,
287
+ "value": "tag_name"
288
+ }
289
+ },
290
+ {
291
+ "type": "CHOICE",
292
+ "members": [
293
+ {
294
+ "type": "FIELD",
295
+ "name": "attributes",
296
+ "content": {
297
+ "type": "SYMBOL",
298
+ "name": "verbatim_attributes"
299
+ }
300
+ },
301
+ {
302
+ "type": "BLANK"
303
+ }
304
+ ]
305
+ },
306
+ {
307
+ "type": "IMMEDIATE_TOKEN",
308
+ "content": {
309
+ "type": "STRING",
310
+ "value": ">"
311
+ }
312
+ }
313
+ ]
314
+ },
315
+ "verbatim_close_tag": {
316
+ "type": "SEQ",
317
+ "members": [
318
+ {
319
+ "type": "STRING",
320
+ "value": "</"
321
+ },
322
+ {
323
+ "type": "FIELD",
324
+ "name": "name",
325
+ "content": {
326
+ "type": "ALIAS",
327
+ "content": {
328
+ "type": "SYMBOL",
329
+ "name": "_verbatim_tag_name"
330
+ },
331
+ "named": true,
332
+ "value": "tag_name"
333
+ }
334
+ },
335
+ {
336
+ "type": "IMMEDIATE_TOKEN",
337
+ "content": {
338
+ "type": "STRING",
339
+ "value": ">"
340
+ }
341
+ }
342
+ ]
343
+ },
344
+ "_tex_tag_name": {
345
+ "type": "IMMEDIATE_TOKEN",
346
+ "content": {
347
+ "type": "CHOICE",
348
+ "members": [
349
+ {
350
+ "type": "STRING",
351
+ "value": "tex"
352
+ },
353
+ {
354
+ "type": "STRING",
355
+ "value": "latex"
356
+ },
357
+ {
358
+ "type": "STRING",
359
+ "value": "tikz"
360
+ },
361
+ {
362
+ "type": "STRING",
363
+ "value": "TeX"
364
+ },
365
+ {
366
+ "type": "STRING",
367
+ "value": "LaTeX"
368
+ },
369
+ {
370
+ "type": "STRING",
371
+ "value": "TikZ"
372
+ }
373
+ ]
374
+ }
375
+ },
376
+ "_plain_tag_name": {
377
+ "type": "IMMEDIATE_TOKEN",
378
+ "content": {
379
+ "type": "CHOICE",
380
+ "members": [
381
+ {
382
+ "type": "STRING",
383
+ "value": "verb"
384
+ },
385
+ {
386
+ "type": "STRING",
387
+ "value": "verbatim"
388
+ },
389
+ {
390
+ "type": "STRING",
391
+ "value": "Verb"
392
+ },
393
+ {
394
+ "type": "STRING",
395
+ "value": "Verbatim"
396
+ }
397
+ ]
398
+ }
399
+ },
400
+ "_verbatim_tag_name": {
401
+ "type": "IMMEDIATE_TOKEN",
402
+ "content": {
403
+ "type": "CHOICE",
404
+ "members": [
405
+ {
406
+ "type": "STRING",
407
+ "value": "tex"
408
+ },
409
+ {
410
+ "type": "STRING",
411
+ "value": "latex"
412
+ },
413
+ {
414
+ "type": "STRING",
415
+ "value": "tikz"
416
+ },
417
+ {
418
+ "type": "STRING",
419
+ "value": "TeX"
420
+ },
421
+ {
422
+ "type": "STRING",
423
+ "value": "LaTeX"
424
+ },
425
+ {
426
+ "type": "STRING",
427
+ "value": "TikZ"
428
+ },
429
+ {
430
+ "type": "STRING",
431
+ "value": "verb"
432
+ },
433
+ {
434
+ "type": "STRING",
435
+ "value": "verbatim"
436
+ },
437
+ {
438
+ "type": "STRING",
439
+ "value": "Verb"
440
+ },
441
+ {
442
+ "type": "STRING",
443
+ "value": "Verbatim"
444
+ }
445
+ ]
446
+ }
447
+ },
448
+ "verbatim_attributes": {
449
+ "type": "IMMEDIATE_TOKEN",
450
+ "content": {
451
+ "type": "PATTERN",
452
+ "value": "[ \\t\\r\\n][^>]*"
453
+ }
454
+ },
455
+ "tex_verbatim_body": {
456
+ "type": "SYMBOL",
457
+ "name": "_verbatim_tex_content"
458
+ },
459
+ "plain_verbatim_body": {
460
+ "type": "SYMBOL",
461
+ "name": "_verbatim_plain_content"
462
+ },
463
+ "display_math": {
464
+ "type": "PREC_DYNAMIC",
465
+ "value": 2,
466
+ "content": {
467
+ "type": "CHOICE",
468
+ "members": [
469
+ {
470
+ "type": "SEQ",
471
+ "members": [
472
+ {
473
+ "type": "ALIAS",
474
+ "content": {
475
+ "type": "SYMBOL",
476
+ "name": "_dollar_dollar"
477
+ },
478
+ "named": true,
479
+ "value": "math_delimiter"
480
+ },
481
+ {
482
+ "type": "CHOICE",
483
+ "members": [
484
+ {
485
+ "type": "FIELD",
486
+ "name": "body",
487
+ "content": {
488
+ "type": "SYMBOL",
489
+ "name": "math_content_display"
490
+ }
491
+ },
492
+ {
493
+ "type": "BLANK"
494
+ }
495
+ ]
496
+ },
497
+ {
498
+ "type": "ALIAS",
499
+ "content": {
500
+ "type": "SYMBOL",
501
+ "name": "_dollar_dollar"
502
+ },
503
+ "named": true,
504
+ "value": "math_delimiter"
505
+ }
506
+ ]
507
+ },
508
+ {
509
+ "type": "SEQ",
510
+ "members": [
511
+ {
512
+ "type": "ALIAS",
513
+ "content": {
514
+ "type": "STRING",
515
+ "value": "\\["
516
+ },
517
+ "named": true,
518
+ "value": "math_delimiter"
519
+ },
520
+ {
521
+ "type": "CHOICE",
522
+ "members": [
523
+ {
524
+ "type": "FIELD",
525
+ "name": "body",
526
+ "content": {
527
+ "type": "SYMBOL",
528
+ "name": "math_content_bracket"
529
+ }
530
+ },
531
+ {
532
+ "type": "BLANK"
533
+ }
534
+ ]
535
+ },
536
+ {
537
+ "type": "ALIAS",
538
+ "content": {
539
+ "type": "STRING",
540
+ "value": "\\]"
541
+ },
542
+ "named": true,
543
+ "value": "math_delimiter"
544
+ }
545
+ ]
546
+ }
547
+ ]
548
+ }
549
+ },
550
+ "inline_math": {
551
+ "type": "PREC_DYNAMIC",
552
+ "value": 1,
553
+ "content": {
554
+ "type": "CHOICE",
555
+ "members": [
556
+ {
557
+ "type": "SEQ",
558
+ "members": [
559
+ {
560
+ "type": "ALIAS",
561
+ "content": {
562
+ "type": "SYMBOL",
563
+ "name": "_dollar"
564
+ },
565
+ "named": true,
566
+ "value": "math_delimiter"
567
+ },
568
+ {
569
+ "type": "CHOICE",
570
+ "members": [
571
+ {
572
+ "type": "FIELD",
573
+ "name": "body",
574
+ "content": {
575
+ "type": "SYMBOL",
576
+ "name": "math_content_inline"
577
+ }
578
+ },
579
+ {
580
+ "type": "BLANK"
581
+ }
582
+ ]
583
+ },
584
+ {
585
+ "type": "ALIAS",
586
+ "content": {
587
+ "type": "SYMBOL",
588
+ "name": "_dollar"
589
+ },
590
+ "named": true,
591
+ "value": "math_delimiter"
592
+ }
593
+ ]
594
+ },
595
+ {
596
+ "type": "SEQ",
597
+ "members": [
598
+ {
599
+ "type": "ALIAS",
600
+ "content": {
601
+ "type": "STRING",
602
+ "value": "\\("
603
+ },
604
+ "named": true,
605
+ "value": "math_delimiter"
606
+ },
607
+ {
608
+ "type": "CHOICE",
609
+ "members": [
610
+ {
611
+ "type": "FIELD",
612
+ "name": "body",
613
+ "content": {
614
+ "type": "SYMBOL",
615
+ "name": "math_content_paren"
616
+ }
617
+ },
618
+ {
619
+ "type": "BLANK"
620
+ }
621
+ ]
622
+ },
623
+ {
624
+ "type": "ALIAS",
625
+ "content": {
626
+ "type": "STRING",
627
+ "value": "\\)"
628
+ },
629
+ "named": true,
630
+ "value": "math_delimiter"
631
+ }
632
+ ]
633
+ }
634
+ ]
635
+ }
636
+ },
637
+ "_dollar": {
638
+ "type": "TOKEN",
639
+ "content": {
640
+ "type": "PREC",
641
+ "value": 1,
642
+ "content": {
643
+ "type": "STRING",
644
+ "value": "$"
645
+ }
646
+ }
647
+ },
648
+ "_dollar_dollar": {
649
+ "type": "TOKEN",
650
+ "content": {
651
+ "type": "PREC",
652
+ "value": 2,
653
+ "content": {
654
+ "type": "STRING",
655
+ "value": "$$"
656
+ }
657
+ }
658
+ },
659
+ "math_content_display": {
660
+ "type": "SYMBOL",
661
+ "name": "_display_math_content"
662
+ },
663
+ "math_content_inline": {
664
+ "type": "SYMBOL",
665
+ "name": "_inline_math_content"
666
+ },
667
+ "math_content_bracket": {
668
+ "type": "TOKEN",
669
+ "content": {
670
+ "type": "PREC",
671
+ "value": -1,
672
+ "content": {
673
+ "type": "PATTERN",
674
+ "value": "([^\\\\]|\\\\[^\\]])+"
675
+ }
676
+ }
677
+ },
678
+ "math_content_paren": {
679
+ "type": "TOKEN",
680
+ "content": {
681
+ "type": "PREC",
682
+ "value": -1,
683
+ "content": {
684
+ "type": "PATTERN",
685
+ "value": "([^\\\\]|\\\\[^)])+"
686
+ }
687
+ }
688
+ },
689
+ "markdown_chunk": {
690
+ "type": "SYMBOL",
691
+ "name": "_markdown_chunk"
692
+ },
693
+ "_word": {
694
+ "type": "PATTERN",
695
+ "value": "[A-Za-z][A-Za-z0-9_-]*"
696
+ }
697
+ },
698
+ "extras": [],
699
+ "conflicts": [],
700
+ "precedences": [],
701
+ "externals": [
702
+ {
703
+ "type": "SYMBOL",
704
+ "name": "_frontmatter_start"
705
+ },
706
+ {
707
+ "type": "SYMBOL",
708
+ "name": "_frontmatter_end"
709
+ },
710
+ {
711
+ "type": "SYMBOL",
712
+ "name": "_frontmatter_body"
713
+ },
714
+ {
715
+ "type": "SYMBOL",
716
+ "name": "_verbatim_tex_content"
717
+ },
718
+ {
719
+ "type": "SYMBOL",
720
+ "name": "_verbatim_plain_content"
721
+ },
722
+ {
723
+ "type": "SYMBOL",
724
+ "name": "_inline_math_content"
725
+ },
726
+ {
727
+ "type": "SYMBOL",
728
+ "name": "_display_math_content"
729
+ },
730
+ {
731
+ "type": "SYMBOL",
732
+ "name": "_markdown_chunk"
733
+ },
734
+ {
735
+ "type": "SYMBOL",
736
+ "name": "_error_sentinel"
737
+ }
738
+ ],
739
+ "inline": [],
740
+ "supertypes": [],
741
+ "reserved": {}
742
+ }