cddl 0.16.0 → 0.18.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 (44) hide show
  1. package/LICENSE +1 -1
  2. package/package.json +5 -1
  3. package/.release-it.ts +0 -10
  4. package/docs/README.md +0 -47
  5. package/docs/arrays.md +0 -356
  6. package/docs/ast-structure.md +0 -166
  7. package/docs/basic-types.md +0 -243
  8. package/docs/cddl-cheatsheet.md +0 -231
  9. package/docs/comments.md +0 -307
  10. package/docs/groups.md +0 -351
  11. package/docs/operators.md +0 -466
  12. package/docs/properties.md +0 -334
  13. package/docs/ranges.md +0 -339
  14. package/docs/references.md +0 -340
  15. package/docs/variables.md +0 -335
  16. package/src/ast.ts +0 -180
  17. package/src/cli/commands/repl.ts +0 -33
  18. package/src/cli/commands/validate.ts +0 -44
  19. package/src/cli/constants.ts +0 -1
  20. package/src/cli/index.ts +0 -18
  21. package/src/constants.ts +0 -16
  22. package/src/index.ts +0 -12
  23. package/src/lexer.ts +0 -238
  24. package/src/parser.ts +0 -993
  25. package/src/tokens.ts +0 -50
  26. package/src/utils.ts +0 -96
  27. package/tests/__snapshots__/complex_types.test.ts.snap +0 -80
  28. package/tests/__snapshots__/examples.test.ts.snap +0 -1077
  29. package/tests/__snapshots__/group-choices.test.ts.snap +0 -403
  30. package/tests/__snapshots__/parser.test.ts.snap +0 -3045
  31. package/tests/__snapshots__/webdriver-local.test.ts.snap +0 -11192
  32. package/tests/__snapshots__/webdriver-remote.test.ts.snap +0 -16350
  33. package/tests/commands/repl.test.ts +0 -52
  34. package/tests/commands/validate.test.ts +0 -66
  35. package/tests/complex_types.test.ts +0 -18
  36. package/tests/examples.test.ts +0 -25
  37. package/tests/group-choices.test.ts +0 -132
  38. package/tests/lexer.test.ts +0 -63
  39. package/tests/module.test.ts +0 -21
  40. package/tests/parser.test.ts +0 -63
  41. package/tests/utils.test.ts +0 -211
  42. package/tests/webdriver-local.test.ts +0 -15
  43. package/tests/webdriver-remote.test.ts +0 -15
  44. package/tsconfig.json +0 -11
@@ -1,1077 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`examples > common > can parse group choice 1`] = `
4
- [
5
- {
6
- "Comments": [],
7
- "IsChoiceAddition": false,
8
- "Name": "Extensible",
9
- "Properties": [
10
- {
11
- "Comments": [],
12
- "HasCut": false,
13
- "Name": "text",
14
- "Occurrence": {
15
- "m": Infinity,
16
- "n": 0,
17
- },
18
- "Type": [
19
- "any",
20
- ],
21
- },
22
- ],
23
- "Type": "group",
24
- },
25
- {
26
- "Comments": [],
27
- "IsChoiceAddition": false,
28
- "Name": "ProxyConfiguration",
29
- "Properties": [
30
- [
31
- {
32
- "Comments": [],
33
- "HasCut": false,
34
- "Name": "",
35
- "Occurrence": {
36
- "m": 1,
37
- "n": 1,
38
- },
39
- "Type": {
40
- "Type": "group",
41
- "Unwrapped": false,
42
- "Value": "AutodetectProxyConfiguration",
43
- },
44
- },
45
- {
46
- "Comments": [],
47
- "HasCut": false,
48
- "Name": "",
49
- "Occurrence": {
50
- "m": 1,
51
- "n": 1,
52
- },
53
- "Type": {
54
- "Type": "group",
55
- "Unwrapped": false,
56
- "Value": "DirectProxyConfiguration",
57
- },
58
- },
59
- ],
60
- {
61
- "Comments": [],
62
- "HasCut": false,
63
- "Name": "",
64
- "Occurrence": {
65
- "m": 1,
66
- "n": 1,
67
- },
68
- "Type": [
69
- {
70
- "Type": "group",
71
- "Unwrapped": false,
72
- "Value": "ManualProxyConfiguration",
73
- },
74
- ],
75
- },
76
- ],
77
- "Type": "group",
78
- },
79
- {
80
- "Comments": [],
81
- "IsChoiceAddition": false,
82
- "Name": "AutodetectProxyConfiguration",
83
- "Properties": [
84
- {
85
- "Comments": [],
86
- "HasCut": true,
87
- "Name": "proxyType",
88
- "Occurrence": {
89
- "m": 1,
90
- "n": 1,
91
- },
92
- "Type": [
93
- {
94
- "Type": "literal",
95
- "Unwrapped": false,
96
- "Value": "autodetect",
97
- },
98
- ],
99
- },
100
- {
101
- "Comments": [],
102
- "HasCut": false,
103
- "Name": "",
104
- "Occurrence": {
105
- "m": 1,
106
- "n": 1,
107
- },
108
- "Type": [
109
- {
110
- "Type": "group",
111
- "Unwrapped": false,
112
- "Value": "Extensible",
113
- },
114
- ],
115
- },
116
- ],
117
- "Type": "group",
118
- },
119
- {
120
- "Comments": [],
121
- "IsChoiceAddition": false,
122
- "Name": "DirectProxyConfiguration",
123
- "Properties": [
124
- {
125
- "Comments": [],
126
- "HasCut": true,
127
- "Name": "proxyType",
128
- "Occurrence": {
129
- "m": 1,
130
- "n": 1,
131
- },
132
- "Type": [
133
- {
134
- "Type": "literal",
135
- "Unwrapped": false,
136
- "Value": "direct",
137
- },
138
- ],
139
- },
140
- {
141
- "Comments": [],
142
- "HasCut": false,
143
- "Name": "",
144
- "Occurrence": {
145
- "m": 1,
146
- "n": 1,
147
- },
148
- "Type": [
149
- {
150
- "Type": "group",
151
- "Unwrapped": false,
152
- "Value": "Extensible",
153
- },
154
- ],
155
- },
156
- ],
157
- "Type": "group",
158
- },
159
- {
160
- "Comments": [
161
- {
162
- "Content": "1. Simple Group Choice",
163
- "Leading": false,
164
- "Type": "comment",
165
- },
166
- ],
167
- "IsChoiceAddition": false,
168
- "Name": "ManualProxyConfiguration",
169
- "Properties": [
170
- {
171
- "Comments": [],
172
- "HasCut": true,
173
- "Name": "proxyType",
174
- "Occurrence": {
175
- "m": 1,
176
- "n": 1,
177
- },
178
- "Type": [
179
- {
180
- "Type": "literal",
181
- "Unwrapped": false,
182
- "Value": "manual",
183
- },
184
- ],
185
- },
186
- {
187
- "Comments": [],
188
- "HasCut": false,
189
- "Name": "",
190
- "Occurrence": {
191
- "m": 1,
192
- "n": 1,
193
- },
194
- "Type": [
195
- {
196
- "Type": "group",
197
- "Unwrapped": false,
198
- "Value": "Extensible",
199
- },
200
- ],
201
- },
202
- ],
203
- "Type": "group",
204
- },
205
- {
206
- "Comments": [
207
- {
208
- "Content": "2. Nested Group Choice",
209
- "Leading": false,
210
- "Type": "comment",
211
- },
212
- ],
213
- "IsChoiceAddition": false,
214
- "Name": "SimpleGroupChoice",
215
- "Properties": [
216
- [
217
- {
218
- "Comments": [],
219
- "HasCut": false,
220
- "Name": "",
221
- "Occurrence": {
222
- "m": 1,
223
- "n": 1,
224
- },
225
- "Type": {
226
- "Type": "group",
227
- "Unwrapped": false,
228
- "Value": "int",
229
- },
230
- },
231
- ],
232
- {
233
- "Comments": [],
234
- "HasCut": false,
235
- "Name": "",
236
- "Occurrence": {
237
- "m": 1,
238
- "n": 1,
239
- },
240
- "Type": "tstr",
241
- },
242
- ],
243
- "Type": "group",
244
- },
245
- {
246
- "Comments": [
247
- {
248
- "Content": "3. Group Choice with Multiple Items (Sequence) - interpreted as tuple",
249
- "Leading": false,
250
- "Type": "comment",
251
- },
252
- ],
253
- "IsChoiceAddition": false,
254
- "Name": "NestedGroupChoice",
255
- "Properties": [
256
- {
257
- "Comments": [],
258
- "HasCut": false,
259
- "Name": "",
260
- "Occurrence": {
261
- "m": 1,
262
- "n": 1,
263
- },
264
- "Type": {
265
- "Comments": [],
266
- "IsChoiceAddition": false,
267
- "Name": "",
268
- "Properties": [
269
- [
270
- {
271
- "Comments": [],
272
- "HasCut": false,
273
- "Name": "",
274
- "Occurrence": {
275
- "m": 1,
276
- "n": 1,
277
- },
278
- "Type": {
279
- "Type": "group",
280
- "Unwrapped": false,
281
- "Value": "int",
282
- },
283
- },
284
- ],
285
- {
286
- "Comments": [],
287
- "HasCut": false,
288
- "Name": "",
289
- "Occurrence": {
290
- "m": 1,
291
- "n": 1,
292
- },
293
- "Type": "tstr",
294
- },
295
- ],
296
- "Type": "group",
297
- },
298
- },
299
- ],
300
- "Type": "group",
301
- },
302
- {
303
- "Comments": [
304
- {
305
- "Content": "4. Map Group Choice - interpreted as map (interface) union",
306
- "Leading": false,
307
- "Type": "comment",
308
- },
309
- ],
310
- "IsChoiceAddition": false,
311
- "Name": "SequenceGroupChoice",
312
- "Properties": [
313
- [
314
- {
315
- "Comments": [],
316
- "HasCut": false,
317
- "Name": "",
318
- "Occurrence": {
319
- "m": 1,
320
- "n": 1,
321
- },
322
- "Type": {
323
- "Comments": [],
324
- "IsChoiceAddition": false,
325
- "Name": "",
326
- "Properties": [
327
- {
328
- "Comments": [],
329
- "HasCut": false,
330
- "Name": "",
331
- "Occurrence": {
332
- "m": 1,
333
- "n": 1,
334
- },
335
- "Type": "int",
336
- },
337
- {
338
- "Comments": [],
339
- "HasCut": false,
340
- "Name": "",
341
- "Occurrence": {
342
- "m": 1,
343
- "n": 1,
344
- },
345
- "Type": "text",
346
- },
347
- ],
348
- "Type": "group",
349
- },
350
- },
351
- ],
352
- {
353
- "Comments": [],
354
- "HasCut": false,
355
- "Name": "",
356
- "Occurrence": {
357
- "m": 1,
358
- "n": 1,
359
- },
360
- "Type": "float",
361
- },
362
- ],
363
- "Type": "group",
364
- },
365
- {
366
- "Comments": [
367
- {
368
- "Content": "5. Type Choice inside Group - should be value union",
369
- "Leading": false,
370
- "Type": "comment",
371
- },
372
- ],
373
- "IsChoiceAddition": false,
374
- "Name": "MapGroupChoice",
375
- "Properties": [
376
- [
377
- {
378
- "Comments": [],
379
- "HasCut": false,
380
- "Name": "a",
381
- "Occurrence": {
382
- "m": 1,
383
- "n": 1,
384
- },
385
- "Type": [
386
- {
387
- "Type": "literal",
388
- "Unwrapped": false,
389
- "Value": 1,
390
- },
391
- ],
392
- },
393
- {
394
- "Comments": [],
395
- "HasCut": false,
396
- "Name": "b",
397
- "Occurrence": {
398
- "m": 1,
399
- "n": 1,
400
- },
401
- "Type": [
402
- {
403
- "Type": "literal",
404
- "Unwrapped": false,
405
- "Value": 2,
406
- },
407
- ],
408
- },
409
- ],
410
- ],
411
- "Type": "group",
412
- },
413
- {
414
- "Comments": [
415
- {
416
- "Content": "6. Array with Group Choice - should be array of union?",
417
- "Leading": false,
418
- "Type": "comment",
419
- },
420
- ],
421
- "IsChoiceAddition": false,
422
- "Name": "TypeChoiceInsideGroup",
423
- "PropertyType": [
424
- "int",
425
- "tstr",
426
- ],
427
- "Type": "variable",
428
- },
429
- {
430
- "Comments": [
431
- {
432
- "Content": "7. Map with nested group (bare and parens) - should be object like",
433
- "Leading": false,
434
- "Type": "comment",
435
- },
436
- ],
437
- "Name": "ArrayGroupChoice",
438
- "Type": "array",
439
- "Values": [
440
- {
441
- "Comments": [],
442
- "HasCut": false,
443
- "Name": "",
444
- "Occurrence": {
445
- "m": 1,
446
- "n": 1,
447
- },
448
- "Type": {
449
- "Comments": [],
450
- "IsChoiceAddition": false,
451
- "Name": "",
452
- "Properties": [
453
- [
454
- {
455
- "Comments": [],
456
- "HasCut": false,
457
- "Name": "",
458
- "Occurrence": {
459
- "m": 1,
460
- "n": 1,
461
- },
462
- "Type": {
463
- "Type": "group",
464
- "Unwrapped": false,
465
- "Value": "int",
466
- },
467
- },
468
- ],
469
- {
470
- "Comments": [],
471
- "HasCut": false,
472
- "Name": "",
473
- "Occurrence": {
474
- "m": 1,
475
- "n": 1,
476
- },
477
- "Type": "tstr",
478
- },
479
- ],
480
- "Type": "group",
481
- },
482
- },
483
- ],
484
- },
485
- {
486
- "Comments": [],
487
- "IsChoiceAddition": false,
488
- "Name": "MapWithBareGroup",
489
- "Properties": [
490
- {
491
- "Comments": [],
492
- "HasCut": false,
493
- "Name": "",
494
- "Occurrence": {
495
- "m": 1,
496
- "n": 1,
497
- },
498
- "Type": "int",
499
- },
500
- ],
501
- "Type": "group",
502
- },
503
- {
504
- "Comments": [
505
- {
506
- "Content": "8. Group wrapped in map with multiple properties",
507
- "Leading": false,
508
- "Type": "comment",
509
- },
510
- ],
511
- "IsChoiceAddition": false,
512
- "Name": "MapWithParensGroup",
513
- "Properties": [
514
- {
515
- "Comments": [],
516
- "HasCut": false,
517
- "Name": "",
518
- "Occurrence": {
519
- "m": 1,
520
- "n": 1,
521
- },
522
- "Type": "int",
523
- },
524
- ],
525
- "Type": "group",
526
- },
527
- {
528
- "Comments": [
529
- {
530
- "Content": "9. Property type choice without operators",
531
- "Leading": false,
532
- "Type": "comment",
533
- },
534
- ],
535
- "IsChoiceAddition": false,
536
- "Name": "MapGroupWrap",
537
- "Properties": [
538
- {
539
- "Comments": [],
540
- "HasCut": false,
541
- "Name": "",
542
- "Occurrence": {
543
- "m": 1,
544
- "n": 1,
545
- },
546
- "Type": {
547
- "Comments": [],
548
- "IsChoiceAddition": false,
549
- "Name": "",
550
- "Properties": [
551
- {
552
- "Comments": [],
553
- "HasCut": true,
554
- "Name": "a",
555
- "Occurrence": {
556
- "m": 1,
557
- "n": 1,
558
- },
559
- "Type": [
560
- "int",
561
- ],
562
- },
563
- {
564
- "Comments": [],
565
- "HasCut": true,
566
- "Name": "b",
567
- "Occurrence": {
568
- "m": 1,
569
- "n": 1,
570
- },
571
- "Type": [
572
- "tstr",
573
- ],
574
- },
575
- ],
576
- "Type": "group",
577
- },
578
- },
579
- ],
580
- "Type": "group",
581
- },
582
- {
583
- "Comments": [
584
- {
585
- "Content": "10. Nested choice with group reference",
586
- "Leading": false,
587
- "Type": "comment",
588
- },
589
- ],
590
- "IsChoiceAddition": false,
591
- "Name": "PropChoiceNoOp",
592
- "Properties": [
593
- {
594
- "Comments": [],
595
- "HasCut": true,
596
- "Name": "a",
597
- "Occurrence": {
598
- "m": 1,
599
- "n": 1,
600
- },
601
- "Type": [
602
- "int",
603
- "float",
604
- ],
605
- },
606
- {
607
- "Comments": [],
608
- "HasCut": true,
609
- "Name": "b",
610
- "Occurrence": {
611
- "m": 1,
612
- "n": 1,
613
- },
614
- "Type": [
615
- "tstr",
616
- ],
617
- },
618
- ],
619
- "Type": "group",
620
- },
621
- {
622
- "Comments": [
623
- {
624
- "Content": "11. Complex type (group) followed by property without comma",
625
- "Leading": false,
626
- "Type": "comment",
627
- },
628
- ],
629
- "IsChoiceAddition": false,
630
- "Name": "NestedChoiceRef",
631
- "Properties": [
632
- [
633
- {
634
- "Comments": [],
635
- "HasCut": false,
636
- "Name": "",
637
- "Occurrence": {
638
- "m": 1,
639
- "n": 1,
640
- },
641
- "Type": [
642
- "int",
643
- "float",
644
- ],
645
- },
646
- ],
647
- {
648
- "Comments": [],
649
- "HasCut": false,
650
- "Name": "",
651
- "Occurrence": {
652
- "m": 1,
653
- "n": 1,
654
- },
655
- "Type": "tstr",
656
- },
657
- ],
658
- "Type": "group",
659
- },
660
- {
661
- "Comments": [
662
- {
663
- "Content": "12. Multi-item group choice (verifies isChoice persistence)",
664
- "Leading": false,
665
- "Type": "comment",
666
- },
667
- ],
668
- "IsChoiceAddition": false,
669
- "Name": "MapNoComma",
670
- "Properties": [
671
- {
672
- "Comments": [],
673
- "HasCut": true,
674
- "Name": "a",
675
- "Occurrence": {
676
- "m": 1,
677
- "n": 1,
678
- },
679
- "Type": [
680
- "int",
681
- ],
682
- },
683
- {
684
- "Comments": [],
685
- "HasCut": true,
686
- "Name": "b",
687
- "Occurrence": {
688
- "m": 1,
689
- "n": 1,
690
- },
691
- "Type": [
692
- "tstr",
693
- ],
694
- },
695
- ],
696
- "Type": "group",
697
- },
698
- {
699
- "Comments": [],
700
- "IsChoiceAddition": false,
701
- "Name": "GroupChoiceMulti",
702
- "Properties": [
703
- [
704
- {
705
- "Comments": [],
706
- "HasCut": false,
707
- "Name": "",
708
- "Occurrence": {
709
- "m": 1,
710
- "n": 1,
711
- },
712
- "Type": {
713
- "Comments": [],
714
- "IsChoiceAddition": false,
715
- "Name": "",
716
- "Properties": [
717
- {
718
- "Comments": [],
719
- "HasCut": true,
720
- "Name": "a",
721
- "Occurrence": {
722
- "m": 1,
723
- "n": 1,
724
- },
725
- "Type": [
726
- "int",
727
- ],
728
- },
729
- ],
730
- "Type": "group",
731
- },
732
- },
733
- {
734
- "Comments": [],
735
- "HasCut": false,
736
- "Name": "",
737
- "Occurrence": {
738
- "m": 1,
739
- "n": 1,
740
- },
741
- "Type": {
742
- "Comments": [],
743
- "IsChoiceAddition": false,
744
- "Name": "",
745
- "Properties": [
746
- {
747
- "Comments": [],
748
- "HasCut": true,
749
- "Name": "b",
750
- "Occurrence": {
751
- "m": 1,
752
- "n": 1,
753
- },
754
- "Type": [
755
- "tstr",
756
- ],
757
- },
758
- ],
759
- "Type": "group",
760
- },
761
- },
762
- {
763
- "Comments": [],
764
- "HasCut": false,
765
- "Name": "",
766
- "Occurrence": {
767
- "m": 1,
768
- "n": 1,
769
- },
770
- "Type": {
771
- "Comments": [],
772
- "IsChoiceAddition": false,
773
- "Name": "",
774
- "Properties": [
775
- {
776
- "Comments": [],
777
- "HasCut": true,
778
- "Name": "c",
779
- "Occurrence": {
780
- "m": 1,
781
- "n": 1,
782
- },
783
- "Type": [
784
- "float",
785
- ],
786
- },
787
- ],
788
- "Type": "group",
789
- },
790
- },
791
- ],
792
- ],
793
- "Type": "group",
794
- },
795
- ]
796
- `;
797
-
798
- exports[`examples > common > can parse literals 1`] = `
799
- [
800
- {
801
- "Comments": [],
802
- "IsChoiceAddition": false,
803
- "Name": "LiteralTest",
804
- "Properties": [
805
- {
806
- "Comments": [],
807
- "HasCut": true,
808
- "Name": "big_int",
809
- "Occurrence": {
810
- "m": 1,
811
- "n": 1,
812
- },
813
- "Type": [
814
- {
815
- "Type": "literal",
816
- "Unwrapped": false,
817
- "Value": 9007199254740996,
818
- },
819
- ],
820
- },
821
- {
822
- "Comments": [],
823
- "HasCut": true,
824
- "Name": "null_val",
825
- "Occurrence": {
826
- "m": 1,
827
- "n": 1,
828
- },
829
- "Type": [
830
- "null",
831
- ],
832
- },
833
- ],
834
- "Type": "group",
835
- },
836
- ]
837
- `;
838
-
839
- exports[`examples > common > can parse mixin union 1`] = `
840
- [
841
- {
842
- "Comments": [],
843
- "IsChoiceAddition": false,
844
- "Name": "Mixins",
845
- "Properties": [
846
- {
847
- "Comments": [],
848
- "HasCut": false,
849
- "Name": "",
850
- "Occurrence": {
851
- "m": 1,
852
- "n": 1,
853
- },
854
- "Type": [
855
- {
856
- "Type": "group",
857
- "Unwrapped": false,
858
- "Value": "MixinA",
859
- },
860
- ],
861
- },
862
- {
863
- "Comments": [],
864
- "HasCut": false,
865
- "Name": "",
866
- "Occurrence": {
867
- "m": 1,
868
- "n": 1,
869
- },
870
- "Type": [
871
- {
872
- "Type": "group",
873
- "Unwrapped": false,
874
- "Value": "MixinB",
875
- },
876
- ],
877
- },
878
- ],
879
- "Type": "group",
880
- },
881
- {
882
- "Comments": [],
883
- "IsChoiceAddition": false,
884
- "Name": "MixinA",
885
- "Properties": [
886
- {
887
- "Comments": [],
888
- "HasCut": true,
889
- "Name": "a",
890
- "Occurrence": {
891
- "m": 1,
892
- "n": 1,
893
- },
894
- "Type": [
895
- "int",
896
- ],
897
- },
898
- ],
899
- "Type": "group",
900
- },
901
- {
902
- "Comments": [],
903
- "IsChoiceAddition": false,
904
- "Name": "MixinB",
905
- "Properties": [
906
- {
907
- "Comments": [],
908
- "HasCut": true,
909
- "Name": "b",
910
- "Occurrence": {
911
- "m": 1,
912
- "n": 1,
913
- },
914
- "Type": [
915
- "tstr",
916
- ],
917
- },
918
- ],
919
- "Type": "group",
920
- },
921
- {
922
- "Comments": [],
923
- "IsChoiceAddition": false,
924
- "Name": "UnionMixin",
925
- "PropertyType": [
926
- {
927
- "Type": "group",
928
- "Unwrapped": false,
929
- "Value": "MixinA",
930
- },
931
- {
932
- "Type": "group",
933
- "Unwrapped": false,
934
- "Value": "MixinB",
935
- },
936
- ],
937
- "Type": "variable",
938
- },
939
- {
940
- "Comments": [],
941
- "IsChoiceAddition": false,
942
- "Name": "ComplexMixins",
943
- "Properties": [
944
- {
945
- "Comments": [],
946
- "HasCut": false,
947
- "Name": "",
948
- "Occurrence": {
949
- "m": 1,
950
- "n": 1,
951
- },
952
- "Type": [
953
- {
954
- "Type": "group",
955
- "Unwrapped": false,
956
- "Value": "MixinA",
957
- },
958
- {
959
- "Type": "group",
960
- "Unwrapped": false,
961
- "Value": "MixinB",
962
- },
963
- ],
964
- },
965
- {
966
- "Comments": [],
967
- "HasCut": true,
968
- "Name": "c",
969
- "Occurrence": {
970
- "m": 1,
971
- "n": 1,
972
- },
973
- "Type": [
974
- "bool",
975
- ],
976
- },
977
- ],
978
- "Type": "group",
979
- },
980
- ]
981
- `;
982
-
983
- exports[`examples > common > can parse named group choice 1`] = `
984
- [
985
- {
986
- "Comments": [
987
- {
988
- "Content": "This tests that named group references inside a choice (//) are correctly",
989
- "Leading": false,
990
- "Type": "comment",
991
- },
992
- {
993
- "Content": "transformed into a union of type references.",
994
- "Leading": false,
995
- "Type": "comment",
996
- },
997
- ],
998
- "IsChoiceAddition": false,
999
- "Name": "Choice",
1000
- "Properties": [
1001
- [
1002
- {
1003
- "Comments": [],
1004
- "HasCut": false,
1005
- "Name": "",
1006
- "Occurrence": {
1007
- "m": 1,
1008
- "n": 1,
1009
- },
1010
- "Type": {
1011
- "Type": "group",
1012
- "Unwrapped": false,
1013
- "Value": "OptionA",
1014
- },
1015
- },
1016
- ],
1017
- {
1018
- "Comments": [],
1019
- "HasCut": false,
1020
- "Name": "",
1021
- "Occurrence": {
1022
- "m": 1,
1023
- "n": 1,
1024
- },
1025
- "Type": [
1026
- {
1027
- "Type": "group",
1028
- "Unwrapped": false,
1029
- "Value": "OptionB",
1030
- },
1031
- ],
1032
- },
1033
- ],
1034
- "Type": "group",
1035
- },
1036
- {
1037
- "Comments": [],
1038
- "IsChoiceAddition": false,
1039
- "Name": "OptionA",
1040
- "Properties": [
1041
- {
1042
- "Comments": [],
1043
- "HasCut": true,
1044
- "Name": "a",
1045
- "Occurrence": {
1046
- "m": 1,
1047
- "n": 1,
1048
- },
1049
- "Type": [
1050
- "int",
1051
- ],
1052
- },
1053
- ],
1054
- "Type": "group",
1055
- },
1056
- {
1057
- "Comments": [],
1058
- "IsChoiceAddition": false,
1059
- "Name": "OptionB",
1060
- "Properties": [
1061
- {
1062
- "Comments": [],
1063
- "HasCut": true,
1064
- "Name": "b",
1065
- "Occurrence": {
1066
- "m": 1,
1067
- "n": 1,
1068
- },
1069
- "Type": [
1070
- "tstr",
1071
- ],
1072
- },
1073
- ],
1074
- "Type": "group",
1075
- },
1076
- ]
1077
- `;