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