tree-sitter-ucode 0.3.0 → 0.5.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.
Files changed (53) hide show
  1. package/README.md +32 -81
  2. package/grammar.js +221 -35
  3. package/markup/grammar.js +1057 -0
  4. package/markup/queries/folds.scm +20 -0
  5. package/markup/queries/highlights.scm +38 -0
  6. package/markup/queries/indents.scm +51 -0
  7. package/markup/queries/injections.scm +40 -0
  8. package/markup/queries/locals.scm +107 -0
  9. package/markup/queries/tags.scm +65 -0
  10. package/markup/queries/textobjects.scm +56 -0
  11. package/markup/src/grammar.json +5814 -0
  12. package/markup/src/node-types.json +3224 -0
  13. package/markup/src/parser.c +134512 -0
  14. package/markup/src/scanner.c +22 -0
  15. package/package.json +9 -5
  16. package/prebuilds/darwin-arm64/tree-sitter-ucode.node +0 -0
  17. package/prebuilds/linux-arm64/tree-sitter-ucode.node +0 -0
  18. package/prebuilds/linux-x64/tree-sitter-ucode.node +0 -0
  19. package/prebuilds/win32-x64/tree-sitter-ucode.node +0 -0
  20. package/queries/locals.scm +8 -0
  21. package/queries/tags.scm +15 -2
  22. package/scripts/generate-markup-grammar.js +93 -0
  23. package/src/grammar.json +1104 -233
  24. package/src/node-types.json +736 -69
  25. package/src/parser.c +106697 -25362
  26. package/src/scanner.c +16 -193
  27. package/src/scanner_impl.h +494 -0
  28. package/tree-sitter-ucode.wasm +0 -0
  29. package/tree-sitter-ucode_markup.wasm +0 -0
  30. package/tree-sitter.json +46 -22
  31. package/ucdocs/grammar.js +284 -0
  32. package/ucdocs/queries/highlights.scm +25 -0
  33. package/ucdocs/queries/tags.scm +22 -0
  34. package/ucdocs/src/grammar.json +1437 -0
  35. package/ucdocs/src/node-types.json +1347 -0
  36. package/ucdocs/src/parser.c +6387 -0
  37. package/ucdocs/src/tree_sitter/alloc.h +54 -0
  38. package/ucdocs/src/tree_sitter/array.h +330 -0
  39. package/ucdocs/src/tree_sitter/parser.h +286 -0
  40. package/tmpl/grammar.js +0 -68
  41. package/tmpl/queries/folds.scm +0 -4
  42. package/tmpl/queries/highlights.scm +0 -23
  43. package/tmpl/queries/indents.scm +0 -5
  44. package/tmpl/queries/injections.scm +0 -8
  45. package/tmpl/queries/locals.scm +0 -3
  46. package/tmpl/src/grammar.json +0 -251
  47. package/tmpl/src/node-types.json +0 -238
  48. package/tmpl/src/parser.c +0 -724
  49. package/tmpl/src/scanner.c +0 -174
  50. package/tree-sitter-ucode_tmpl.wasm +0 -0
  51. /package/{tmpl → markup}/src/tree_sitter/alloc.h +0 -0
  52. /package/{tmpl → markup}/src/tree_sitter/array.h +0 -0
  53. /package/{tmpl → markup}/src/tree_sitter/parser.h +0 -0
@@ -0,0 +1,1437 @@
1
+ {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
3
+ "name": "ucdocs",
4
+ "rules": {
5
+ "document": {
6
+ "type": "SEQ",
7
+ "members": [
8
+ {
9
+ "type": "SYMBOL",
10
+ "name": "_begin"
11
+ },
12
+ {
13
+ "type": "CHOICE",
14
+ "members": [
15
+ {
16
+ "type": "ALIAS",
17
+ "content": {
18
+ "type": "SYMBOL",
19
+ "name": "_free_description"
20
+ },
21
+ "named": true,
22
+ "value": "description"
23
+ },
24
+ {
25
+ "type": "BLANK"
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "type": "REPEAT",
31
+ "content": {
32
+ "type": "CHOICE",
33
+ "members": [
34
+ {
35
+ "type": "SYMBOL",
36
+ "name": "param_tag"
37
+ },
38
+ {
39
+ "type": "SYMBOL",
40
+ "name": "returns_tag"
41
+ },
42
+ {
43
+ "type": "SYMBOL",
44
+ "name": "template_tag"
45
+ },
46
+ {
47
+ "type": "SYMBOL",
48
+ "name": "typedef_tag"
49
+ },
50
+ {
51
+ "type": "SYMBOL",
52
+ "name": "type_tag"
53
+ },
54
+ {
55
+ "type": "SYMBOL",
56
+ "name": "throws_tag"
57
+ },
58
+ {
59
+ "type": "SYMBOL",
60
+ "name": "deprecated_tag"
61
+ },
62
+ {
63
+ "type": "SYMBOL",
64
+ "name": "since_tag"
65
+ },
66
+ {
67
+ "type": "SYMBOL",
68
+ "name": "see_tag"
69
+ },
70
+ {
71
+ "type": "SYMBOL",
72
+ "name": "example_tag"
73
+ },
74
+ {
75
+ "type": "SYMBOL",
76
+ "name": "default_tag"
77
+ },
78
+ {
79
+ "type": "SYMBOL",
80
+ "name": "unknown_tag"
81
+ }
82
+ ]
83
+ }
84
+ },
85
+ {
86
+ "type": "SYMBOL",
87
+ "name": "_end"
88
+ }
89
+ ]
90
+ },
91
+ "_begin": {
92
+ "type": "SEQ",
93
+ "members": [
94
+ {
95
+ "type": "STRING",
96
+ "value": "/"
97
+ },
98
+ {
99
+ "type": "REPEAT",
100
+ "content": {
101
+ "type": "STRING",
102
+ "value": "*"
103
+ }
104
+ }
105
+ ]
106
+ },
107
+ "_end": {
108
+ "type": "STRING",
109
+ "value": "/"
110
+ },
111
+ "_typed_description": {
112
+ "type": "PREC_RIGHT",
113
+ "value": 0,
114
+ "content": {
115
+ "type": "SEQ",
116
+ "members": [
117
+ {
118
+ "type": "CHOICE",
119
+ "members": [
120
+ {
121
+ "type": "SYMBOL",
122
+ "name": "_text"
123
+ },
124
+ {
125
+ "type": "SYMBOL",
126
+ "name": "inline_tag"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "type": "REPEAT",
132
+ "content": {
133
+ "type": "CHOICE",
134
+ "members": [
135
+ {
136
+ "type": "SYMBOL",
137
+ "name": "_text"
138
+ },
139
+ {
140
+ "type": "SYMBOL",
141
+ "name": "inline_tag"
142
+ }
143
+ ]
144
+ }
145
+ }
146
+ ]
147
+ }
148
+ },
149
+ "_free_description": {
150
+ "type": "PREC_RIGHT",
151
+ "value": 0,
152
+ "content": {
153
+ "type": "SEQ",
154
+ "members": [
155
+ {
156
+ "type": "CHOICE",
157
+ "members": [
158
+ {
159
+ "type": "SYMBOL",
160
+ "name": "_text"
161
+ },
162
+ {
163
+ "type": "SYMBOL",
164
+ "name": "inline_tag"
165
+ },
166
+ {
167
+ "type": "SYMBOL",
168
+ "name": "_brace_text"
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "type": "REPEAT",
174
+ "content": {
175
+ "type": "CHOICE",
176
+ "members": [
177
+ {
178
+ "type": "SYMBOL",
179
+ "name": "_text"
180
+ },
181
+ {
182
+ "type": "SYMBOL",
183
+ "name": "inline_tag"
184
+ },
185
+ {
186
+ "type": "SYMBOL",
187
+ "name": "_brace_text"
188
+ }
189
+ ]
190
+ }
191
+ }
192
+ ]
193
+ }
194
+ },
195
+ "inline_tag": {
196
+ "type": "SEQ",
197
+ "members": [
198
+ {
199
+ "type": "STRING",
200
+ "value": "{"
201
+ },
202
+ {
203
+ "type": "SYMBOL",
204
+ "name": "tag_name"
205
+ },
206
+ {
207
+ "type": "CHOICE",
208
+ "members": [
209
+ {
210
+ "type": "ALIAS",
211
+ "content": {
212
+ "type": "SYMBOL",
213
+ "name": "_free_description"
214
+ },
215
+ "named": true,
216
+ "value": "description"
217
+ },
218
+ {
219
+ "type": "BLANK"
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "type": "STRING",
225
+ "value": "}"
226
+ }
227
+ ]
228
+ },
229
+ "_brace_text": {
230
+ "type": "SEQ",
231
+ "members": [
232
+ {
233
+ "type": "STRING",
234
+ "value": "{"
235
+ },
236
+ {
237
+ "type": "CHOICE",
238
+ "members": [
239
+ {
240
+ "type": "SEQ",
241
+ "members": [
242
+ {
243
+ "type": "PATTERN",
244
+ "value": "[^{}@]"
245
+ },
246
+ {
247
+ "type": "REPEAT",
248
+ "content": {
249
+ "type": "CHOICE",
250
+ "members": [
251
+ {
252
+ "type": "PATTERN",
253
+ "value": "[^{}]+"
254
+ },
255
+ {
256
+ "type": "SYMBOL",
257
+ "name": "_brace_text"
258
+ }
259
+ ]
260
+ }
261
+ }
262
+ ]
263
+ },
264
+ {
265
+ "type": "BLANK"
266
+ }
267
+ ]
268
+ },
269
+ {
270
+ "type": "STRING",
271
+ "value": "}"
272
+ }
273
+ ]
274
+ },
275
+ "param_tag": {
276
+ "type": "SEQ",
277
+ "members": [
278
+ {
279
+ "type": "STRING",
280
+ "value": "@param"
281
+ },
282
+ {
283
+ "type": "CHOICE",
284
+ "members": [
285
+ {
286
+ "type": "FIELD",
287
+ "name": "type",
288
+ "content": {
289
+ "type": "CHOICE",
290
+ "members": [
291
+ {
292
+ "type": "SYMBOL",
293
+ "name": "type_expression"
294
+ },
295
+ {
296
+ "type": "SYMBOL",
297
+ "name": "rest_type_expression"
298
+ }
299
+ ]
300
+ }
301
+ },
302
+ {
303
+ "type": "BLANK"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ "type": "CHOICE",
309
+ "members": [
310
+ {
311
+ "type": "FIELD",
312
+ "name": "name",
313
+ "content": {
314
+ "type": "CHOICE",
315
+ "members": [
316
+ {
317
+ "type": "SYMBOL",
318
+ "name": "identifier"
319
+ },
320
+ {
321
+ "type": "SYMBOL",
322
+ "name": "optional_param"
323
+ }
324
+ ]
325
+ }
326
+ },
327
+ {
328
+ "type": "BLANK"
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "type": "CHOICE",
334
+ "members": [
335
+ {
336
+ "type": "FIELD",
337
+ "name": "description",
338
+ "content": {
339
+ "type": "ALIAS",
340
+ "content": {
341
+ "type": "SYMBOL",
342
+ "name": "_typed_description"
343
+ },
344
+ "named": true,
345
+ "value": "description"
346
+ }
347
+ },
348
+ {
349
+ "type": "BLANK"
350
+ }
351
+ ]
352
+ }
353
+ ]
354
+ },
355
+ "optional_param": {
356
+ "type": "SEQ",
357
+ "members": [
358
+ {
359
+ "type": "STRING",
360
+ "value": "["
361
+ },
362
+ {
363
+ "type": "FIELD",
364
+ "name": "name",
365
+ "content": {
366
+ "type": "SYMBOL",
367
+ "name": "param_path"
368
+ }
369
+ },
370
+ {
371
+ "type": "CHOICE",
372
+ "members": [
373
+ {
374
+ "type": "SEQ",
375
+ "members": [
376
+ {
377
+ "type": "STRING",
378
+ "value": "="
379
+ },
380
+ {
381
+ "type": "FIELD",
382
+ "name": "default",
383
+ "content": {
384
+ "type": "SYMBOL",
385
+ "name": "default_value"
386
+ }
387
+ }
388
+ ]
389
+ },
390
+ {
391
+ "type": "BLANK"
392
+ }
393
+ ]
394
+ },
395
+ {
396
+ "type": "STRING",
397
+ "value": "]"
398
+ }
399
+ ]
400
+ },
401
+ "param_path": {
402
+ "type": "SEQ",
403
+ "members": [
404
+ {
405
+ "type": "SYMBOL",
406
+ "name": "identifier"
407
+ },
408
+ {
409
+ "type": "REPEAT",
410
+ "content": {
411
+ "type": "SEQ",
412
+ "members": [
413
+ {
414
+ "type": "STRING",
415
+ "value": "."
416
+ },
417
+ {
418
+ "type": "SYMBOL",
419
+ "name": "identifier"
420
+ }
421
+ ]
422
+ }
423
+ }
424
+ ]
425
+ },
426
+ "default_value": {
427
+ "type": "TOKEN",
428
+ "content": {
429
+ "type": "CHOICE",
430
+ "members": [
431
+ {
432
+ "type": "PATTERN",
433
+ "value": "-?\\d+(\\.\\d+)?"
434
+ },
435
+ {
436
+ "type": "PATTERN",
437
+ "value": "[a-zA-Z_$][a-zA-Z0-9_$]*"
438
+ }
439
+ ]
440
+ }
441
+ },
442
+ "returns_tag": {
443
+ "type": "SEQ",
444
+ "members": [
445
+ {
446
+ "type": "CHOICE",
447
+ "members": [
448
+ {
449
+ "type": "STRING",
450
+ "value": "@returns"
451
+ },
452
+ {
453
+ "type": "STRING",
454
+ "value": "@return"
455
+ }
456
+ ]
457
+ },
458
+ {
459
+ "type": "CHOICE",
460
+ "members": [
461
+ {
462
+ "type": "FIELD",
463
+ "name": "type",
464
+ "content": {
465
+ "type": "SYMBOL",
466
+ "name": "type_expression"
467
+ }
468
+ },
469
+ {
470
+ "type": "BLANK"
471
+ }
472
+ ]
473
+ },
474
+ {
475
+ "type": "CHOICE",
476
+ "members": [
477
+ {
478
+ "type": "FIELD",
479
+ "name": "description",
480
+ "content": {
481
+ "type": "ALIAS",
482
+ "content": {
483
+ "type": "SYMBOL",
484
+ "name": "_typed_description"
485
+ },
486
+ "named": true,
487
+ "value": "description"
488
+ }
489
+ },
490
+ {
491
+ "type": "BLANK"
492
+ }
493
+ ]
494
+ }
495
+ ]
496
+ },
497
+ "template_tag": {
498
+ "type": "SEQ",
499
+ "members": [
500
+ {
501
+ "type": "STRING",
502
+ "value": "@template"
503
+ },
504
+ {
505
+ "type": "SEQ",
506
+ "members": [
507
+ {
508
+ "type": "ALIAS",
509
+ "content": {
510
+ "type": "SYMBOL",
511
+ "name": "type_identifier"
512
+ },
513
+ "named": true,
514
+ "value": "type_param"
515
+ },
516
+ {
517
+ "type": "REPEAT",
518
+ "content": {
519
+ "type": "SEQ",
520
+ "members": [
521
+ {
522
+ "type": "STRING",
523
+ "value": ","
524
+ },
525
+ {
526
+ "type": "ALIAS",
527
+ "content": {
528
+ "type": "SYMBOL",
529
+ "name": "type_identifier"
530
+ },
531
+ "named": true,
532
+ "value": "type_param"
533
+ }
534
+ ]
535
+ }
536
+ }
537
+ ]
538
+ }
539
+ ]
540
+ },
541
+ "typedef_tag": {
542
+ "type": "SEQ",
543
+ "members": [
544
+ {
545
+ "type": "STRING",
546
+ "value": "@typedef"
547
+ },
548
+ {
549
+ "type": "CHOICE",
550
+ "members": [
551
+ {
552
+ "type": "FIELD",
553
+ "name": "type",
554
+ "content": {
555
+ "type": "SYMBOL",
556
+ "name": "type_expression"
557
+ }
558
+ },
559
+ {
560
+ "type": "BLANK"
561
+ }
562
+ ]
563
+ },
564
+ {
565
+ "type": "FIELD",
566
+ "name": "name",
567
+ "content": {
568
+ "type": "SYMBOL",
569
+ "name": "type_identifier"
570
+ }
571
+ }
572
+ ]
573
+ },
574
+ "type_tag": {
575
+ "type": "SEQ",
576
+ "members": [
577
+ {
578
+ "type": "STRING",
579
+ "value": "@type"
580
+ },
581
+ {
582
+ "type": "FIELD",
583
+ "name": "type",
584
+ "content": {
585
+ "type": "SYMBOL",
586
+ "name": "type_expression"
587
+ }
588
+ }
589
+ ]
590
+ },
591
+ "throws_tag": {
592
+ "type": "SEQ",
593
+ "members": [
594
+ {
595
+ "type": "CHOICE",
596
+ "members": [
597
+ {
598
+ "type": "STRING",
599
+ "value": "@throws"
600
+ },
601
+ {
602
+ "type": "STRING",
603
+ "value": "@throw"
604
+ }
605
+ ]
606
+ },
607
+ {
608
+ "type": "CHOICE",
609
+ "members": [
610
+ {
611
+ "type": "FIELD",
612
+ "name": "type",
613
+ "content": {
614
+ "type": "SYMBOL",
615
+ "name": "type_expression"
616
+ }
617
+ },
618
+ {
619
+ "type": "BLANK"
620
+ }
621
+ ]
622
+ },
623
+ {
624
+ "type": "CHOICE",
625
+ "members": [
626
+ {
627
+ "type": "FIELD",
628
+ "name": "description",
629
+ "content": {
630
+ "type": "ALIAS",
631
+ "content": {
632
+ "type": "SYMBOL",
633
+ "name": "_typed_description"
634
+ },
635
+ "named": true,
636
+ "value": "description"
637
+ }
638
+ },
639
+ {
640
+ "type": "BLANK"
641
+ }
642
+ ]
643
+ }
644
+ ]
645
+ },
646
+ "deprecated_tag": {
647
+ "type": "SEQ",
648
+ "members": [
649
+ {
650
+ "type": "STRING",
651
+ "value": "@deprecated"
652
+ },
653
+ {
654
+ "type": "CHOICE",
655
+ "members": [
656
+ {
657
+ "type": "FIELD",
658
+ "name": "description",
659
+ "content": {
660
+ "type": "ALIAS",
661
+ "content": {
662
+ "type": "SYMBOL",
663
+ "name": "_free_description"
664
+ },
665
+ "named": true,
666
+ "value": "description"
667
+ }
668
+ },
669
+ {
670
+ "type": "BLANK"
671
+ }
672
+ ]
673
+ }
674
+ ]
675
+ },
676
+ "since_tag": {
677
+ "type": "SEQ",
678
+ "members": [
679
+ {
680
+ "type": "STRING",
681
+ "value": "@since"
682
+ },
683
+ {
684
+ "type": "CHOICE",
685
+ "members": [
686
+ {
687
+ "type": "FIELD",
688
+ "name": "description",
689
+ "content": {
690
+ "type": "ALIAS",
691
+ "content": {
692
+ "type": "SYMBOL",
693
+ "name": "_free_description"
694
+ },
695
+ "named": true,
696
+ "value": "description"
697
+ }
698
+ },
699
+ {
700
+ "type": "BLANK"
701
+ }
702
+ ]
703
+ }
704
+ ]
705
+ },
706
+ "see_tag": {
707
+ "type": "SEQ",
708
+ "members": [
709
+ {
710
+ "type": "STRING",
711
+ "value": "@see"
712
+ },
713
+ {
714
+ "type": "CHOICE",
715
+ "members": [
716
+ {
717
+ "type": "FIELD",
718
+ "name": "description",
719
+ "content": {
720
+ "type": "ALIAS",
721
+ "content": {
722
+ "type": "SYMBOL",
723
+ "name": "_free_description"
724
+ },
725
+ "named": true,
726
+ "value": "description"
727
+ }
728
+ },
729
+ {
730
+ "type": "BLANK"
731
+ }
732
+ ]
733
+ }
734
+ ]
735
+ },
736
+ "example_tag": {
737
+ "type": "SEQ",
738
+ "members": [
739
+ {
740
+ "type": "STRING",
741
+ "value": "@example"
742
+ },
743
+ {
744
+ "type": "CHOICE",
745
+ "members": [
746
+ {
747
+ "type": "FIELD",
748
+ "name": "description",
749
+ "content": {
750
+ "type": "ALIAS",
751
+ "content": {
752
+ "type": "SYMBOL",
753
+ "name": "_free_description"
754
+ },
755
+ "named": true,
756
+ "value": "description"
757
+ }
758
+ },
759
+ {
760
+ "type": "BLANK"
761
+ }
762
+ ]
763
+ }
764
+ ]
765
+ },
766
+ "default_tag": {
767
+ "type": "SEQ",
768
+ "members": [
769
+ {
770
+ "type": "STRING",
771
+ "value": "@default"
772
+ },
773
+ {
774
+ "type": "CHOICE",
775
+ "members": [
776
+ {
777
+ "type": "FIELD",
778
+ "name": "description",
779
+ "content": {
780
+ "type": "ALIAS",
781
+ "content": {
782
+ "type": "SYMBOL",
783
+ "name": "_free_description"
784
+ },
785
+ "named": true,
786
+ "value": "description"
787
+ }
788
+ },
789
+ {
790
+ "type": "BLANK"
791
+ }
792
+ ]
793
+ }
794
+ ]
795
+ },
796
+ "unknown_tag": {
797
+ "type": "SEQ",
798
+ "members": [
799
+ {
800
+ "type": "SYMBOL",
801
+ "name": "tag_name"
802
+ },
803
+ {
804
+ "type": "CHOICE",
805
+ "members": [
806
+ {
807
+ "type": "FIELD",
808
+ "name": "description",
809
+ "content": {
810
+ "type": "ALIAS",
811
+ "content": {
812
+ "type": "SYMBOL",
813
+ "name": "_free_description"
814
+ },
815
+ "named": true,
816
+ "value": "description"
817
+ }
818
+ },
819
+ {
820
+ "type": "BLANK"
821
+ }
822
+ ]
823
+ }
824
+ ]
825
+ },
826
+ "tag_name": {
827
+ "type": "PATTERN",
828
+ "value": "@[a-zA-Z_]+"
829
+ },
830
+ "type_expression": {
831
+ "type": "SEQ",
832
+ "members": [
833
+ {
834
+ "type": "STRING",
835
+ "value": "{"
836
+ },
837
+ {
838
+ "type": "SYMBOL",
839
+ "name": "_type"
840
+ },
841
+ {
842
+ "type": "STRING",
843
+ "value": "}"
844
+ }
845
+ ]
846
+ },
847
+ "rest_type_expression": {
848
+ "type": "SEQ",
849
+ "members": [
850
+ {
851
+ "type": "STRING",
852
+ "value": "{"
853
+ },
854
+ {
855
+ "type": "STRING",
856
+ "value": "..."
857
+ },
858
+ {
859
+ "type": "SYMBOL",
860
+ "name": "_type"
861
+ },
862
+ {
863
+ "type": "STRING",
864
+ "value": "}"
865
+ }
866
+ ]
867
+ },
868
+ "_type": {
869
+ "type": "CHOICE",
870
+ "members": [
871
+ {
872
+ "type": "SYMBOL",
873
+ "name": "primitive_type"
874
+ },
875
+ {
876
+ "type": "SYMBOL",
877
+ "name": "list_type"
878
+ },
879
+ {
880
+ "type": "SYMBOL",
881
+ "name": "dict_type"
882
+ },
883
+ {
884
+ "type": "SYMBOL",
885
+ "name": "record_type"
886
+ },
887
+ {
888
+ "type": "SYMBOL",
889
+ "name": "named_type"
890
+ },
891
+ {
892
+ "type": "SYMBOL",
893
+ "name": "module_type"
894
+ },
895
+ {
896
+ "type": "SYMBOL",
897
+ "name": "function_type"
898
+ },
899
+ {
900
+ "type": "SYMBOL",
901
+ "name": "anon_function_type"
902
+ },
903
+ {
904
+ "type": "SYMBOL",
905
+ "name": "union_type"
906
+ },
907
+ {
908
+ "type": "SYMBOL",
909
+ "name": "nullable_type"
910
+ },
911
+ {
912
+ "type": "SYMBOL",
913
+ "name": "any_type"
914
+ }
915
+ ]
916
+ },
917
+ "primitive_type": {
918
+ "type": "CHOICE",
919
+ "members": [
920
+ {
921
+ "type": "STRING",
922
+ "value": "int"
923
+ },
924
+ {
925
+ "type": "STRING",
926
+ "value": "float"
927
+ },
928
+ {
929
+ "type": "STRING",
930
+ "value": "string"
931
+ },
932
+ {
933
+ "type": "STRING",
934
+ "value": "boolean"
935
+ },
936
+ {
937
+ "type": "STRING",
938
+ "value": "null"
939
+ },
940
+ {
941
+ "type": "STRING",
942
+ "value": "void"
943
+ }
944
+ ]
945
+ },
946
+ "any_type": {
947
+ "type": "CHOICE",
948
+ "members": [
949
+ {
950
+ "type": "STRING",
951
+ "value": "*"
952
+ },
953
+ {
954
+ "type": "STRING",
955
+ "value": "any"
956
+ }
957
+ ]
958
+ },
959
+ "list_type": {
960
+ "type": "SEQ",
961
+ "members": [
962
+ {
963
+ "type": "STRING",
964
+ "value": "list"
965
+ },
966
+ {
967
+ "type": "STRING",
968
+ "value": "<"
969
+ },
970
+ {
971
+ "type": "FIELD",
972
+ "name": "element",
973
+ "content": {
974
+ "type": "SYMBOL",
975
+ "name": "_type"
976
+ }
977
+ },
978
+ {
979
+ "type": "STRING",
980
+ "value": ">"
981
+ }
982
+ ]
983
+ },
984
+ "dict_type": {
985
+ "type": "SEQ",
986
+ "members": [
987
+ {
988
+ "type": "STRING",
989
+ "value": "dict"
990
+ },
991
+ {
992
+ "type": "STRING",
993
+ "value": "<"
994
+ },
995
+ {
996
+ "type": "FIELD",
997
+ "name": "value",
998
+ "content": {
999
+ "type": "SYMBOL",
1000
+ "name": "_type"
1001
+ }
1002
+ },
1003
+ {
1004
+ "type": "STRING",
1005
+ "value": ">"
1006
+ }
1007
+ ]
1008
+ },
1009
+ "record_type": {
1010
+ "type": "SEQ",
1011
+ "members": [
1012
+ {
1013
+ "type": "STRING",
1014
+ "value": "{"
1015
+ },
1016
+ {
1017
+ "type": "CHOICE",
1018
+ "members": [
1019
+ {
1020
+ "type": "SEQ",
1021
+ "members": [
1022
+ {
1023
+ "type": "SYMBOL",
1024
+ "name": "record_field"
1025
+ },
1026
+ {
1027
+ "type": "REPEAT",
1028
+ "content": {
1029
+ "type": "SEQ",
1030
+ "members": [
1031
+ {
1032
+ "type": "STRING",
1033
+ "value": ","
1034
+ },
1035
+ {
1036
+ "type": "SYMBOL",
1037
+ "name": "record_field"
1038
+ }
1039
+ ]
1040
+ }
1041
+ }
1042
+ ]
1043
+ },
1044
+ {
1045
+ "type": "BLANK"
1046
+ }
1047
+ ]
1048
+ },
1049
+ {
1050
+ "type": "STRING",
1051
+ "value": "}"
1052
+ }
1053
+ ]
1054
+ },
1055
+ "record_field": {
1056
+ "type": "SEQ",
1057
+ "members": [
1058
+ {
1059
+ "type": "FIELD",
1060
+ "name": "name",
1061
+ "content": {
1062
+ "type": "SYMBOL",
1063
+ "name": "identifier"
1064
+ }
1065
+ },
1066
+ {
1067
+ "type": "STRING",
1068
+ "value": ":"
1069
+ },
1070
+ {
1071
+ "type": "FIELD",
1072
+ "name": "type",
1073
+ "content": {
1074
+ "type": "SYMBOL",
1075
+ "name": "_type"
1076
+ }
1077
+ }
1078
+ ]
1079
+ },
1080
+ "module_type": {
1081
+ "type": "SEQ",
1082
+ "members": [
1083
+ {
1084
+ "type": "STRING",
1085
+ "value": "module:"
1086
+ },
1087
+ {
1088
+ "type": "FIELD",
1089
+ "name": "path",
1090
+ "content": {
1091
+ "type": "SYMBOL",
1092
+ "name": "module_path"
1093
+ }
1094
+ }
1095
+ ]
1096
+ },
1097
+ "module_path": {
1098
+ "type": "PATTERN",
1099
+ "value": "[a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z_$][a-zA-Z0-9_$]*)*"
1100
+ },
1101
+ "named_type": {
1102
+ "type": "SEQ",
1103
+ "members": [
1104
+ {
1105
+ "type": "FIELD",
1106
+ "name": "name",
1107
+ "content": {
1108
+ "type": "SYMBOL",
1109
+ "name": "type_identifier"
1110
+ }
1111
+ },
1112
+ {
1113
+ "type": "CHOICE",
1114
+ "members": [
1115
+ {
1116
+ "type": "SEQ",
1117
+ "members": [
1118
+ {
1119
+ "type": "STRING",
1120
+ "value": "<"
1121
+ },
1122
+ {
1123
+ "type": "FIELD",
1124
+ "name": "params",
1125
+ "content": {
1126
+ "type": "SEQ",
1127
+ "members": [
1128
+ {
1129
+ "type": "SYMBOL",
1130
+ "name": "_type"
1131
+ },
1132
+ {
1133
+ "type": "REPEAT",
1134
+ "content": {
1135
+ "type": "SEQ",
1136
+ "members": [
1137
+ {
1138
+ "type": "STRING",
1139
+ "value": ","
1140
+ },
1141
+ {
1142
+ "type": "SYMBOL",
1143
+ "name": "_type"
1144
+ }
1145
+ ]
1146
+ }
1147
+ }
1148
+ ]
1149
+ }
1150
+ },
1151
+ {
1152
+ "type": "STRING",
1153
+ "value": ">"
1154
+ }
1155
+ ]
1156
+ },
1157
+ {
1158
+ "type": "BLANK"
1159
+ }
1160
+ ]
1161
+ }
1162
+ ]
1163
+ },
1164
+ "function_type": {
1165
+ "type": "SEQ",
1166
+ "members": [
1167
+ {
1168
+ "type": "STRING",
1169
+ "value": "("
1170
+ },
1171
+ {
1172
+ "type": "FIELD",
1173
+ "name": "params",
1174
+ "content": {
1175
+ "type": "CHOICE",
1176
+ "members": [
1177
+ {
1178
+ "type": "SEQ",
1179
+ "members": [
1180
+ {
1181
+ "type": "SYMBOL",
1182
+ "name": "function_param"
1183
+ },
1184
+ {
1185
+ "type": "REPEAT",
1186
+ "content": {
1187
+ "type": "SEQ",
1188
+ "members": [
1189
+ {
1190
+ "type": "STRING",
1191
+ "value": ","
1192
+ },
1193
+ {
1194
+ "type": "SYMBOL",
1195
+ "name": "function_param"
1196
+ }
1197
+ ]
1198
+ }
1199
+ }
1200
+ ]
1201
+ },
1202
+ {
1203
+ "type": "BLANK"
1204
+ }
1205
+ ]
1206
+ }
1207
+ },
1208
+ {
1209
+ "type": "STRING",
1210
+ "value": ")"
1211
+ },
1212
+ {
1213
+ "type": "STRING",
1214
+ "value": "=>"
1215
+ },
1216
+ {
1217
+ "type": "FIELD",
1218
+ "name": "return",
1219
+ "content": {
1220
+ "type": "SYMBOL",
1221
+ "name": "_type"
1222
+ }
1223
+ }
1224
+ ]
1225
+ },
1226
+ "function_param": {
1227
+ "type": "SEQ",
1228
+ "members": [
1229
+ {
1230
+ "type": "FIELD",
1231
+ "name": "name",
1232
+ "content": {
1233
+ "type": "SYMBOL",
1234
+ "name": "identifier"
1235
+ }
1236
+ },
1237
+ {
1238
+ "type": "STRING",
1239
+ "value": ":"
1240
+ },
1241
+ {
1242
+ "type": "FIELD",
1243
+ "name": "type",
1244
+ "content": {
1245
+ "type": "SYMBOL",
1246
+ "name": "_type"
1247
+ }
1248
+ }
1249
+ ]
1250
+ },
1251
+ "anon_function_type": {
1252
+ "type": "SEQ",
1253
+ "members": [
1254
+ {
1255
+ "type": "STRING",
1256
+ "value": "function"
1257
+ },
1258
+ {
1259
+ "type": "STRING",
1260
+ "value": "("
1261
+ },
1262
+ {
1263
+ "type": "FIELD",
1264
+ "name": "params",
1265
+ "content": {
1266
+ "type": "CHOICE",
1267
+ "members": [
1268
+ {
1269
+ "type": "SEQ",
1270
+ "members": [
1271
+ {
1272
+ "type": "SYMBOL",
1273
+ "name": "_type"
1274
+ },
1275
+ {
1276
+ "type": "REPEAT",
1277
+ "content": {
1278
+ "type": "SEQ",
1279
+ "members": [
1280
+ {
1281
+ "type": "STRING",
1282
+ "value": ","
1283
+ },
1284
+ {
1285
+ "type": "SYMBOL",
1286
+ "name": "_type"
1287
+ }
1288
+ ]
1289
+ }
1290
+ }
1291
+ ]
1292
+ },
1293
+ {
1294
+ "type": "BLANK"
1295
+ }
1296
+ ]
1297
+ }
1298
+ },
1299
+ {
1300
+ "type": "STRING",
1301
+ "value": ")"
1302
+ },
1303
+ {
1304
+ "type": "CHOICE",
1305
+ "members": [
1306
+ {
1307
+ "type": "SEQ",
1308
+ "members": [
1309
+ {
1310
+ "type": "STRING",
1311
+ "value": ":"
1312
+ },
1313
+ {
1314
+ "type": "FIELD",
1315
+ "name": "return",
1316
+ "content": {
1317
+ "type": "SYMBOL",
1318
+ "name": "_type"
1319
+ }
1320
+ }
1321
+ ]
1322
+ },
1323
+ {
1324
+ "type": "BLANK"
1325
+ }
1326
+ ]
1327
+ }
1328
+ ]
1329
+ },
1330
+ "union_type": {
1331
+ "type": "PREC_LEFT",
1332
+ "value": 1,
1333
+ "content": {
1334
+ "type": "SEQ",
1335
+ "members": [
1336
+ {
1337
+ "type": "SYMBOL",
1338
+ "name": "_type"
1339
+ },
1340
+ {
1341
+ "type": "STRING",
1342
+ "value": "|"
1343
+ },
1344
+ {
1345
+ "type": "SYMBOL",
1346
+ "name": "_type"
1347
+ }
1348
+ ]
1349
+ }
1350
+ },
1351
+ "nullable_type": {
1352
+ "type": "PREC",
1353
+ "value": 2,
1354
+ "content": {
1355
+ "type": "SEQ",
1356
+ "members": [
1357
+ {
1358
+ "type": "STRING",
1359
+ "value": "?"
1360
+ },
1361
+ {
1362
+ "type": "SYMBOL",
1363
+ "name": "_type"
1364
+ }
1365
+ ]
1366
+ }
1367
+ },
1368
+ "type_identifier": {
1369
+ "type": "PATTERN",
1370
+ "value": "[A-Z][a-zA-Z0-9]*"
1371
+ },
1372
+ "identifier": {
1373
+ "type": "PATTERN",
1374
+ "value": "[a-z_$][a-zA-Z_$0-9]*"
1375
+ },
1376
+ "_text": {
1377
+ "type": "TOKEN",
1378
+ "content": {
1379
+ "type": "PREC",
1380
+ "value": -1,
1381
+ "content": {
1382
+ "type": "PATTERN",
1383
+ "value": "[^*{}@\\s][^*{}@\\n]*"
1384
+ }
1385
+ }
1386
+ }
1387
+ },
1388
+ "extras": [
1389
+ {
1390
+ "type": "TOKEN",
1391
+ "content": {
1392
+ "type": "CHOICE",
1393
+ "members": [
1394
+ {
1395
+ "type": "SEQ",
1396
+ "members": [
1397
+ {
1398
+ "type": "PATTERN",
1399
+ "value": "\\n"
1400
+ },
1401
+ {
1402
+ "type": "PATTERN",
1403
+ "value": "[ \\t]*"
1404
+ },
1405
+ {
1406
+ "type": "REPEAT",
1407
+ "content": {
1408
+ "type": "SEQ",
1409
+ "members": [
1410
+ {
1411
+ "type": "STRING",
1412
+ "value": "*"
1413
+ },
1414
+ {
1415
+ "type": "PATTERN",
1416
+ "value": "[ \\t]*"
1417
+ }
1418
+ ]
1419
+ }
1420
+ }
1421
+ ]
1422
+ },
1423
+ {
1424
+ "type": "PATTERN",
1425
+ "value": "\\s"
1426
+ }
1427
+ ]
1428
+ }
1429
+ }
1430
+ ],
1431
+ "conflicts": [],
1432
+ "precedences": [],
1433
+ "externals": [],
1434
+ "inline": [],
1435
+ "supertypes": [],
1436
+ "reserved": {}
1437
+ }