tree-sitter-syscript 0.1.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,1748 @@
1
+ {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
3
+ "name": "syscript",
4
+ "rules": {
5
+ "source_file": {
6
+ "type": "SEQ",
7
+ "members": [
8
+ {
9
+ "type": "CHOICE",
10
+ "members": [
11
+ {
12
+ "type": "SYMBOL",
13
+ "name": "shebang"
14
+ },
15
+ {
16
+ "type": "BLANK"
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "type": "REPEAT",
22
+ "content": {
23
+ "type": "CHOICE",
24
+ "members": [
25
+ {
26
+ "type": "SYMBOL",
27
+ "name": "function"
28
+ },
29
+ {
30
+ "type": "SYMBOL",
31
+ "name": "declaration"
32
+ },
33
+ {
34
+ "type": "SYMBOL",
35
+ "name": "structs"
36
+ },
37
+ {
38
+ "type": "SYMBOL",
39
+ "name": "classes"
40
+ },
41
+ {
42
+ "type": "SYMBOL",
43
+ "name": "typedef"
44
+ },
45
+ {
46
+ "type": "SYMBOL",
47
+ "name": "comment"
48
+ }
49
+ ]
50
+ }
51
+ }
52
+ ]
53
+ },
54
+ "shebang": {
55
+ "type": "SEQ",
56
+ "members": [
57
+ {
58
+ "type": "STRING",
59
+ "value": "#!"
60
+ },
61
+ {
62
+ "type": "PATTERN",
63
+ "value": ".*"
64
+ }
65
+ ]
66
+ },
67
+ "comment": {
68
+ "type": "CHOICE",
69
+ "members": [
70
+ {
71
+ "type": "SYMBOL",
72
+ "name": "single_line_comment"
73
+ },
74
+ {
75
+ "type": "SYMBOL",
76
+ "name": "documentation_comment"
77
+ },
78
+ {
79
+ "type": "SYMBOL",
80
+ "name": "multi_line_comment"
81
+ },
82
+ {
83
+ "type": "SYMBOL",
84
+ "name": "unclosed_multi_line_comment"
85
+ }
86
+ ]
87
+ },
88
+ "single_line_comment": {
89
+ "type": "TOKEN",
90
+ "content": {
91
+ "type": "SEQ",
92
+ "members": [
93
+ {
94
+ "type": "STRING",
95
+ "value": "//"
96
+ },
97
+ {
98
+ "type": "PATTERN",
99
+ "value": ".*"
100
+ }
101
+ ]
102
+ }
103
+ },
104
+ "documentation_comment": {
105
+ "type": "PREC_LEFT",
106
+ "value": 1,
107
+ "content": {
108
+ "type": "TOKEN",
109
+ "content": {
110
+ "type": "SEQ",
111
+ "members": [
112
+ {
113
+ "type": "STRING",
114
+ "value": "/**"
115
+ },
116
+ {
117
+ "type": "PATTERN",
118
+ "value": "(.*)*(\\n.*)*"
119
+ },
120
+ {
121
+ "type": "STRING",
122
+ "value": "*/"
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ },
128
+ "multi_line_comment": {
129
+ "type": "PREC_LEFT",
130
+ "value": 1,
131
+ "content": {
132
+ "type": "TOKEN",
133
+ "content": {
134
+ "type": "SEQ",
135
+ "members": [
136
+ {
137
+ "type": "STRING",
138
+ "value": "/*"
139
+ },
140
+ {
141
+ "type": "PATTERN",
142
+ "value": "(.*)*(\\n.*)*"
143
+ },
144
+ {
145
+ "type": "STRING",
146
+ "value": "*/"
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ },
152
+ "unclosed_multi_line_comment": {
153
+ "type": "TOKEN",
154
+ "content": {
155
+ "type": "SEQ",
156
+ "members": [
157
+ {
158
+ "type": "STRING",
159
+ "value": "/*"
160
+ },
161
+ {
162
+ "type": "PATTERN",
163
+ "value": "(.*)*(\\n.*)*$"
164
+ }
165
+ ]
166
+ }
167
+ },
168
+ "classes": {
169
+ "type": "SEQ",
170
+ "members": [
171
+ {
172
+ "type": "STRING",
173
+ "value": "class"
174
+ },
175
+ {
176
+ "type": "FIELD",
177
+ "name": "name",
178
+ "content": {
179
+ "type": "SYMBOL",
180
+ "name": "identifier"
181
+ }
182
+ },
183
+ {
184
+ "type": "CHOICE",
185
+ "members": [
186
+ {
187
+ "type": "SEQ",
188
+ "members": [
189
+ {
190
+ "type": "STRING",
191
+ "value": "extends"
192
+ },
193
+ {
194
+ "type": "SYMBOL",
195
+ "name": "identifier"
196
+ }
197
+ ]
198
+ },
199
+ {
200
+ "type": "BLANK"
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ "type": "STRING",
206
+ "value": "{"
207
+ },
208
+ {
209
+ "type": "FIELD",
210
+ "name": "fields",
211
+ "content": {
212
+ "type": "REPEAT",
213
+ "content": {
214
+ "type": "CHOICE",
215
+ "members": [
216
+ {
217
+ "type": "SYMBOL",
218
+ "name": "field"
219
+ },
220
+ {
221
+ "type": "SYMBOL",
222
+ "name": "method"
223
+ }
224
+ ]
225
+ }
226
+ }
227
+ },
228
+ {
229
+ "type": "STRING",
230
+ "value": "}"
231
+ }
232
+ ]
233
+ },
234
+ "structs": {
235
+ "type": "SEQ",
236
+ "members": [
237
+ {
238
+ "type": "STRING",
239
+ "value": "struct"
240
+ },
241
+ {
242
+ "type": "FIELD",
243
+ "name": "name",
244
+ "content": {
245
+ "type": "SYMBOL",
246
+ "name": "identifier"
247
+ }
248
+ },
249
+ {
250
+ "type": "CHOICE",
251
+ "members": [
252
+ {
253
+ "type": "SEQ",
254
+ "members": [
255
+ {
256
+ "type": "STRING",
257
+ "value": "extends"
258
+ },
259
+ {
260
+ "type": "SYMBOL",
261
+ "name": "identifier"
262
+ }
263
+ ]
264
+ },
265
+ {
266
+ "type": "BLANK"
267
+ }
268
+ ]
269
+ },
270
+ {
271
+ "type": "STRING",
272
+ "value": "{"
273
+ },
274
+ {
275
+ "type": "FIELD",
276
+ "name": "fields",
277
+ "content": {
278
+ "type": "REPEAT",
279
+ "content": {
280
+ "type": "SYMBOL",
281
+ "name": "field"
282
+ }
283
+ }
284
+ },
285
+ {
286
+ "type": "STRING",
287
+ "value": "}"
288
+ }
289
+ ]
290
+ },
291
+ "field": {
292
+ "type": "SEQ",
293
+ "members": [
294
+ {
295
+ "type": "SYMBOL",
296
+ "name": "identifier"
297
+ },
298
+ {
299
+ "type": "STRING",
300
+ "value": ":"
301
+ },
302
+ {
303
+ "type": "SYMBOL",
304
+ "name": "type_signature"
305
+ },
306
+ {
307
+ "type": "STRING",
308
+ "value": ";"
309
+ }
310
+ ]
311
+ },
312
+ "property": {
313
+ "type": "SEQ",
314
+ "members": [
315
+ {
316
+ "type": "SYMBOL",
317
+ "name": "identifier"
318
+ },
319
+ {
320
+ "type": "STRING",
321
+ "value": ":"
322
+ },
323
+ {
324
+ "type": "SYMBOL",
325
+ "name": "value"
326
+ }
327
+ ]
328
+ },
329
+ "property_list": {
330
+ "type": "SEQ",
331
+ "members": [
332
+ {
333
+ "type": "SYMBOL",
334
+ "name": "property"
335
+ },
336
+ {
337
+ "type": "REPEAT",
338
+ "content": {
339
+ "type": "SEQ",
340
+ "members": [
341
+ {
342
+ "type": "STRING",
343
+ "value": ","
344
+ },
345
+ {
346
+ "type": "SYMBOL",
347
+ "name": "property"
348
+ }
349
+ ]
350
+ }
351
+ }
352
+ ]
353
+ },
354
+ "typedef": {
355
+ "type": "SEQ",
356
+ "members": [
357
+ {
358
+ "type": "STRING",
359
+ "value": "typedef"
360
+ },
361
+ {
362
+ "type": "SYMBOL",
363
+ "name": "identifier"
364
+ },
365
+ {
366
+ "type": "STRING",
367
+ "value": "="
368
+ },
369
+ {
370
+ "type": "SYMBOL",
371
+ "name": "type_signature"
372
+ },
373
+ {
374
+ "type": "STRING",
375
+ "value": ";"
376
+ }
377
+ ]
378
+ },
379
+ "function": {
380
+ "type": "SEQ",
381
+ "members": [
382
+ {
383
+ "type": "STRING",
384
+ "value": "fn"
385
+ },
386
+ {
387
+ "type": "SYMBOL",
388
+ "name": "method"
389
+ }
390
+ ]
391
+ },
392
+ "method": {
393
+ "type": "SEQ",
394
+ "members": [
395
+ {
396
+ "type": "FIELD",
397
+ "name": "name",
398
+ "content": {
399
+ "type": "SYMBOL",
400
+ "name": "identifier"
401
+ }
402
+ },
403
+ {
404
+ "type": "SYMBOL",
405
+ "name": "param_list"
406
+ },
407
+ {
408
+ "type": "CHOICE",
409
+ "members": [
410
+ {
411
+ "type": "SEQ",
412
+ "members": [
413
+ {
414
+ "type": "STRING",
415
+ "value": ":"
416
+ },
417
+ {
418
+ "type": "CHOICE",
419
+ "members": [
420
+ {
421
+ "type": "SYMBOL",
422
+ "name": "type_signature"
423
+ },
424
+ {
425
+ "type": "STRING",
426
+ "value": "noreturn"
427
+ }
428
+ ]
429
+ }
430
+ ]
431
+ },
432
+ {
433
+ "type": "BLANK"
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "type": "SYMBOL",
439
+ "name": "code_block"
440
+ }
441
+ ]
442
+ },
443
+ "param_list": {
444
+ "type": "SEQ",
445
+ "members": [
446
+ {
447
+ "type": "STRING",
448
+ "value": "("
449
+ },
450
+ {
451
+ "type": "CHOICE",
452
+ "members": [
453
+ {
454
+ "type": "SEQ",
455
+ "members": [
456
+ {
457
+ "type": "SYMBOL",
458
+ "name": "parameter"
459
+ },
460
+ {
461
+ "type": "CHOICE",
462
+ "members": [
463
+ {
464
+ "type": "SEQ",
465
+ "members": [
466
+ {
467
+ "type": "STRING",
468
+ "value": ","
469
+ },
470
+ {
471
+ "type": "SYMBOL",
472
+ "name": "parameter"
473
+ }
474
+ ]
475
+ },
476
+ {
477
+ "type": "BLANK"
478
+ }
479
+ ]
480
+ }
481
+ ]
482
+ },
483
+ {
484
+ "type": "BLANK"
485
+ }
486
+ ]
487
+ },
488
+ {
489
+ "type": "STRING",
490
+ "value": ")"
491
+ }
492
+ ]
493
+ },
494
+ "parameter": {
495
+ "type": "SEQ",
496
+ "members": [
497
+ {
498
+ "type": "CHOICE",
499
+ "members": [
500
+ {
501
+ "type": "STRING",
502
+ "value": "..."
503
+ },
504
+ {
505
+ "type": "BLANK"
506
+ }
507
+ ]
508
+ },
509
+ {
510
+ "type": "SYMBOL",
511
+ "name": "identifier"
512
+ },
513
+ {
514
+ "type": "STRING",
515
+ "value": ":"
516
+ },
517
+ {
518
+ "type": "SYMBOL",
519
+ "name": "type_signature"
520
+ }
521
+ ]
522
+ },
523
+ "code_block": {
524
+ "type": "SEQ",
525
+ "members": [
526
+ {
527
+ "type": "STRING",
528
+ "value": "{"
529
+ },
530
+ {
531
+ "type": "REPEAT",
532
+ "content": {
533
+ "type": "SYMBOL",
534
+ "name": "statement"
535
+ }
536
+ },
537
+ {
538
+ "type": "STRING",
539
+ "value": "}"
540
+ }
541
+ ]
542
+ },
543
+ "declaration": {
544
+ "type": "SEQ",
545
+ "members": [
546
+ {
547
+ "type": "CHOICE",
548
+ "members": [
549
+ {
550
+ "type": "SYMBOL",
551
+ "name": "let_declaration"
552
+ },
553
+ {
554
+ "type": "SYMBOL",
555
+ "name": "const_declaration"
556
+ }
557
+ ]
558
+ },
559
+ {
560
+ "type": "STRING",
561
+ "value": ";"
562
+ }
563
+ ]
564
+ },
565
+ "let_declaration": {
566
+ "type": "SEQ",
567
+ "members": [
568
+ {
569
+ "type": "STRING",
570
+ "value": "let"
571
+ },
572
+ {
573
+ "type": "FIELD",
574
+ "name": "name",
575
+ "content": {
576
+ "type": "SYMBOL",
577
+ "name": "identifier"
578
+ }
579
+ },
580
+ {
581
+ "type": "STRING",
582
+ "value": ":"
583
+ },
584
+ {
585
+ "type": "FIELD",
586
+ "name": "type",
587
+ "content": {
588
+ "type": "SYMBOL",
589
+ "name": "type_signature"
590
+ }
591
+ },
592
+ {
593
+ "type": "CHOICE",
594
+ "members": [
595
+ {
596
+ "type": "SEQ",
597
+ "members": [
598
+ {
599
+ "type": "STRING",
600
+ "value": "="
601
+ },
602
+ {
603
+ "type": "FIELD",
604
+ "name": "value",
605
+ "content": {
606
+ "type": "SYMBOL",
607
+ "name": "value"
608
+ }
609
+ }
610
+ ]
611
+ },
612
+ {
613
+ "type": "BLANK"
614
+ }
615
+ ]
616
+ }
617
+ ]
618
+ },
619
+ "const_declaration": {
620
+ "type": "SEQ",
621
+ "members": [
622
+ {
623
+ "type": "STRING",
624
+ "value": "const"
625
+ },
626
+ {
627
+ "type": "FIELD",
628
+ "name": "name",
629
+ "content": {
630
+ "type": "SYMBOL",
631
+ "name": "identifier"
632
+ }
633
+ },
634
+ {
635
+ "type": "STRING",
636
+ "value": ":"
637
+ },
638
+ {
639
+ "type": "FIELD",
640
+ "name": "type",
641
+ "content": {
642
+ "type": "SYMBOL",
643
+ "name": "type_signature"
644
+ }
645
+ },
646
+ {
647
+ "type": "STRING",
648
+ "value": "="
649
+ },
650
+ {
651
+ "type": "FIELD",
652
+ "name": "value",
653
+ "content": {
654
+ "type": "SYMBOL",
655
+ "name": "value"
656
+ }
657
+ }
658
+ ]
659
+ },
660
+ "statement": {
661
+ "type": "CHOICE",
662
+ "members": [
663
+ {
664
+ "type": "SYMBOL",
665
+ "name": "if_statement"
666
+ },
667
+ {
668
+ "type": "SYMBOL",
669
+ "name": "while_loop"
670
+ },
671
+ {
672
+ "type": "SYMBOL",
673
+ "name": "for_loop"
674
+ },
675
+ {
676
+ "type": "SYMBOL",
677
+ "name": "declaration"
678
+ },
679
+ {
680
+ "type": "SEQ",
681
+ "members": [
682
+ {
683
+ "type": "CHOICE",
684
+ "members": [
685
+ {
686
+ "type": "SYMBOL",
687
+ "name": "return_statement"
688
+ },
689
+ {
690
+ "type": "SYMBOL",
691
+ "name": "control_flow"
692
+ },
693
+ {
694
+ "type": "SYMBOL",
695
+ "name": "value"
696
+ }
697
+ ]
698
+ },
699
+ {
700
+ "type": "STRING",
701
+ "value": ";"
702
+ }
703
+ ]
704
+ }
705
+ ]
706
+ },
707
+ "return_statement": {
708
+ "type": "SEQ",
709
+ "members": [
710
+ {
711
+ "type": "STRING",
712
+ "value": "return"
713
+ },
714
+ {
715
+ "type": "CHOICE",
716
+ "members": [
717
+ {
718
+ "type": "SYMBOL",
719
+ "name": "value"
720
+ },
721
+ {
722
+ "type": "BLANK"
723
+ }
724
+ ]
725
+ }
726
+ ]
727
+ },
728
+ "control_flow": {
729
+ "type": "CHOICE",
730
+ "members": [
731
+ {
732
+ "type": "STRING",
733
+ "value": "break"
734
+ },
735
+ {
736
+ "type": "STRING",
737
+ "value": "continue"
738
+ }
739
+ ]
740
+ },
741
+ "routine": {
742
+ "type": "CHOICE",
743
+ "members": [
744
+ {
745
+ "type": "SYMBOL",
746
+ "name": "code_block"
747
+ },
748
+ {
749
+ "type": "SYMBOL",
750
+ "name": "statement"
751
+ }
752
+ ]
753
+ },
754
+ "if_statement": {
755
+ "type": "PREC_RIGHT",
756
+ "value": 1,
757
+ "content": {
758
+ "type": "SEQ",
759
+ "members": [
760
+ {
761
+ "type": "STRING",
762
+ "value": "if"
763
+ },
764
+ {
765
+ "type": "FIELD",
766
+ "name": "condition",
767
+ "content": {
768
+ "type": "SYMBOL",
769
+ "name": "parenthesis_enclosed"
770
+ }
771
+ },
772
+ {
773
+ "type": "SYMBOL",
774
+ "name": "routine"
775
+ },
776
+ {
777
+ "type": "CHOICE",
778
+ "members": [
779
+ {
780
+ "type": "SEQ",
781
+ "members": [
782
+ {
783
+ "type": "STRING",
784
+ "value": "else"
785
+ },
786
+ {
787
+ "type": "SYMBOL",
788
+ "name": "routine"
789
+ }
790
+ ]
791
+ },
792
+ {
793
+ "type": "BLANK"
794
+ }
795
+ ]
796
+ }
797
+ ]
798
+ }
799
+ },
800
+ "while_loop": {
801
+ "type": "SEQ",
802
+ "members": [
803
+ {
804
+ "type": "STRING",
805
+ "value": "while"
806
+ },
807
+ {
808
+ "type": "FIELD",
809
+ "name": "condition",
810
+ "content": {
811
+ "type": "SYMBOL",
812
+ "name": "parenthesis_enclosed"
813
+ }
814
+ },
815
+ {
816
+ "type": "SYMBOL",
817
+ "name": "routine"
818
+ }
819
+ ]
820
+ },
821
+ "for_loop": {
822
+ "type": "SEQ",
823
+ "members": [
824
+ {
825
+ "type": "STRING",
826
+ "value": "for"
827
+ },
828
+ {
829
+ "type": "SYMBOL",
830
+ "name": "for_loop_def"
831
+ },
832
+ {
833
+ "type": "SYMBOL",
834
+ "name": "routine"
835
+ }
836
+ ]
837
+ },
838
+ "for_loop_def": {
839
+ "type": "SEQ",
840
+ "members": [
841
+ {
842
+ "type": "STRING",
843
+ "value": "("
844
+ },
845
+ {
846
+ "type": "FIELD",
847
+ "name": "declaration",
848
+ "content": {
849
+ "type": "CHOICE",
850
+ "members": [
851
+ {
852
+ "type": "SYMBOL",
853
+ "name": "let_declaration"
854
+ },
855
+ {
856
+ "type": "BLANK"
857
+ }
858
+ ]
859
+ }
860
+ },
861
+ {
862
+ "type": "STRING",
863
+ "value": ";"
864
+ },
865
+ {
866
+ "type": "FIELD",
867
+ "name": "condition",
868
+ "content": {
869
+ "type": "CHOICE",
870
+ "members": [
871
+ {
872
+ "type": "SYMBOL",
873
+ "name": "value"
874
+ },
875
+ {
876
+ "type": "BLANK"
877
+ }
878
+ ]
879
+ }
880
+ },
881
+ {
882
+ "type": "STRING",
883
+ "value": ";"
884
+ },
885
+ {
886
+ "type": "FIELD",
887
+ "name": "mutation",
888
+ "content": {
889
+ "type": "CHOICE",
890
+ "members": [
891
+ {
892
+ "type": "SYMBOL",
893
+ "name": "value"
894
+ },
895
+ {
896
+ "type": "BLANK"
897
+ }
898
+ ]
899
+ }
900
+ },
901
+ {
902
+ "type": "STRING",
903
+ "value": ")"
904
+ }
905
+ ]
906
+ },
907
+ "value": {
908
+ "type": "PREC_LEFT",
909
+ "value": 1,
910
+ "content": {
911
+ "type": "SEQ",
912
+ "members": [
913
+ {
914
+ "type": "SYMBOL",
915
+ "name": "singleton"
916
+ },
917
+ {
918
+ "type": "REPEAT",
919
+ "content": {
920
+ "type": "SEQ",
921
+ "members": [
922
+ {
923
+ "type": "SYMBOL",
924
+ "name": "operator"
925
+ },
926
+ {
927
+ "type": "SYMBOL",
928
+ "name": "singleton"
929
+ }
930
+ ]
931
+ }
932
+ }
933
+ ]
934
+ }
935
+ },
936
+ "value_list": {
937
+ "type": "SEQ",
938
+ "members": [
939
+ {
940
+ "type": "SYMBOL",
941
+ "name": "value"
942
+ },
943
+ {
944
+ "type": "REPEAT",
945
+ "content": {
946
+ "type": "SEQ",
947
+ "members": [
948
+ {
949
+ "type": "STRING",
950
+ "value": ","
951
+ },
952
+ {
953
+ "type": "SYMBOL",
954
+ "name": "value"
955
+ }
956
+ ]
957
+ }
958
+ }
959
+ ]
960
+ },
961
+ "parenthesis_enclosed": {
962
+ "type": "SEQ",
963
+ "members": [
964
+ {
965
+ "type": "STRING",
966
+ "value": "("
967
+ },
968
+ {
969
+ "type": "SYMBOL",
970
+ "name": "value"
971
+ },
972
+ {
973
+ "type": "STRING",
974
+ "value": ")"
975
+ }
976
+ ]
977
+ },
978
+ "singleton": {
979
+ "type": "PREC_LEFT",
980
+ "value": 1,
981
+ "content": {
982
+ "type": "SEQ",
983
+ "members": [
984
+ {
985
+ "type": "CHOICE",
986
+ "members": [
987
+ {
988
+ "type": "SYMBOL",
989
+ "name": "type_cast"
990
+ },
991
+ {
992
+ "type": "BLANK"
993
+ }
994
+ ]
995
+ },
996
+ {
997
+ "type": "CHOICE",
998
+ "members": [
999
+ {
1000
+ "type": "CHOICE",
1001
+ "members": [
1002
+ {
1003
+ "type": "STRING",
1004
+ "value": "++"
1005
+ },
1006
+ {
1007
+ "type": "STRING",
1008
+ "value": "--"
1009
+ },
1010
+ {
1011
+ "type": "STRING",
1012
+ "value": "new"
1013
+ },
1014
+ {
1015
+ "type": "REPEAT1",
1016
+ "content": {
1017
+ "type": "CHOICE",
1018
+ "members": [
1019
+ {
1020
+ "type": "STRING",
1021
+ "value": "!"
1022
+ },
1023
+ {
1024
+ "type": "STRING",
1025
+ "value": "-"
1026
+ },
1027
+ {
1028
+ "type": "STRING",
1029
+ "value": "~"
1030
+ }
1031
+ ]
1032
+ }
1033
+ }
1034
+ ]
1035
+ },
1036
+ {
1037
+ "type": "BLANK"
1038
+ }
1039
+ ]
1040
+ },
1041
+ {
1042
+ "type": "CHOICE",
1043
+ "members": [
1044
+ {
1045
+ "type": "SYMBOL",
1046
+ "name": "ref_parenthesis_enclosed"
1047
+ },
1048
+ {
1049
+ "type": "SYMBOL",
1050
+ "name": "ref_primitive"
1051
+ },
1052
+ {
1053
+ "type": "SYMBOL",
1054
+ "name": "reference"
1055
+ }
1056
+ ]
1057
+ },
1058
+ {
1059
+ "type": "CHOICE",
1060
+ "members": [
1061
+ {
1062
+ "type": "CHOICE",
1063
+ "members": [
1064
+ {
1065
+ "type": "STRING",
1066
+ "value": "++"
1067
+ },
1068
+ {
1069
+ "type": "STRING",
1070
+ "value": "--"
1071
+ }
1072
+ ]
1073
+ },
1074
+ {
1075
+ "type": "BLANK"
1076
+ }
1077
+ ]
1078
+ }
1079
+ ]
1080
+ }
1081
+ },
1082
+ "reference": {
1083
+ "type": "PREC_LEFT",
1084
+ "value": 1,
1085
+ "content": {
1086
+ "type": "SEQ",
1087
+ "members": [
1088
+ {
1089
+ "type": "SYMBOL",
1090
+ "name": "identifier"
1091
+ },
1092
+ {
1093
+ "type": "REPEAT",
1094
+ "content": {
1095
+ "type": "CHOICE",
1096
+ "members": [
1097
+ {
1098
+ "type": "SYMBOL",
1099
+ "name": "accessor"
1100
+ },
1101
+ {
1102
+ "type": "SYMBOL",
1103
+ "name": "func_call"
1104
+ }
1105
+ ]
1106
+ }
1107
+ },
1108
+ {
1109
+ "type": "CHOICE",
1110
+ "members": [
1111
+ {
1112
+ "type": "SYMBOL",
1113
+ "name": "sub_reference"
1114
+ },
1115
+ {
1116
+ "type": "BLANK"
1117
+ }
1118
+ ]
1119
+ }
1120
+ ]
1121
+ }
1122
+ },
1123
+ "ref_parenthesis_enclosed": {
1124
+ "type": "PREC_LEFT",
1125
+ "value": 1,
1126
+ "content": {
1127
+ "type": "SEQ",
1128
+ "members": [
1129
+ {
1130
+ "type": "SYMBOL",
1131
+ "name": "parenthesis_enclosed"
1132
+ },
1133
+ {
1134
+ "type": "REPEAT",
1135
+ "content": {
1136
+ "type": "CHOICE",
1137
+ "members": [
1138
+ {
1139
+ "type": "SYMBOL",
1140
+ "name": "accessor"
1141
+ },
1142
+ {
1143
+ "type": "SYMBOL",
1144
+ "name": "func_call"
1145
+ }
1146
+ ]
1147
+ }
1148
+ },
1149
+ {
1150
+ "type": "CHOICE",
1151
+ "members": [
1152
+ {
1153
+ "type": "SYMBOL",
1154
+ "name": "sub_reference"
1155
+ },
1156
+ {
1157
+ "type": "BLANK"
1158
+ }
1159
+ ]
1160
+ }
1161
+ ]
1162
+ }
1163
+ },
1164
+ "ref_primitive": {
1165
+ "type": "PREC_LEFT",
1166
+ "value": 1,
1167
+ "content": {
1168
+ "type": "SEQ",
1169
+ "members": [
1170
+ {
1171
+ "type": "SYMBOL",
1172
+ "name": "primitive"
1173
+ },
1174
+ {
1175
+ "type": "REPEAT",
1176
+ "content": {
1177
+ "type": "CHOICE",
1178
+ "members": [
1179
+ {
1180
+ "type": "SYMBOL",
1181
+ "name": "accessor"
1182
+ },
1183
+ {
1184
+ "type": "SYMBOL",
1185
+ "name": "func_call"
1186
+ }
1187
+ ]
1188
+ }
1189
+ },
1190
+ {
1191
+ "type": "CHOICE",
1192
+ "members": [
1193
+ {
1194
+ "type": "SYMBOL",
1195
+ "name": "sub_reference"
1196
+ },
1197
+ {
1198
+ "type": "BLANK"
1199
+ }
1200
+ ]
1201
+ }
1202
+ ]
1203
+ }
1204
+ },
1205
+ "accessor": {
1206
+ "type": "SEQ",
1207
+ "members": [
1208
+ {
1209
+ "type": "STRING",
1210
+ "value": "["
1211
+ },
1212
+ {
1213
+ "type": "SYMBOL",
1214
+ "name": "value"
1215
+ },
1216
+ {
1217
+ "type": "STRING",
1218
+ "value": "]"
1219
+ }
1220
+ ]
1221
+ },
1222
+ "func_call": {
1223
+ "type": "SEQ",
1224
+ "members": [
1225
+ {
1226
+ "type": "STRING",
1227
+ "value": "("
1228
+ },
1229
+ {
1230
+ "type": "CHOICE",
1231
+ "members": [
1232
+ {
1233
+ "type": "SYMBOL",
1234
+ "name": "value_list"
1235
+ },
1236
+ {
1237
+ "type": "BLANK"
1238
+ }
1239
+ ]
1240
+ },
1241
+ {
1242
+ "type": "STRING",
1243
+ "value": ")"
1244
+ }
1245
+ ]
1246
+ },
1247
+ "sub_reference": {
1248
+ "type": "SEQ",
1249
+ "members": [
1250
+ {
1251
+ "type": "STRING",
1252
+ "value": "."
1253
+ },
1254
+ {
1255
+ "type": "SYMBOL",
1256
+ "name": "reference"
1257
+ }
1258
+ ]
1259
+ },
1260
+ "primitive": {
1261
+ "type": "CHOICE",
1262
+ "members": [
1263
+ {
1264
+ "type": "SYMBOL",
1265
+ "name": "struct_literal"
1266
+ },
1267
+ {
1268
+ "type": "SYMBOL",
1269
+ "name": "array_literal"
1270
+ },
1271
+ {
1272
+ "type": "SYMBOL",
1273
+ "name": "boolean_literal"
1274
+ },
1275
+ {
1276
+ "type": "SYMBOL",
1277
+ "name": "char_literal"
1278
+ },
1279
+ {
1280
+ "type": "SYMBOL",
1281
+ "name": "number_literal"
1282
+ },
1283
+ {
1284
+ "type": "SYMBOL",
1285
+ "name": "string_literal"
1286
+ },
1287
+ {
1288
+ "type": "SYMBOL",
1289
+ "name": "builtin_literal"
1290
+ }
1291
+ ]
1292
+ },
1293
+ "builtin_literal": {
1294
+ "type": "CHOICE",
1295
+ "members": [
1296
+ {
1297
+ "type": "STRING",
1298
+ "value": "this"
1299
+ },
1300
+ {
1301
+ "type": "STRING",
1302
+ "value": "super"
1303
+ },
1304
+ {
1305
+ "type": "STRING",
1306
+ "value": "null"
1307
+ }
1308
+ ]
1309
+ },
1310
+ "array_literal": {
1311
+ "type": "SEQ",
1312
+ "members": [
1313
+ {
1314
+ "type": "STRING",
1315
+ "value": "["
1316
+ },
1317
+ {
1318
+ "type": "CHOICE",
1319
+ "members": [
1320
+ {
1321
+ "type": "SYMBOL",
1322
+ "name": "value_list"
1323
+ },
1324
+ {
1325
+ "type": "BLANK"
1326
+ }
1327
+ ]
1328
+ },
1329
+ {
1330
+ "type": "STRING",
1331
+ "value": "]"
1332
+ }
1333
+ ]
1334
+ },
1335
+ "struct_literal": {
1336
+ "type": "SEQ",
1337
+ "members": [
1338
+ {
1339
+ "type": "STRING",
1340
+ "value": "{"
1341
+ },
1342
+ {
1343
+ "type": "CHOICE",
1344
+ "members": [
1345
+ {
1346
+ "type": "SYMBOL",
1347
+ "name": "property_list"
1348
+ },
1349
+ {
1350
+ "type": "BLANK"
1351
+ }
1352
+ ]
1353
+ },
1354
+ {
1355
+ "type": "STRING",
1356
+ "value": "}"
1357
+ }
1358
+ ]
1359
+ },
1360
+ "boolean_literal": {
1361
+ "type": "CHOICE",
1362
+ "members": [
1363
+ {
1364
+ "type": "STRING",
1365
+ "value": "true"
1366
+ },
1367
+ {
1368
+ "type": "STRING",
1369
+ "value": "false"
1370
+ }
1371
+ ]
1372
+ },
1373
+ "number_literal": {
1374
+ "type": "CHOICE",
1375
+ "members": [
1376
+ {
1377
+ "type": "SYMBOL",
1378
+ "name": "numeric"
1379
+ },
1380
+ {
1381
+ "type": "SYMBOL",
1382
+ "name": "decimal_number"
1383
+ },
1384
+ {
1385
+ "type": "SYMBOL",
1386
+ "name": "hex_number"
1387
+ },
1388
+ {
1389
+ "type": "SYMBOL",
1390
+ "name": "binary_number"
1391
+ }
1392
+ ]
1393
+ },
1394
+ "string_literal": {
1395
+ "type": "SEQ",
1396
+ "members": [
1397
+ {
1398
+ "type": "STRING",
1399
+ "value": "\""
1400
+ },
1401
+ {
1402
+ "type": "REPEAT",
1403
+ "content": {
1404
+ "type": "CHOICE",
1405
+ "members": [
1406
+ {
1407
+ "type": "PATTERN",
1408
+ "value": "[^\"\\\\\\r\\n]+"
1409
+ },
1410
+ {
1411
+ "type": "SYMBOL",
1412
+ "name": "escaped_character"
1413
+ }
1414
+ ]
1415
+ }
1416
+ },
1417
+ {
1418
+ "type": "STRING",
1419
+ "value": "\""
1420
+ }
1421
+ ]
1422
+ },
1423
+ "char_literal": {
1424
+ "type": "SEQ",
1425
+ "members": [
1426
+ {
1427
+ "type": "STRING",
1428
+ "value": "'"
1429
+ },
1430
+ {
1431
+ "type": "REPEAT",
1432
+ "content": {
1433
+ "type": "CHOICE",
1434
+ "members": [
1435
+ {
1436
+ "type": "PATTERN",
1437
+ "value": "[^'\\\\\\r\\n]+"
1438
+ },
1439
+ {
1440
+ "type": "SYMBOL",
1441
+ "name": "escaped_character"
1442
+ }
1443
+ ]
1444
+ }
1445
+ },
1446
+ {
1447
+ "type": "STRING",
1448
+ "value": "'"
1449
+ }
1450
+ ]
1451
+ },
1452
+ "escaped_character": {
1453
+ "type": "TOKEN",
1454
+ "content": {
1455
+ "type": "SEQ",
1456
+ "members": [
1457
+ {
1458
+ "type": "STRING",
1459
+ "value": "\\"
1460
+ },
1461
+ {
1462
+ "type": "CHOICE",
1463
+ "members": [
1464
+ {
1465
+ "type": "PATTERN",
1466
+ "value": "\\r?\\n"
1467
+ },
1468
+ {
1469
+ "type": "PATTERN",
1470
+ "value": "[^xuU0-7]"
1471
+ },
1472
+ {
1473
+ "type": "PATTERN",
1474
+ "value": "[0-7]{1,3}"
1475
+ },
1476
+ {
1477
+ "type": "PATTERN",
1478
+ "value": "x[0-9a-fA-F]{2}"
1479
+ },
1480
+ {
1481
+ "type": "PATTERN",
1482
+ "value": "u[0-9a-fA-F]{4}"
1483
+ },
1484
+ {
1485
+ "type": "PATTERN",
1486
+ "value": "U[0-9a-fA-F]{8}"
1487
+ }
1488
+ ]
1489
+ }
1490
+ ]
1491
+ }
1492
+ },
1493
+ "decimal_number": {
1494
+ "type": "PREC_LEFT",
1495
+ "value": 1,
1496
+ "content": {
1497
+ "type": "SEQ",
1498
+ "members": [
1499
+ {
1500
+ "type": "SYMBOL",
1501
+ "name": "numeric"
1502
+ },
1503
+ {
1504
+ "type": "STRING",
1505
+ "value": "."
1506
+ },
1507
+ {
1508
+ "type": "SYMBOL",
1509
+ "name": "numeric"
1510
+ }
1511
+ ]
1512
+ }
1513
+ },
1514
+ "hex_number": {
1515
+ "type": "PATTERN",
1516
+ "value": "0x[0-9a-fA-F]*"
1517
+ },
1518
+ "binary_number": {
1519
+ "type": "PATTERN",
1520
+ "value": "0b[01]*"
1521
+ },
1522
+ "type_signature": {
1523
+ "type": "CHOICE",
1524
+ "members": [
1525
+ {
1526
+ "type": "SEQ",
1527
+ "members": [
1528
+ {
1529
+ "type": "SYMBOL",
1530
+ "name": "identifier"
1531
+ },
1532
+ {
1533
+ "type": "CHOICE",
1534
+ "members": [
1535
+ {
1536
+ "type": "STRING",
1537
+ "value": "[]"
1538
+ },
1539
+ {
1540
+ "type": "BLANK"
1541
+ }
1542
+ ]
1543
+ }
1544
+ ]
1545
+ },
1546
+ {
1547
+ "type": "STRING",
1548
+ "value": "void"
1549
+ }
1550
+ ]
1551
+ },
1552
+ "type_cast": {
1553
+ "type": "SEQ",
1554
+ "members": [
1555
+ {
1556
+ "type": "STRING",
1557
+ "value": "<"
1558
+ },
1559
+ {
1560
+ "type": "SYMBOL",
1561
+ "name": "type_signature"
1562
+ },
1563
+ {
1564
+ "type": "STRING",
1565
+ "value": ">"
1566
+ }
1567
+ ]
1568
+ },
1569
+ "operator": {
1570
+ "type": "CHOICE",
1571
+ "members": [
1572
+ {
1573
+ "type": "SYMBOL",
1574
+ "name": "logical_op"
1575
+ },
1576
+ {
1577
+ "type": "SYMBOL",
1578
+ "name": "comparative_op"
1579
+ },
1580
+ {
1581
+ "type": "SYMBOL",
1582
+ "name": "arithmetic_op"
1583
+ },
1584
+ {
1585
+ "type": "SYMBOL",
1586
+ "name": "assignment_op"
1587
+ }
1588
+ ]
1589
+ },
1590
+ "logical_op": {
1591
+ "type": "CHOICE",
1592
+ "members": [
1593
+ {
1594
+ "type": "STRING",
1595
+ "value": "||"
1596
+ },
1597
+ {
1598
+ "type": "STRING",
1599
+ "value": "&&"
1600
+ }
1601
+ ]
1602
+ },
1603
+ "comparative_op": {
1604
+ "type": "CHOICE",
1605
+ "members": [
1606
+ {
1607
+ "type": "STRING",
1608
+ "value": "=="
1609
+ },
1610
+ {
1611
+ "type": "STRING",
1612
+ "value": "!="
1613
+ },
1614
+ {
1615
+ "type": "STRING",
1616
+ "value": ">="
1617
+ },
1618
+ {
1619
+ "type": "STRING",
1620
+ "value": "<="
1621
+ },
1622
+ {
1623
+ "type": "STRING",
1624
+ "value": ">"
1625
+ },
1626
+ {
1627
+ "type": "STRING",
1628
+ "value": "<"
1629
+ }
1630
+ ]
1631
+ },
1632
+ "arithmetic_op": {
1633
+ "type": "CHOICE",
1634
+ "members": [
1635
+ {
1636
+ "type": "STRING",
1637
+ "value": "+"
1638
+ },
1639
+ {
1640
+ "type": "STRING",
1641
+ "value": "-"
1642
+ },
1643
+ {
1644
+ "type": "STRING",
1645
+ "value": "*"
1646
+ },
1647
+ {
1648
+ "type": "STRING",
1649
+ "value": "/"
1650
+ },
1651
+ {
1652
+ "type": "STRING",
1653
+ "value": "%"
1654
+ },
1655
+ {
1656
+ "type": "STRING",
1657
+ "value": "&"
1658
+ },
1659
+ {
1660
+ "type": "STRING",
1661
+ "value": "|"
1662
+ },
1663
+ {
1664
+ "type": "STRING",
1665
+ "value": "^"
1666
+ },
1667
+ {
1668
+ "type": "STRING",
1669
+ "value": "<<"
1670
+ },
1671
+ {
1672
+ "type": "STRING",
1673
+ "value": ">>"
1674
+ }
1675
+ ]
1676
+ },
1677
+ "assignment_op": {
1678
+ "type": "CHOICE",
1679
+ "members": [
1680
+ {
1681
+ "type": "STRING",
1682
+ "value": "="
1683
+ },
1684
+ {
1685
+ "type": "STRING",
1686
+ "value": "+="
1687
+ },
1688
+ {
1689
+ "type": "STRING",
1690
+ "value": "-="
1691
+ },
1692
+ {
1693
+ "type": "STRING",
1694
+ "value": "*="
1695
+ },
1696
+ {
1697
+ "type": "STRING",
1698
+ "value": "/="
1699
+ },
1700
+ {
1701
+ "type": "STRING",
1702
+ "value": "%="
1703
+ },
1704
+ {
1705
+ "type": "STRING",
1706
+ "value": "&="
1707
+ },
1708
+ {
1709
+ "type": "STRING",
1710
+ "value": "|="
1711
+ },
1712
+ {
1713
+ "type": "STRING",
1714
+ "value": "^="
1715
+ }
1716
+ ]
1717
+ },
1718
+ "identifier": {
1719
+ "type": "PATTERN",
1720
+ "value": "([a-zA-Z_][0-9a-zA-Z_]*)"
1721
+ },
1722
+ "numeric": {
1723
+ "type": "PATTERN",
1724
+ "value": "([0-9][0-9_]*)"
1725
+ }
1726
+ },
1727
+ "extras": [
1728
+ {
1729
+ "type": "PATTERN",
1730
+ "value": "\\s"
1731
+ },
1732
+ {
1733
+ "type": "SYMBOL",
1734
+ "name": "comment"
1735
+ }
1736
+ ],
1737
+ "conflicts": [
1738
+ [
1739
+ "code_block",
1740
+ "struct_literal"
1741
+ ]
1742
+ ],
1743
+ "precedences": [],
1744
+ "externals": [],
1745
+ "inline": [],
1746
+ "supertypes": [],
1747
+ "reserved": {}
1748
+ }