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