@konomanoasa/tree-sitter-query 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,1265 @@
1
+ {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
3
+ "name": "query",
4
+ "rules": {
5
+ "query": {
6
+ "type": "REPEAT",
7
+ "content": {
8
+ "type": "SYMBOL",
9
+ "name": "_member"
10
+ }
11
+ },
12
+ "_member": {
13
+ "type": "CHOICE",
14
+ "members": [
15
+ {
16
+ "type": "SYMBOL",
17
+ "name": "_child_pattern"
18
+ },
19
+ {
20
+ "type": "SYMBOL",
21
+ "name": "_call"
22
+ }
23
+ ]
24
+ },
25
+ "_call_only_member": {
26
+ "type": "CHOICE",
27
+ "members": [
28
+ {
29
+ "type": "SYMBOL",
30
+ "name": "_call_only_child_pattern"
31
+ },
32
+ {
33
+ "type": "SYMBOL",
34
+ "name": "_call"
35
+ }
36
+ ]
37
+ },
38
+ "_call": {
39
+ "type": "CHOICE",
40
+ "members": [
41
+ {
42
+ "type": "SYMBOL",
43
+ "name": "predicate"
44
+ },
45
+ {
46
+ "type": "SYMBOL",
47
+ "name": "directive"
48
+ }
49
+ ]
50
+ },
51
+ "pattern": {
52
+ "type": "SEQ",
53
+ "members": [
54
+ {
55
+ "type": "FIELD",
56
+ "name": "body",
57
+ "content": {
58
+ "type": "CHOICE",
59
+ "members": [
60
+ {
61
+ "type": "SYMBOL",
62
+ "name": "_delimited"
63
+ },
64
+ {
65
+ "type": "SYMBOL",
66
+ "name": "string"
67
+ },
68
+ {
69
+ "type": "SYMBOL",
70
+ "name": "wildcard"
71
+ }
72
+ ]
73
+ }
74
+ },
75
+ {
76
+ "type": "REPEAT",
77
+ "content": {
78
+ "type": "CHOICE",
79
+ "members": [
80
+ {
81
+ "type": "FIELD",
82
+ "name": "capture",
83
+ "content": {
84
+ "type": "SYMBOL",
85
+ "name": "capture"
86
+ }
87
+ },
88
+ {
89
+ "type": "FIELD",
90
+ "name": "quantifier",
91
+ "content": {
92
+ "type": "SYMBOL",
93
+ "name": "quantifier"
94
+ }
95
+ }
96
+ ]
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ "_call_only_pattern": {
102
+ "type": "SEQ",
103
+ "members": [
104
+ {
105
+ "type": "FIELD",
106
+ "name": "body",
107
+ "content": {
108
+ "type": "CHOICE",
109
+ "members": [
110
+ {
111
+ "type": "ALIAS",
112
+ "content": {
113
+ "type": "SYMBOL",
114
+ "name": "_call_only_group"
115
+ },
116
+ "named": true,
117
+ "value": "group"
118
+ },
119
+ {
120
+ "type": "ALIAS",
121
+ "content": {
122
+ "type": "SYMBOL",
123
+ "name": "_call_only_alternation"
124
+ },
125
+ "named": true,
126
+ "value": "alternation"
127
+ }
128
+ ]
129
+ }
130
+ },
131
+ {
132
+ "type": "REPEAT",
133
+ "content": {
134
+ "type": "CHOICE",
135
+ "members": [
136
+ {
137
+ "type": "FIELD",
138
+ "name": "capture",
139
+ "content": {
140
+ "type": "SYMBOL",
141
+ "name": "capture"
142
+ }
143
+ },
144
+ {
145
+ "type": "FIELD",
146
+ "name": "quantifier",
147
+ "content": {
148
+ "type": "SYMBOL",
149
+ "name": "quantifier"
150
+ }
151
+ }
152
+ ]
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ "_group_pattern": {
158
+ "type": "SEQ",
159
+ "members": [
160
+ {
161
+ "type": "FIELD",
162
+ "name": "body",
163
+ "content": {
164
+ "type": "CHOICE",
165
+ "members": [
166
+ {
167
+ "type": "SYMBOL",
168
+ "name": "_delimited"
169
+ },
170
+ {
171
+ "type": "SYMBOL",
172
+ "name": "string"
173
+ }
174
+ ]
175
+ }
176
+ },
177
+ {
178
+ "type": "REPEAT",
179
+ "content": {
180
+ "type": "CHOICE",
181
+ "members": [
182
+ {
183
+ "type": "FIELD",
184
+ "name": "capture",
185
+ "content": {
186
+ "type": "SYMBOL",
187
+ "name": "capture"
188
+ }
189
+ },
190
+ {
191
+ "type": "FIELD",
192
+ "name": "quantifier",
193
+ "content": {
194
+ "type": "SYMBOL",
195
+ "name": "quantifier"
196
+ }
197
+ }
198
+ ]
199
+ }
200
+ }
201
+ ]
202
+ },
203
+ "_delimited": {
204
+ "type": "CHOICE",
205
+ "members": [
206
+ {
207
+ "type": "SYMBOL",
208
+ "name": "node_pattern"
209
+ },
210
+ {
211
+ "type": "SYMBOL",
212
+ "name": "group"
213
+ },
214
+ {
215
+ "type": "SYMBOL",
216
+ "name": "alternation"
217
+ }
218
+ ]
219
+ },
220
+ "node_pattern": {
221
+ "type": "SEQ",
222
+ "members": [
223
+ {
224
+ "type": "STRING",
225
+ "value": "("
226
+ },
227
+ {
228
+ "type": "CHOICE",
229
+ "members": [
230
+ {
231
+ "type": "FIELD",
232
+ "name": "node",
233
+ "content": {
234
+ "type": "ALIAS",
235
+ "content": {
236
+ "type": "SYMBOL",
237
+ "name": "_untyped_missing_node"
238
+ },
239
+ "named": true,
240
+ "value": "missing_node"
241
+ }
242
+ },
243
+ {
244
+ "type": "SEQ",
245
+ "members": [
246
+ {
247
+ "type": "FIELD",
248
+ "name": "node",
249
+ "content": {
250
+ "type": "CHOICE",
251
+ "members": [
252
+ {
253
+ "type": "SYMBOL",
254
+ "name": "identifier"
255
+ },
256
+ {
257
+ "type": "SYMBOL",
258
+ "name": "wildcard"
259
+ },
260
+ {
261
+ "type": "SYMBOL",
262
+ "name": "supertype"
263
+ },
264
+ {
265
+ "type": "SYMBOL",
266
+ "name": "missing_node"
267
+ }
268
+ ]
269
+ }
270
+ },
271
+ {
272
+ "type": "REPEAT",
273
+ "content": {
274
+ "type": "SYMBOL",
275
+ "name": "_node_annotation"
276
+ }
277
+ },
278
+ {
279
+ "type": "CHOICE",
280
+ "members": [
281
+ {
282
+ "type": "SEQ",
283
+ "members": [
284
+ {
285
+ "type": "SEQ",
286
+ "members": [
287
+ {
288
+ "type": "CHOICE",
289
+ "members": [
290
+ {
291
+ "type": "SYMBOL",
292
+ "name": "anchor"
293
+ },
294
+ {
295
+ "type": "BLANK"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "type": "SYMBOL",
301
+ "name": "_matching_child_pattern"
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ "type": "REPEAT",
307
+ "content": {
308
+ "type": "CHOICE",
309
+ "members": [
310
+ {
311
+ "type": "SYMBOL",
312
+ "name": "_node_annotation"
313
+ },
314
+ {
315
+ "type": "SEQ",
316
+ "members": [
317
+ {
318
+ "type": "CHOICE",
319
+ "members": [
320
+ {
321
+ "type": "SYMBOL",
322
+ "name": "anchor"
323
+ },
324
+ {
325
+ "type": "BLANK"
326
+ }
327
+ ]
328
+ },
329
+ {
330
+ "type": "SYMBOL",
331
+ "name": "_matching_child_pattern"
332
+ }
333
+ ]
334
+ }
335
+ ]
336
+ }
337
+ },
338
+ {
339
+ "type": "CHOICE",
340
+ "members": [
341
+ {
342
+ "type": "SYMBOL",
343
+ "name": "anchor"
344
+ },
345
+ {
346
+ "type": "BLANK"
347
+ }
348
+ ]
349
+ }
350
+ ]
351
+ },
352
+ {
353
+ "type": "BLANK"
354
+ }
355
+ ]
356
+ }
357
+ ]
358
+ }
359
+ ]
360
+ },
361
+ {
362
+ "type": "STRING",
363
+ "value": ")"
364
+ }
365
+ ]
366
+ },
367
+ "_child_pattern": {
368
+ "type": "CHOICE",
369
+ "members": [
370
+ {
371
+ "type": "SYMBOL",
372
+ "name": "_matching_child_pattern"
373
+ },
374
+ {
375
+ "type": "SYMBOL",
376
+ "name": "_call_only_child_pattern"
377
+ }
378
+ ]
379
+ },
380
+ "_matching_child_pattern": {
381
+ "type": "CHOICE",
382
+ "members": [
383
+ {
384
+ "type": "SYMBOL",
385
+ "name": "pattern"
386
+ },
387
+ {
388
+ "type": "SYMBOL",
389
+ "name": "field_constraint"
390
+ }
391
+ ]
392
+ },
393
+ "_call_only_child_pattern": {
394
+ "type": "CHOICE",
395
+ "members": [
396
+ {
397
+ "type": "ALIAS",
398
+ "content": {
399
+ "type": "SYMBOL",
400
+ "name": "_call_only_pattern"
401
+ },
402
+ "named": true,
403
+ "value": "pattern"
404
+ },
405
+ {
406
+ "type": "ALIAS",
407
+ "content": {
408
+ "type": "SYMBOL",
409
+ "name": "_call_only_field_constraint"
410
+ },
411
+ "named": true,
412
+ "value": "field_constraint"
413
+ }
414
+ ]
415
+ },
416
+ "_node_annotation": {
417
+ "type": "CHOICE",
418
+ "members": [
419
+ {
420
+ "type": "SEQ",
421
+ "members": [
422
+ {
423
+ "type": "CHOICE",
424
+ "members": [
425
+ {
426
+ "type": "SYMBOL",
427
+ "name": "anchor"
428
+ },
429
+ {
430
+ "type": "BLANK"
431
+ }
432
+ ]
433
+ },
434
+ {
435
+ "type": "SYMBOL",
436
+ "name": "_call_only_member"
437
+ }
438
+ ]
439
+ },
440
+ {
441
+ "type": "SYMBOL",
442
+ "name": "negated_field"
443
+ }
444
+ ]
445
+ },
446
+ "field_constraint": {
447
+ "type": "SEQ",
448
+ "members": [
449
+ {
450
+ "type": "FIELD",
451
+ "name": "name",
452
+ "content": {
453
+ "type": "CHOICE",
454
+ "members": [
455
+ {
456
+ "type": "ALIAS",
457
+ "content": {
458
+ "type": "SYMBOL",
459
+ "name": "_field_identifier"
460
+ },
461
+ "named": true,
462
+ "value": "identifier"
463
+ },
464
+ {
465
+ "type": "ALIAS",
466
+ "content": {
467
+ "type": "STRING",
468
+ "value": "MISSING"
469
+ },
470
+ "named": true,
471
+ "value": "identifier"
472
+ }
473
+ ]
474
+ }
475
+ },
476
+ {
477
+ "type": "STRING",
478
+ "value": ":"
479
+ },
480
+ {
481
+ "type": "FIELD",
482
+ "name": "pattern",
483
+ "content": {
484
+ "type": "SYMBOL",
485
+ "name": "_matching_child_pattern"
486
+ }
487
+ }
488
+ ]
489
+ },
490
+ "_call_only_field_constraint": {
491
+ "type": "SEQ",
492
+ "members": [
493
+ {
494
+ "type": "FIELD",
495
+ "name": "name",
496
+ "content": {
497
+ "type": "CHOICE",
498
+ "members": [
499
+ {
500
+ "type": "ALIAS",
501
+ "content": {
502
+ "type": "SYMBOL",
503
+ "name": "_field_identifier"
504
+ },
505
+ "named": true,
506
+ "value": "identifier"
507
+ },
508
+ {
509
+ "type": "ALIAS",
510
+ "content": {
511
+ "type": "STRING",
512
+ "value": "MISSING"
513
+ },
514
+ "named": true,
515
+ "value": "identifier"
516
+ }
517
+ ]
518
+ }
519
+ },
520
+ {
521
+ "type": "STRING",
522
+ "value": ":"
523
+ },
524
+ {
525
+ "type": "FIELD",
526
+ "name": "pattern",
527
+ "content": {
528
+ "type": "SYMBOL",
529
+ "name": "_call_only_child_pattern"
530
+ }
531
+ }
532
+ ]
533
+ },
534
+ "negated_field": {
535
+ "type": "SEQ",
536
+ "members": [
537
+ {
538
+ "type": "STRING",
539
+ "value": "!"
540
+ },
541
+ {
542
+ "type": "FIELD",
543
+ "name": "name",
544
+ "content": {
545
+ "type": "SYMBOL",
546
+ "name": "_name"
547
+ }
548
+ }
549
+ ]
550
+ },
551
+ "supertype": {
552
+ "type": "SEQ",
553
+ "members": [
554
+ {
555
+ "type": "FIELD",
556
+ "name": "supertype",
557
+ "content": {
558
+ "type": "CHOICE",
559
+ "members": [
560
+ {
561
+ "type": "SYMBOL",
562
+ "name": "identifier"
563
+ },
564
+ {
565
+ "type": "ALIAS",
566
+ "content": {
567
+ "type": "SYMBOL",
568
+ "name": "wildcard"
569
+ },
570
+ "named": true,
571
+ "value": "identifier"
572
+ }
573
+ ]
574
+ }
575
+ },
576
+ {
577
+ "type": "IMMEDIATE_TOKEN",
578
+ "content": {
579
+ "type": "STRING",
580
+ "value": "/"
581
+ }
582
+ },
583
+ {
584
+ "type": "FIELD",
585
+ "name": "subtype",
586
+ "content": {
587
+ "type": "CHOICE",
588
+ "members": [
589
+ {
590
+ "type": "ALIAS",
591
+ "content": {
592
+ "type": "SYMBOL",
593
+ "name": "_immediate_identifier"
594
+ },
595
+ "named": true,
596
+ "value": "identifier"
597
+ },
598
+ {
599
+ "type": "ALIAS",
600
+ "content": {
601
+ "type": "SYMBOL",
602
+ "name": "_immediate_string"
603
+ },
604
+ "named": true,
605
+ "value": "string"
606
+ }
607
+ ]
608
+ }
609
+ }
610
+ ]
611
+ },
612
+ "_untyped_missing_node": {
613
+ "type": "STRING",
614
+ "value": "MISSING"
615
+ },
616
+ "missing_node": {
617
+ "type": "SEQ",
618
+ "members": [
619
+ {
620
+ "type": "STRING",
621
+ "value": "MISSING"
622
+ },
623
+ {
624
+ "type": "FIELD",
625
+ "name": "type",
626
+ "content": {
627
+ "type": "CHOICE",
628
+ "members": [
629
+ {
630
+ "type": "SYMBOL",
631
+ "name": "_name"
632
+ },
633
+ {
634
+ "type": "SYMBOL",
635
+ "name": "string"
636
+ },
637
+ {
638
+ "type": "ALIAS",
639
+ "content": {
640
+ "type": "SYMBOL",
641
+ "name": "_missing_supertype"
642
+ },
643
+ "named": true,
644
+ "value": "supertype"
645
+ }
646
+ ]
647
+ }
648
+ }
649
+ ]
650
+ },
651
+ "_missing_supertype": {
652
+ "type": "SEQ",
653
+ "members": [
654
+ {
655
+ "type": "FIELD",
656
+ "name": "supertype",
657
+ "content": {
658
+ "type": "SYMBOL",
659
+ "name": "_name"
660
+ }
661
+ },
662
+ {
663
+ "type": "IMMEDIATE_TOKEN",
664
+ "content": {
665
+ "type": "STRING",
666
+ "value": "/"
667
+ }
668
+ },
669
+ {
670
+ "type": "FIELD",
671
+ "name": "subtype",
672
+ "content": {
673
+ "type": "CHOICE",
674
+ "members": [
675
+ {
676
+ "type": "ALIAS",
677
+ "content": {
678
+ "type": "SYMBOL",
679
+ "name": "_immediate_identifier"
680
+ },
681
+ "named": true,
682
+ "value": "identifier"
683
+ },
684
+ {
685
+ "type": "ALIAS",
686
+ "content": {
687
+ "type": "SYMBOL",
688
+ "name": "_immediate_string"
689
+ },
690
+ "named": true,
691
+ "value": "string"
692
+ }
693
+ ]
694
+ }
695
+ }
696
+ ]
697
+ },
698
+ "group": {
699
+ "type": "SEQ",
700
+ "members": [
701
+ {
702
+ "type": "STRING",
703
+ "value": "("
704
+ },
705
+ {
706
+ "type": "CHOICE",
707
+ "members": [
708
+ {
709
+ "type": "ALIAS",
710
+ "content": {
711
+ "type": "SYMBOL",
712
+ "name": "_group_pattern"
713
+ },
714
+ "named": true,
715
+ "value": "pattern"
716
+ },
717
+ {
718
+ "type": "SEQ",
719
+ "members": [
720
+ {
721
+ "type": "SYMBOL",
722
+ "name": "_call_only_group_start"
723
+ },
724
+ {
725
+ "type": "REPEAT",
726
+ "content": {
727
+ "type": "SEQ",
728
+ "members": [
729
+ {
730
+ "type": "CHOICE",
731
+ "members": [
732
+ {
733
+ "type": "SYMBOL",
734
+ "name": "anchor"
735
+ },
736
+ {
737
+ "type": "BLANK"
738
+ }
739
+ ]
740
+ },
741
+ {
742
+ "type": "SYMBOL",
743
+ "name": "_call_only_member"
744
+ }
745
+ ]
746
+ }
747
+ },
748
+ {
749
+ "type": "SEQ",
750
+ "members": [
751
+ {
752
+ "type": "CHOICE",
753
+ "members": [
754
+ {
755
+ "type": "SYMBOL",
756
+ "name": "anchor"
757
+ },
758
+ {
759
+ "type": "BLANK"
760
+ }
761
+ ]
762
+ },
763
+ {
764
+ "type": "SYMBOL",
765
+ "name": "_matching_child_pattern"
766
+ }
767
+ ]
768
+ }
769
+ ]
770
+ }
771
+ ]
772
+ },
773
+ {
774
+ "type": "REPEAT",
775
+ "content": {
776
+ "type": "SEQ",
777
+ "members": [
778
+ {
779
+ "type": "CHOICE",
780
+ "members": [
781
+ {
782
+ "type": "SYMBOL",
783
+ "name": "anchor"
784
+ },
785
+ {
786
+ "type": "BLANK"
787
+ }
788
+ ]
789
+ },
790
+ {
791
+ "type": "SYMBOL",
792
+ "name": "_member"
793
+ }
794
+ ]
795
+ }
796
+ },
797
+ {
798
+ "type": "STRING",
799
+ "value": ")"
800
+ }
801
+ ]
802
+ },
803
+ "_call_only_group": {
804
+ "type": "SEQ",
805
+ "members": [
806
+ {
807
+ "type": "STRING",
808
+ "value": "("
809
+ },
810
+ {
811
+ "type": "SYMBOL",
812
+ "name": "_call_only_group_start"
813
+ },
814
+ {
815
+ "type": "REPEAT",
816
+ "content": {
817
+ "type": "SEQ",
818
+ "members": [
819
+ {
820
+ "type": "CHOICE",
821
+ "members": [
822
+ {
823
+ "type": "SYMBOL",
824
+ "name": "anchor"
825
+ },
826
+ {
827
+ "type": "BLANK"
828
+ }
829
+ ]
830
+ },
831
+ {
832
+ "type": "SYMBOL",
833
+ "name": "_call_only_member"
834
+ }
835
+ ]
836
+ }
837
+ },
838
+ {
839
+ "type": "STRING",
840
+ "value": ")"
841
+ }
842
+ ]
843
+ },
844
+ "_call_only_group_start": {
845
+ "type": "CHOICE",
846
+ "members": [
847
+ {
848
+ "type": "SYMBOL",
849
+ "name": "_call"
850
+ },
851
+ {
852
+ "type": "ALIAS",
853
+ "content": {
854
+ "type": "SYMBOL",
855
+ "name": "_call_only_pattern"
856
+ },
857
+ "named": true,
858
+ "value": "pattern"
859
+ }
860
+ ]
861
+ },
862
+ "alternation": {
863
+ "type": "SEQ",
864
+ "members": [
865
+ {
866
+ "type": "STRING",
867
+ "value": "["
868
+ },
869
+ {
870
+ "type": "REPEAT",
871
+ "content": {
872
+ "type": "SYMBOL",
873
+ "name": "_call_only_member"
874
+ }
875
+ },
876
+ {
877
+ "type": "SYMBOL",
878
+ "name": "_matching_child_pattern"
879
+ },
880
+ {
881
+ "type": "REPEAT",
882
+ "content": {
883
+ "type": "SYMBOL",
884
+ "name": "_member"
885
+ }
886
+ },
887
+ {
888
+ "type": "STRING",
889
+ "value": "]"
890
+ }
891
+ ]
892
+ },
893
+ "_call_only_alternation": {
894
+ "type": "SEQ",
895
+ "members": [
896
+ {
897
+ "type": "STRING",
898
+ "value": "["
899
+ },
900
+ {
901
+ "type": "REPEAT1",
902
+ "content": {
903
+ "type": "SYMBOL",
904
+ "name": "_call_only_member"
905
+ }
906
+ },
907
+ {
908
+ "type": "STRING",
909
+ "value": "]"
910
+ }
911
+ ]
912
+ },
913
+ "quantifier": {
914
+ "type": "TOKEN",
915
+ "content": {
916
+ "type": "CHOICE",
917
+ "members": [
918
+ {
919
+ "type": "STRING",
920
+ "value": "+"
921
+ },
922
+ {
923
+ "type": "STRING",
924
+ "value": "*"
925
+ },
926
+ {
927
+ "type": "STRING",
928
+ "value": "?"
929
+ }
930
+ ]
931
+ }
932
+ },
933
+ "anchor": {
934
+ "type": "STRING",
935
+ "value": "."
936
+ },
937
+ "capture": {
938
+ "type": "SEQ",
939
+ "members": [
940
+ {
941
+ "type": "STRING",
942
+ "value": "@"
943
+ },
944
+ {
945
+ "type": "FIELD",
946
+ "name": "name",
947
+ "content": {
948
+ "type": "ALIAS",
949
+ "content": {
950
+ "type": "SYMBOL",
951
+ "name": "_immediate_identifier"
952
+ },
953
+ "named": true,
954
+ "value": "identifier"
955
+ }
956
+ }
957
+ ]
958
+ },
959
+ "predicate": {
960
+ "type": "SEQ",
961
+ "members": [
962
+ {
963
+ "type": "STRING",
964
+ "value": "("
965
+ },
966
+ {
967
+ "type": "STRING",
968
+ "value": "#"
969
+ },
970
+ {
971
+ "type": "FIELD",
972
+ "name": "name",
973
+ "content": {
974
+ "type": "ALIAS",
975
+ "content": {
976
+ "type": "SYMBOL",
977
+ "name": "_immediate_identifier"
978
+ },
979
+ "named": true,
980
+ "value": "identifier"
981
+ }
982
+ },
983
+ {
984
+ "type": "IMMEDIATE_TOKEN",
985
+ "content": {
986
+ "type": "STRING",
987
+ "value": "?"
988
+ }
989
+ },
990
+ {
991
+ "type": "REPEAT",
992
+ "content": {
993
+ "type": "FIELD",
994
+ "name": "argument",
995
+ "content": {
996
+ "type": "CHOICE",
997
+ "members": [
998
+ {
999
+ "type": "SYMBOL",
1000
+ "name": "capture"
1001
+ },
1002
+ {
1003
+ "type": "SYMBOL",
1004
+ "name": "string"
1005
+ },
1006
+ {
1007
+ "type": "SYMBOL",
1008
+ "name": "_name"
1009
+ }
1010
+ ]
1011
+ }
1012
+ }
1013
+ },
1014
+ {
1015
+ "type": "STRING",
1016
+ "value": ")"
1017
+ }
1018
+ ]
1019
+ },
1020
+ "directive": {
1021
+ "type": "SEQ",
1022
+ "members": [
1023
+ {
1024
+ "type": "STRING",
1025
+ "value": "("
1026
+ },
1027
+ {
1028
+ "type": "STRING",
1029
+ "value": "#"
1030
+ },
1031
+ {
1032
+ "type": "FIELD",
1033
+ "name": "name",
1034
+ "content": {
1035
+ "type": "ALIAS",
1036
+ "content": {
1037
+ "type": "SYMBOL",
1038
+ "name": "_immediate_identifier"
1039
+ },
1040
+ "named": true,
1041
+ "value": "identifier"
1042
+ }
1043
+ },
1044
+ {
1045
+ "type": "IMMEDIATE_TOKEN",
1046
+ "content": {
1047
+ "type": "STRING",
1048
+ "value": "!"
1049
+ }
1050
+ },
1051
+ {
1052
+ "type": "REPEAT",
1053
+ "content": {
1054
+ "type": "FIELD",
1055
+ "name": "argument",
1056
+ "content": {
1057
+ "type": "CHOICE",
1058
+ "members": [
1059
+ {
1060
+ "type": "SYMBOL",
1061
+ "name": "capture"
1062
+ },
1063
+ {
1064
+ "type": "SYMBOL",
1065
+ "name": "string"
1066
+ },
1067
+ {
1068
+ "type": "SYMBOL",
1069
+ "name": "_name"
1070
+ }
1071
+ ]
1072
+ }
1073
+ }
1074
+ },
1075
+ {
1076
+ "type": "STRING",
1077
+ "value": ")"
1078
+ }
1079
+ ]
1080
+ },
1081
+ "identifier": {
1082
+ "type": "PATTERN",
1083
+ "value": "[A-Za-z0-9_-][A-Za-z0-9_.-]*"
1084
+ },
1085
+ "_field_identifier": {
1086
+ "type": "PATTERN",
1087
+ "value": "[A-Za-z0-9-][A-Za-z0-9_.-]*"
1088
+ },
1089
+ "_immediate_identifier": {
1090
+ "type": "IMMEDIATE_TOKEN",
1091
+ "content": {
1092
+ "type": "PATTERN",
1093
+ "value": "[A-Za-z0-9_-][A-Za-z0-9_.-]*"
1094
+ }
1095
+ },
1096
+ "_name": {
1097
+ "type": "CHOICE",
1098
+ "members": [
1099
+ {
1100
+ "type": "SYMBOL",
1101
+ "name": "identifier"
1102
+ },
1103
+ {
1104
+ "type": "ALIAS",
1105
+ "content": {
1106
+ "type": "SYMBOL",
1107
+ "name": "wildcard"
1108
+ },
1109
+ "named": true,
1110
+ "value": "identifier"
1111
+ },
1112
+ {
1113
+ "type": "ALIAS",
1114
+ "content": {
1115
+ "type": "STRING",
1116
+ "value": "MISSING"
1117
+ },
1118
+ "named": true,
1119
+ "value": "identifier"
1120
+ }
1121
+ ]
1122
+ },
1123
+ "wildcard": {
1124
+ "type": "STRING",
1125
+ "value": "_"
1126
+ },
1127
+ "string": {
1128
+ "type": "SEQ",
1129
+ "members": [
1130
+ {
1131
+ "type": "STRING",
1132
+ "value": "\""
1133
+ },
1134
+ {
1135
+ "type": "SYMBOL",
1136
+ "name": "_string_tail"
1137
+ }
1138
+ ]
1139
+ },
1140
+ "_immediate_string": {
1141
+ "type": "SEQ",
1142
+ "members": [
1143
+ {
1144
+ "type": "IMMEDIATE_TOKEN",
1145
+ "content": {
1146
+ "type": "STRING",
1147
+ "value": "\""
1148
+ }
1149
+ },
1150
+ {
1151
+ "type": "SYMBOL",
1152
+ "name": "_string_tail"
1153
+ }
1154
+ ]
1155
+ },
1156
+ "_string_tail": {
1157
+ "type": "SEQ",
1158
+ "members": [
1159
+ {
1160
+ "type": "REPEAT",
1161
+ "content": {
1162
+ "type": "CHOICE",
1163
+ "members": [
1164
+ {
1165
+ "type": "SYMBOL",
1166
+ "name": "string_content"
1167
+ },
1168
+ {
1169
+ "type": "SYMBOL",
1170
+ "name": "escape_sequence"
1171
+ }
1172
+ ]
1173
+ }
1174
+ },
1175
+ {
1176
+ "type": "IMMEDIATE_TOKEN",
1177
+ "content": {
1178
+ "type": "STRING",
1179
+ "value": "\""
1180
+ }
1181
+ }
1182
+ ]
1183
+ },
1184
+ "string_content": {
1185
+ "type": "IMMEDIATE_TOKEN",
1186
+ "content": {
1187
+ "type": "PREC",
1188
+ "value": 1,
1189
+ "content": {
1190
+ "type": "REPEAT1",
1191
+ "content": {
1192
+ "type": "CHOICE",
1193
+ "members": [
1194
+ {
1195
+ "type": "PATTERN",
1196
+ "value": "[^\"\\\\\\n]+"
1197
+ },
1198
+ {
1199
+ "type": "SEQ",
1200
+ "members": [
1201
+ {
1202
+ "type": "STRING",
1203
+ "value": "\u0000"
1204
+ },
1205
+ {
1206
+ "type": "CHOICE",
1207
+ "members": [
1208
+ {
1209
+ "type": "PATTERN",
1210
+ "value": "[^\"\\\\\\n]+"
1211
+ },
1212
+ {
1213
+ "type": "BLANK"
1214
+ }
1215
+ ]
1216
+ }
1217
+ ]
1218
+ }
1219
+ ]
1220
+ }
1221
+ }
1222
+ }
1223
+ },
1224
+ "escape_sequence": {
1225
+ "type": "IMMEDIATE_TOKEN",
1226
+ "content": {
1227
+ "type": "CHOICE",
1228
+ "members": [
1229
+ {
1230
+ "type": "PATTERN",
1231
+ "value": "\\\\(.|\\n)"
1232
+ },
1233
+ {
1234
+ "type": "PREC",
1235
+ "value": 1,
1236
+ "content": {
1237
+ "type": "STRING",
1238
+ "value": "\\\u0000"
1239
+ }
1240
+ }
1241
+ ]
1242
+ }
1243
+ },
1244
+ "comment": {
1245
+ "type": "PATTERN",
1246
+ "value": ";[^\\r\\n]*(\\r+[^\\r\\n]+)*"
1247
+ }
1248
+ },
1249
+ "extras": [
1250
+ {
1251
+ "type": "PATTERN",
1252
+ "value": "[ \\t\\r\\n\\v\\f]"
1253
+ },
1254
+ {
1255
+ "type": "SYMBOL",
1256
+ "name": "comment"
1257
+ }
1258
+ ],
1259
+ "conflicts": [],
1260
+ "precedences": [],
1261
+ "externals": [],
1262
+ "inline": [],
1263
+ "supertypes": [],
1264
+ "reserved": {}
1265
+ }