edn-abnf 0.5.24 → 0.5.26
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.
- checksums.yaml +4 -4
- data/edn-abnf.gemspec +1 -1
- data/lib/cbor-diagnostic-app/hgrammar.rb +434 -75
- data/lib/parser/edngrammar.rb +1292 -357
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94b5a98d03ecc669c5c2796c357e4bdc36649a0bf399a975ebf24500c680728b
|
|
4
|
+
data.tar.gz: f1d596f67cc9a24ab4e2afb2cc54fcb9b06b349ce3faa9dbdffdafe8a0d722fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c1730392c1de9a9cf9c5e389bc03a86390504e281cf3b5b1a96d30edefd4665d2e2b89c6a8c09bb1cf29d3d9f7a307a56eec13f15d757176c5a8a258e88c744
|
|
7
|
+
data.tar.gz: 91578b63cb5e7e2ff5b3f30de39167c654b9f67461546f24766e1e868c2db3e003e0385855196a8055c1b262d3b1c7ce10e9e67b4261f7112655c6466d5c0f63
|
data/edn-abnf.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "edn-abnf"
|
|
3
|
-
s.version = "0.5.
|
|
3
|
+
s.version = "0.5.26"
|
|
4
4
|
s.summary = "CBOR Extended Diagnostic Notation (EDN) implemented in ABNF"
|
|
5
5
|
s.description = %q{edn-abnf implements converters and miscellaneous tools for CBOR EDN's ABNF}
|
|
6
6
|
s.author = "Carsten Bormann"
|
|
@@ -48,6 +48,10 @@ module HGRAMMAR
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
module AppStringH4
|
|
51
|
+
def eol_comment
|
|
52
|
+
elements[0]
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
end
|
|
52
56
|
|
|
53
57
|
module AppStringH5
|
|
@@ -166,13 +170,7 @@ module HGRAMMAR
|
|
|
166
170
|
s0 << r2
|
|
167
171
|
if r2
|
|
168
172
|
i13, s13 = index, []
|
|
169
|
-
|
|
170
|
-
r14 = true
|
|
171
|
-
@index += match_len
|
|
172
|
-
else
|
|
173
|
-
terminal_parse_failure('"#"')
|
|
174
|
-
r14 = nil
|
|
175
|
-
end
|
|
173
|
+
r14 = _nt_eol_comment
|
|
176
174
|
s13 << r14
|
|
177
175
|
if r14
|
|
178
176
|
s15, i15 = [], index
|
|
@@ -450,6 +448,50 @@ module HGRAMMAR
|
|
|
450
448
|
r0
|
|
451
449
|
end
|
|
452
450
|
|
|
451
|
+
def _nt_NONASCII
|
|
452
|
+
start_index = index
|
|
453
|
+
if node_cache[:NONASCII].has_key?(index)
|
|
454
|
+
cached = node_cache[:NONASCII][index]
|
|
455
|
+
if cached
|
|
456
|
+
node_cache[:NONASCII][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
457
|
+
@index = cached.interval.end
|
|
458
|
+
end
|
|
459
|
+
return cached
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
i0 = index
|
|
463
|
+
if has_terminal?(@regexps[gr = '\A[-]'] ||= Regexp.new(gr), :regexp, index)
|
|
464
|
+
r1 = true
|
|
465
|
+
@index += 1
|
|
466
|
+
else
|
|
467
|
+
terminal_parse_failure('[-]')
|
|
468
|
+
r1 = nil
|
|
469
|
+
end
|
|
470
|
+
if r1
|
|
471
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
472
|
+
r0 = r1
|
|
473
|
+
else
|
|
474
|
+
if has_terminal?(@regexps[gr = '\A[-]'] ||= Regexp.new(gr), :regexp, index)
|
|
475
|
+
r2 = true
|
|
476
|
+
@index += 1
|
|
477
|
+
else
|
|
478
|
+
terminal_parse_failure('[-]')
|
|
479
|
+
r2 = nil
|
|
480
|
+
end
|
|
481
|
+
if r2
|
|
482
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
483
|
+
r0 = r2
|
|
484
|
+
else
|
|
485
|
+
@index = i0
|
|
486
|
+
r0 = nil
|
|
487
|
+
end
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
node_cache[:NONASCII][start_index] = r0
|
|
491
|
+
|
|
492
|
+
r0
|
|
493
|
+
end
|
|
494
|
+
|
|
453
495
|
def _nt_non_slash
|
|
454
496
|
start_index = index
|
|
455
497
|
if node_cache[:non_slash].has_key?(index)
|
|
@@ -478,19 +520,25 @@ module HGRAMMAR
|
|
|
478
520
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
479
521
|
r0 = r2
|
|
480
522
|
else
|
|
481
|
-
if has_terminal?(@regexps[gr = '\A[0
|
|
523
|
+
if has_terminal?(@regexps[gr = '\A[0-]'] ||= Regexp.new(gr), :regexp, index)
|
|
482
524
|
r3 = true
|
|
483
525
|
@index += 1
|
|
484
526
|
else
|
|
485
|
-
terminal_parse_failure('[0
|
|
527
|
+
terminal_parse_failure('[0-]')
|
|
486
528
|
r3 = nil
|
|
487
529
|
end
|
|
488
530
|
if r3
|
|
489
531
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
490
532
|
r0 = r3
|
|
491
533
|
else
|
|
492
|
-
|
|
493
|
-
|
|
534
|
+
r4 = _nt_NONASCII
|
|
535
|
+
if r4
|
|
536
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
537
|
+
r0 = r4
|
|
538
|
+
else
|
|
539
|
+
@index = i0
|
|
540
|
+
r0 = nil
|
|
541
|
+
end
|
|
494
542
|
end
|
|
495
543
|
end
|
|
496
544
|
end
|
|
@@ -500,6 +548,193 @@ module HGRAMMAR
|
|
|
500
548
|
r0
|
|
501
549
|
end
|
|
502
550
|
|
|
551
|
+
def _nt_non_slash_star
|
|
552
|
+
start_index = index
|
|
553
|
+
if node_cache[:non_slash_star].has_key?(index)
|
|
554
|
+
cached = node_cache[:non_slash_star][index]
|
|
555
|
+
if cached
|
|
556
|
+
node_cache[:non_slash_star][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
557
|
+
@index = cached.interval.end
|
|
558
|
+
end
|
|
559
|
+
return cached
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
i0 = index
|
|
563
|
+
r1 = _nt_blank
|
|
564
|
+
if r1
|
|
565
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
566
|
+
r0 = r1
|
|
567
|
+
else
|
|
568
|
+
if has_terminal?(@regexps[gr = '\A[!-\\)]'] ||= Regexp.new(gr), :regexp, index)
|
|
569
|
+
r2 = true
|
|
570
|
+
@index += 1
|
|
571
|
+
else
|
|
572
|
+
terminal_parse_failure('[!-\\)]')
|
|
573
|
+
r2 = nil
|
|
574
|
+
end
|
|
575
|
+
if r2
|
|
576
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
577
|
+
r0 = r2
|
|
578
|
+
else
|
|
579
|
+
if has_terminal?(@regexps[gr = '\A[\\+-\\.]'] ||= Regexp.new(gr), :regexp, index)
|
|
580
|
+
r3 = true
|
|
581
|
+
@index += 1
|
|
582
|
+
else
|
|
583
|
+
terminal_parse_failure('[\\+-\\.]')
|
|
584
|
+
r3 = nil
|
|
585
|
+
end
|
|
586
|
+
if r3
|
|
587
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
588
|
+
r0 = r3
|
|
589
|
+
else
|
|
590
|
+
if has_terminal?(@regexps[gr = '\A[0-]'] ||= Regexp.new(gr), :regexp, index)
|
|
591
|
+
r4 = true
|
|
592
|
+
@index += 1
|
|
593
|
+
else
|
|
594
|
+
terminal_parse_failure('[0-]')
|
|
595
|
+
r4 = nil
|
|
596
|
+
end
|
|
597
|
+
if r4
|
|
598
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
599
|
+
r0 = r4
|
|
600
|
+
else
|
|
601
|
+
r5 = _nt_NONASCII
|
|
602
|
+
if r5
|
|
603
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
604
|
+
r0 = r5
|
|
605
|
+
else
|
|
606
|
+
@index = i0
|
|
607
|
+
r0 = nil
|
|
608
|
+
end
|
|
609
|
+
end
|
|
610
|
+
end
|
|
611
|
+
end
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
node_cache[:non_slash_star][start_index] = r0
|
|
615
|
+
|
|
616
|
+
r0
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
def _nt_non_star
|
|
620
|
+
start_index = index
|
|
621
|
+
if node_cache[:non_star].has_key?(index)
|
|
622
|
+
cached = node_cache[:non_star][index]
|
|
623
|
+
if cached
|
|
624
|
+
node_cache[:non_star][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
625
|
+
@index = cached.interval.end
|
|
626
|
+
end
|
|
627
|
+
return cached
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
i0 = index
|
|
631
|
+
r1 = _nt_blank
|
|
632
|
+
if r1
|
|
633
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
634
|
+
r0 = r1
|
|
635
|
+
else
|
|
636
|
+
if has_terminal?(@regexps[gr = '\A[!-\\)]'] ||= Regexp.new(gr), :regexp, index)
|
|
637
|
+
r2 = true
|
|
638
|
+
@index += 1
|
|
639
|
+
else
|
|
640
|
+
terminal_parse_failure('[!-\\)]')
|
|
641
|
+
r2 = nil
|
|
642
|
+
end
|
|
643
|
+
if r2
|
|
644
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
645
|
+
r0 = r2
|
|
646
|
+
else
|
|
647
|
+
if has_terminal?(@regexps[gr = '\A[\\+-]'] ||= Regexp.new(gr), :regexp, index)
|
|
648
|
+
r3 = true
|
|
649
|
+
@index += 1
|
|
650
|
+
else
|
|
651
|
+
terminal_parse_failure('[\\+-]')
|
|
652
|
+
r3 = nil
|
|
653
|
+
end
|
|
654
|
+
if r3
|
|
655
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
656
|
+
r0 = r3
|
|
657
|
+
else
|
|
658
|
+
r4 = _nt_NONASCII
|
|
659
|
+
if r4
|
|
660
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
661
|
+
r0 = r4
|
|
662
|
+
else
|
|
663
|
+
@index = i0
|
|
664
|
+
r0 = nil
|
|
665
|
+
end
|
|
666
|
+
end
|
|
667
|
+
end
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
node_cache[:non_star][start_index] = r0
|
|
671
|
+
|
|
672
|
+
r0
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
module EndStar0
|
|
676
|
+
end
|
|
677
|
+
|
|
678
|
+
def _nt_end_star
|
|
679
|
+
start_index = index
|
|
680
|
+
if node_cache[:end_star].has_key?(index)
|
|
681
|
+
cached = node_cache[:end_star][index]
|
|
682
|
+
if cached
|
|
683
|
+
node_cache[:end_star][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
684
|
+
@index = cached.interval.end
|
|
685
|
+
end
|
|
686
|
+
return cached
|
|
687
|
+
end
|
|
688
|
+
|
|
689
|
+
i0, s0 = index, []
|
|
690
|
+
s1, i1 = [], index
|
|
691
|
+
loop do
|
|
692
|
+
r2 = _nt_non_star
|
|
693
|
+
if r2
|
|
694
|
+
s1 << r2
|
|
695
|
+
else
|
|
696
|
+
break
|
|
697
|
+
end
|
|
698
|
+
end
|
|
699
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
700
|
+
s0 << r1
|
|
701
|
+
if r1
|
|
702
|
+
s3, i3 = [], index
|
|
703
|
+
loop do
|
|
704
|
+
if (match_len = has_terminal?("*", false, index))
|
|
705
|
+
r4 = true
|
|
706
|
+
@index += match_len
|
|
707
|
+
else
|
|
708
|
+
terminal_parse_failure('"*"')
|
|
709
|
+
r4 = nil
|
|
710
|
+
end
|
|
711
|
+
if r4
|
|
712
|
+
s3 << r4
|
|
713
|
+
else
|
|
714
|
+
break
|
|
715
|
+
end
|
|
716
|
+
end
|
|
717
|
+
if s3.empty?
|
|
718
|
+
@index = i3
|
|
719
|
+
r3 = nil
|
|
720
|
+
else
|
|
721
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
|
722
|
+
end
|
|
723
|
+
s0 << r3
|
|
724
|
+
end
|
|
725
|
+
if s0.last
|
|
726
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
|
727
|
+
r0.extend(EndStar0)
|
|
728
|
+
else
|
|
729
|
+
@index = i0
|
|
730
|
+
r0 = nil
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
node_cache[:end_star][start_index] = r0
|
|
734
|
+
|
|
735
|
+
r0
|
|
736
|
+
end
|
|
737
|
+
|
|
503
738
|
def _nt_non_lf
|
|
504
739
|
start_index = index
|
|
505
740
|
if node_cache[:non_lf].has_key?(index)
|
|
@@ -534,24 +769,18 @@ module HGRAMMAR
|
|
|
534
769
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
535
770
|
r0 = r2
|
|
536
771
|
else
|
|
537
|
-
if has_terminal?(@regexps[gr = '\A[\\
|
|
772
|
+
if has_terminal?(@regexps[gr = '\A[\\ -]'] ||= Regexp.new(gr), :regexp, index)
|
|
538
773
|
r3 = true
|
|
539
774
|
@index += 1
|
|
540
775
|
else
|
|
541
|
-
terminal_parse_failure('[\\
|
|
776
|
+
terminal_parse_failure('[\\ -]')
|
|
542
777
|
r3 = nil
|
|
543
778
|
end
|
|
544
779
|
if r3
|
|
545
780
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
546
781
|
r0 = r3
|
|
547
782
|
else
|
|
548
|
-
|
|
549
|
-
r4 = true
|
|
550
|
-
@index += 1
|
|
551
|
-
else
|
|
552
|
-
terminal_parse_failure('[-]')
|
|
553
|
-
r4 = nil
|
|
554
|
-
end
|
|
783
|
+
r4 = _nt_NONASCII
|
|
555
784
|
if r4
|
|
556
785
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
557
786
|
r0 = r4
|
|
@@ -568,6 +797,50 @@ module HGRAMMAR
|
|
|
568
797
|
r0
|
|
569
798
|
end
|
|
570
799
|
|
|
800
|
+
def _nt_eol_comment
|
|
801
|
+
start_index = index
|
|
802
|
+
if node_cache[:eol_comment].has_key?(index)
|
|
803
|
+
cached = node_cache[:eol_comment][index]
|
|
804
|
+
if cached
|
|
805
|
+
node_cache[:eol_comment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
806
|
+
@index = cached.interval.end
|
|
807
|
+
end
|
|
808
|
+
return cached
|
|
809
|
+
end
|
|
810
|
+
|
|
811
|
+
i0 = index
|
|
812
|
+
if (match_len = has_terminal?("#", false, index))
|
|
813
|
+
r1 = true
|
|
814
|
+
@index += match_len
|
|
815
|
+
else
|
|
816
|
+
terminal_parse_failure('"#"')
|
|
817
|
+
r1 = nil
|
|
818
|
+
end
|
|
819
|
+
if r1
|
|
820
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
821
|
+
r0 = r1
|
|
822
|
+
else
|
|
823
|
+
if (match_len = has_terminal?("//", false, index))
|
|
824
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
|
825
|
+
@index += match_len
|
|
826
|
+
else
|
|
827
|
+
terminal_parse_failure('"//"')
|
|
828
|
+
r2 = nil
|
|
829
|
+
end
|
|
830
|
+
if r2
|
|
831
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
832
|
+
r0 = r2
|
|
833
|
+
else
|
|
834
|
+
@index = i0
|
|
835
|
+
r0 = nil
|
|
836
|
+
end
|
|
837
|
+
end
|
|
838
|
+
|
|
839
|
+
node_cache[:eol_comment][start_index] = r0
|
|
840
|
+
|
|
841
|
+
r0
|
|
842
|
+
end
|
|
843
|
+
|
|
571
844
|
module S0
|
|
572
845
|
def comment
|
|
573
846
|
elements[0]
|
|
@@ -650,9 +923,34 @@ module HGRAMMAR
|
|
|
650
923
|
end
|
|
651
924
|
|
|
652
925
|
module Comment0
|
|
926
|
+
def non_slash_star
|
|
927
|
+
elements[1]
|
|
928
|
+
end
|
|
929
|
+
|
|
653
930
|
end
|
|
654
931
|
|
|
655
932
|
module Comment1
|
|
933
|
+
def non_slash_star
|
|
934
|
+
elements[0]
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
def end_star
|
|
938
|
+
elements[1]
|
|
939
|
+
end
|
|
940
|
+
end
|
|
941
|
+
|
|
942
|
+
module Comment2
|
|
943
|
+
def end_star
|
|
944
|
+
elements[1]
|
|
945
|
+
end
|
|
946
|
+
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
module Comment3
|
|
950
|
+
def eol_comment
|
|
951
|
+
elements[0]
|
|
952
|
+
end
|
|
953
|
+
|
|
656
954
|
end
|
|
657
955
|
|
|
658
956
|
def _nt_comment
|
|
@@ -677,26 +975,30 @@ module HGRAMMAR
|
|
|
677
975
|
end
|
|
678
976
|
s1 << r2
|
|
679
977
|
if r2
|
|
680
|
-
|
|
681
|
-
loop do
|
|
682
|
-
r4 = _nt_non_slash
|
|
683
|
-
if r4
|
|
684
|
-
s3 << r4
|
|
685
|
-
else
|
|
686
|
-
break
|
|
687
|
-
end
|
|
688
|
-
end
|
|
689
|
-
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
|
978
|
+
r3 = _nt_non_slash_star
|
|
690
979
|
s1 << r3
|
|
691
980
|
if r3
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
981
|
+
s4, i4 = [], index
|
|
982
|
+
loop do
|
|
983
|
+
r5 = _nt_non_slash
|
|
984
|
+
if r5
|
|
985
|
+
s4 << r5
|
|
986
|
+
else
|
|
987
|
+
break
|
|
988
|
+
end
|
|
989
|
+
end
|
|
990
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
|
991
|
+
s1 << r4
|
|
992
|
+
if r4
|
|
993
|
+
if (match_len = has_terminal?("/", false, index))
|
|
994
|
+
r6 = true
|
|
995
|
+
@index += match_len
|
|
996
|
+
else
|
|
997
|
+
terminal_parse_failure('"/"')
|
|
998
|
+
r6 = nil
|
|
999
|
+
end
|
|
1000
|
+
s1 << r6
|
|
698
1001
|
end
|
|
699
|
-
s1 << r5
|
|
700
1002
|
end
|
|
701
1003
|
end
|
|
702
1004
|
if s1.last
|
|
@@ -710,51 +1012,106 @@ module HGRAMMAR
|
|
|
710
1012
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
711
1013
|
r0 = r1
|
|
712
1014
|
else
|
|
713
|
-
|
|
714
|
-
if (match_len = has_terminal?("
|
|
715
|
-
|
|
1015
|
+
i7, s7 = index, []
|
|
1016
|
+
if (match_len = has_terminal?("/*", false, index))
|
|
1017
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
|
716
1018
|
@index += match_len
|
|
717
1019
|
else
|
|
718
|
-
terminal_parse_failure('"
|
|
719
|
-
|
|
1020
|
+
terminal_parse_failure('"/*"')
|
|
1021
|
+
r8 = nil
|
|
720
1022
|
end
|
|
721
|
-
|
|
722
|
-
if
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
1023
|
+
s7 << r8
|
|
1024
|
+
if r8
|
|
1025
|
+
r9 = _nt_end_star
|
|
1026
|
+
s7 << r9
|
|
1027
|
+
if r9
|
|
1028
|
+
s10, i10 = [], index
|
|
1029
|
+
loop do
|
|
1030
|
+
i11, s11 = index, []
|
|
1031
|
+
r12 = _nt_non_slash_star
|
|
1032
|
+
s11 << r12
|
|
1033
|
+
if r12
|
|
1034
|
+
r13 = _nt_end_star
|
|
1035
|
+
s11 << r13
|
|
1036
|
+
end
|
|
1037
|
+
if s11.last
|
|
1038
|
+
r11 = instantiate_node(SyntaxNode,input, i11...index, s11)
|
|
1039
|
+
r11.extend(Comment1)
|
|
1040
|
+
else
|
|
1041
|
+
@index = i11
|
|
1042
|
+
r11 = nil
|
|
1043
|
+
end
|
|
1044
|
+
if r11
|
|
1045
|
+
s10 << r11
|
|
1046
|
+
else
|
|
1047
|
+
break
|
|
1048
|
+
end
|
|
730
1049
|
end
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
1050
|
+
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
|
1051
|
+
s7 << r10
|
|
1052
|
+
if r10
|
|
1053
|
+
if (match_len = has_terminal?("/", false, index))
|
|
1054
|
+
r14 = true
|
|
1055
|
+
@index += match_len
|
|
1056
|
+
else
|
|
1057
|
+
terminal_parse_failure('"/"')
|
|
1058
|
+
r14 = nil
|
|
1059
|
+
end
|
|
1060
|
+
s7 << r14
|
|
741
1061
|
end
|
|
742
|
-
s6 << r10
|
|
743
1062
|
end
|
|
744
1063
|
end
|
|
745
|
-
if
|
|
746
|
-
|
|
747
|
-
|
|
1064
|
+
if s7.last
|
|
1065
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
|
1066
|
+
r7.extend(Comment2)
|
|
748
1067
|
else
|
|
749
|
-
@index =
|
|
750
|
-
|
|
1068
|
+
@index = i7
|
|
1069
|
+
r7 = nil
|
|
751
1070
|
end
|
|
752
|
-
if
|
|
753
|
-
|
|
754
|
-
r0 =
|
|
1071
|
+
if r7
|
|
1072
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
1073
|
+
r0 = r7
|
|
755
1074
|
else
|
|
756
|
-
|
|
757
|
-
|
|
1075
|
+
i15, s15 = index, []
|
|
1076
|
+
r16 = _nt_eol_comment
|
|
1077
|
+
s15 << r16
|
|
1078
|
+
if r16
|
|
1079
|
+
s17, i17 = [], index
|
|
1080
|
+
loop do
|
|
1081
|
+
r18 = _nt_non_lf
|
|
1082
|
+
if r18
|
|
1083
|
+
s17 << r18
|
|
1084
|
+
else
|
|
1085
|
+
break
|
|
1086
|
+
end
|
|
1087
|
+
end
|
|
1088
|
+
r17 = instantiate_node(SyntaxNode,input, i17...index, s17)
|
|
1089
|
+
s15 << r17
|
|
1090
|
+
if r17
|
|
1091
|
+
if (match_len = has_terminal?("\n", false, index))
|
|
1092
|
+
r19 = true
|
|
1093
|
+
@index += match_len
|
|
1094
|
+
else
|
|
1095
|
+
terminal_parse_failure('"\\n"')
|
|
1096
|
+
r19 = nil
|
|
1097
|
+
end
|
|
1098
|
+
s15 << r19
|
|
1099
|
+
end
|
|
1100
|
+
end
|
|
1101
|
+
if s15.last
|
|
1102
|
+
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
|
1103
|
+
r15.extend(Comment3)
|
|
1104
|
+
else
|
|
1105
|
+
@index = i15
|
|
1106
|
+
r15 = nil
|
|
1107
|
+
end
|
|
1108
|
+
if r15
|
|
1109
|
+
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
|
1110
|
+
r0 = r15
|
|
1111
|
+
else
|
|
1112
|
+
@index = i0
|
|
1113
|
+
r0 = nil
|
|
1114
|
+
end
|
|
758
1115
|
end
|
|
759
1116
|
end
|
|
760
1117
|
|
|
@@ -763,9 +1120,11 @@ module HGRAMMAR
|
|
|
763
1120
|
r0
|
|
764
1121
|
end
|
|
765
1122
|
|
|
766
|
-
end
|
|
767
1123
|
|
|
768
|
-
class
|
|
769
|
-
|
|
1124
|
+
class Parser < Treetop::Runtime::CompiledParser
|
|
1125
|
+
include HGRAMMAR
|
|
1126
|
+
end
|
|
770
1127
|
end
|
|
771
1128
|
|
|
1129
|
+
(remove_const(:HGRAMMARParser) if const_defined?(:HGRAMMARParser)) rescue nil; HGRAMMARParser = HGRAMMAR::Parser
|
|
1130
|
+
|