delorean_lang 0.0.43 → 0.1.00
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/delorean/base.rb +105 -12
- data/lib/delorean/delorean.rb +626 -958
- data/lib/delorean/delorean.treetop +24 -37
- data/lib/delorean/engine.rb +7 -4
- data/lib/delorean/nodes.rb +120 -75
- data/lib/delorean/version.rb +1 -1
- data/lib/delorean_lang.rb +0 -1
- data/spec/eval_spec.rb +54 -26
- data/spec/func_spec.rb +37 -111
- data/spec/parse_spec.rb +33 -7
- metadata +2 -3
- data/lib/delorean/functions.rb +0 -200
data/lib/delorean/base.rb
CHANGED
@@ -1,19 +1,66 @@
|
|
1
|
-
require 'delorean/functions'
|
2
|
-
|
3
1
|
module Delorean
|
2
|
+
|
3
|
+
# FIXME: the whitelist is quite hacky. It's currently difficult to
|
4
|
+
# override it. A user will likely want to directly modify this
|
5
|
+
# hash. The whole whitelist mechanism should be eventually
|
6
|
+
# rethought.
|
7
|
+
RUBY_WHITELIST = {
|
8
|
+
compact: [Array],
|
9
|
+
flatten: [Array, [Fixnum, nil]],
|
10
|
+
length: [[Array, String]],
|
11
|
+
max: [Array],
|
12
|
+
member: "member?",
|
13
|
+
member?: [Array, [Fixnum, String]],
|
14
|
+
reverse: [Array],
|
15
|
+
slice: [Array, Fixnum, Fixnum],
|
16
|
+
sort: [Array],
|
17
|
+
split: [String, String],
|
18
|
+
uniq: [Array],
|
19
|
+
|
20
|
+
hour: [[Date, Time, ActiveSupport::TimeWithZone]],
|
21
|
+
min: [[Date, Time, ActiveSupport::TimeWithZone, Array]],
|
22
|
+
sec: [[Date, Time, ActiveSupport::TimeWithZone]],
|
23
|
+
to_date: [[Date, Time, ActiveSupport::TimeWithZone]],
|
24
|
+
|
25
|
+
month: [[Date, Time, ActiveSupport::TimeWithZone]],
|
26
|
+
day: [[Date, Time, ActiveSupport::TimeWithZone]],
|
27
|
+
year: [[Date, Time, ActiveSupport::TimeWithZone]],
|
28
|
+
|
29
|
+
to_i: [[Numeric, String]],
|
30
|
+
to_f: [[Numeric, String]],
|
31
|
+
to_d: [[Numeric, String]],
|
32
|
+
to_s: [Object],
|
33
|
+
abs: [Numeric],
|
34
|
+
round: [Numeric, [nil, Integer]],
|
35
|
+
}
|
36
|
+
|
4
37
|
module BaseModule
|
38
|
+
class NodeCall
|
39
|
+
attr_reader :engine, :node, :params
|
40
|
+
def initialize(engine, node, params)
|
41
|
+
@engine, @node, @params = engine, node, params
|
42
|
+
end
|
5
43
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
extend Delorean::Functions
|
10
|
-
include Delorean::Functions
|
44
|
+
def evaluate(attr)
|
45
|
+
engine.evaluate(node, attr, params)
|
46
|
+
end
|
11
47
|
|
12
|
-
|
48
|
+
def %(args)
|
49
|
+
raise "bad arg to %" unless args.is_a?(Array)
|
50
|
+
|
51
|
+
args.each_with_object({}) { |attr, h|
|
52
|
+
h[attr] = evaluate(attr)
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class BaseClass
|
13
58
|
|
14
59
|
def self._get_attr(obj, attr, _e)
|
15
60
|
return nil if obj.nil?
|
16
61
|
|
62
|
+
# NOTE: should keep this function consistent with _index
|
63
|
+
|
17
64
|
if obj.kind_of? ActiveRecord::Base
|
18
65
|
klass = obj.class
|
19
66
|
|
@@ -24,6 +71,8 @@ module Delorean
|
|
24
71
|
klass.reflect_on_all_associations.map(&:name).member? attr.to_sym
|
25
72
|
|
26
73
|
raise InvalidGetAttribute, "ActiveRecord lookup '#{attr}' on #{obj}"
|
74
|
+
elsif obj.instance_of?(NodeCall)
|
75
|
+
return obj.evaluate(attr)
|
27
76
|
elsif obj.instance_of?(Hash)
|
28
77
|
return obj.member?(attr) ? obj[attr] : obj[attr.to_sym]
|
29
78
|
elsif obj.instance_of?(Class) && (obj < BaseClass)
|
@@ -38,9 +87,12 @@ module Delorean
|
|
38
87
|
def self._index(obj, args, _e)
|
39
88
|
return nil if obj.nil?
|
40
89
|
|
41
|
-
|
90
|
+
# NOTE: should keep this function consistent with _get_attr
|
91
|
+
|
92
|
+
if obj.instance_of?(Hash) || obj.kind_of?(ActiveRecord::Base) ||
|
93
|
+
obj.instance_of?(NodeCall) || obj.instance_of?(Class)
|
42
94
|
raise InvalidIndex unless args.length == 1
|
43
|
-
obj
|
95
|
+
_get_attr(obj, args[0], _e)
|
44
96
|
elsif obj.instance_of?(Array)
|
45
97
|
raise InvalidIndex unless args.length < 2
|
46
98
|
raise InvalidIndex unless
|
@@ -53,12 +105,53 @@ module Delorean
|
|
53
105
|
|
54
106
|
######################################################################
|
55
107
|
|
56
|
-
def self.
|
108
|
+
def self._err(*args)
|
109
|
+
str = args.map(&:to_s).join(", ")
|
110
|
+
raise str
|
111
|
+
end
|
112
|
+
|
113
|
+
def self._node_call(node, mname, _e, params)
|
57
114
|
context = _e[:_engine]
|
58
115
|
node ||= self
|
59
116
|
|
60
117
|
engine = mname ? context.get_import_engine(mname) : context
|
61
|
-
|
118
|
+
NodeCall.new(engine, node, params)
|
119
|
+
end
|
120
|
+
|
121
|
+
######################################################################
|
122
|
+
|
123
|
+
def self._instance_call(obj, method, args)
|
124
|
+
begin
|
125
|
+
msg = method.to_sym
|
126
|
+
rescue NoMethodError
|
127
|
+
raise "bad method #{method}"
|
128
|
+
end
|
129
|
+
|
130
|
+
sig = RUBY_WHITELIST[msg]
|
131
|
+
|
132
|
+
raise "no such method #{method}" unless sig
|
133
|
+
|
134
|
+
# if sig is a string, then method mapped to another name
|
135
|
+
return _instance_call(obj, sig, args) if sig.respond_to?(:to_sym)
|
136
|
+
|
137
|
+
raise "too many args to #{method}" if args.length>(sig.length-1)
|
138
|
+
|
139
|
+
arglist = [obj] + args
|
140
|
+
|
141
|
+
sig.each_with_index { |s, i|
|
142
|
+
s = [s] unless s.is_a?(Array)
|
143
|
+
|
144
|
+
ok, ai = false, arglist[i]
|
145
|
+
s.each { |sc|
|
146
|
+
if (sc.nil? && i>=arglist.length) || (sc && ai.class <= sc)
|
147
|
+
ok = true
|
148
|
+
break
|
149
|
+
end
|
150
|
+
}
|
151
|
+
raise "bad arg #{i} to method #{method}: #{ai}/#{ai.class} #{s}" unless ok
|
152
|
+
}
|
153
|
+
|
154
|
+
obj.send(msg, *args)
|
62
155
|
end
|
63
156
|
|
64
157
|
######################################################################
|
data/lib/delorean/delorean.rb
CHANGED
@@ -518,6 +518,13 @@ module Delorean
|
|
518
518
|
end
|
519
519
|
|
520
520
|
module Expression0
|
521
|
+
def args
|
522
|
+
elements[2]
|
523
|
+
end
|
524
|
+
|
525
|
+
end
|
526
|
+
|
527
|
+
module Expression1
|
521
528
|
def op
|
522
529
|
elements[0]
|
523
530
|
end
|
@@ -527,7 +534,7 @@ module Delorean
|
|
527
534
|
end
|
528
535
|
end
|
529
536
|
|
530
|
-
module
|
537
|
+
module Expression2
|
531
538
|
def v
|
532
539
|
elements[2]
|
533
540
|
end
|
@@ -541,7 +548,7 @@ module Delorean
|
|
541
548
|
end
|
542
549
|
end
|
543
550
|
|
544
|
-
module
|
551
|
+
module Expression3
|
545
552
|
def v
|
546
553
|
elements[0]
|
547
554
|
end
|
@@ -555,17 +562,6 @@ module Delorean
|
|
555
562
|
end
|
556
563
|
end
|
557
564
|
|
558
|
-
module Expression3
|
559
|
-
def v
|
560
|
-
elements[0]
|
561
|
-
end
|
562
|
-
|
563
|
-
def args
|
564
|
-
elements[4]
|
565
|
-
end
|
566
|
-
|
567
|
-
end
|
568
|
-
|
569
565
|
def _nt_expression
|
570
566
|
start_index = index
|
571
567
|
if node_cache[:expression].has_key?(index)
|
@@ -579,7 +575,13 @@ module Delorean
|
|
579
575
|
|
580
576
|
i0 = index
|
581
577
|
i1, s1 = index, []
|
582
|
-
|
578
|
+
if has_terminal?('ERR(', false, index)
|
579
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
580
|
+
@index += 4
|
581
|
+
else
|
582
|
+
terminal_parse_failure('ERR(')
|
583
|
+
r2 = nil
|
584
|
+
end
|
583
585
|
s1 << r2
|
584
586
|
if r2
|
585
587
|
r4 = _nt_sp
|
@@ -590,12 +592,31 @@ module Delorean
|
|
590
592
|
end
|
591
593
|
s1 << r3
|
592
594
|
if r3
|
593
|
-
r5 =
|
595
|
+
r5 = _nt_fn_args
|
594
596
|
s1 << r5
|
597
|
+
if r5
|
598
|
+
r7 = _nt_sp
|
599
|
+
if r7
|
600
|
+
r6 = r7
|
601
|
+
else
|
602
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
603
|
+
end
|
604
|
+
s1 << r6
|
605
|
+
if r6
|
606
|
+
if has_terminal?(')', false, index)
|
607
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
608
|
+
@index += 1
|
609
|
+
else
|
610
|
+
terminal_parse_failure(')')
|
611
|
+
r8 = nil
|
612
|
+
end
|
613
|
+
s1 << r8
|
614
|
+
end
|
615
|
+
end
|
595
616
|
end
|
596
617
|
end
|
597
618
|
if s1.last
|
598
|
-
r1 = instantiate_node(
|
619
|
+
r1 = instantiate_node(ErrorOp,input, i1...index, s1)
|
599
620
|
r1.extend(Expression0)
|
600
621
|
else
|
601
622
|
@index = i1
|
@@ -604,82 +625,109 @@ module Delorean
|
|
604
625
|
if r1
|
605
626
|
r0 = r1
|
606
627
|
else
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
628
|
+
i9, s9 = index, []
|
629
|
+
r10 = _nt_unary_op
|
630
|
+
s9 << r10
|
631
|
+
if r10
|
632
|
+
r12 = _nt_sp
|
633
|
+
if r12
|
634
|
+
r11 = r12
|
635
|
+
else
|
636
|
+
r11 = instantiate_node(SyntaxNode,input, index...index)
|
637
|
+
end
|
638
|
+
s9 << r11
|
639
|
+
if r11
|
640
|
+
r13 = _nt_expression
|
641
|
+
s9 << r13
|
642
|
+
end
|
643
|
+
end
|
644
|
+
if s9.last
|
645
|
+
r9 = instantiate_node(UnOp,input, i9...index, s9)
|
646
|
+
r9.extend(Expression1)
|
611
647
|
else
|
612
|
-
|
613
|
-
|
648
|
+
@index = i9
|
649
|
+
r9 = nil
|
614
650
|
end
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
651
|
+
if r9
|
652
|
+
r0 = r9
|
653
|
+
else
|
654
|
+
i14, s14 = index, []
|
655
|
+
if has_terminal?('if', false, index)
|
656
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
657
|
+
@index += 2
|
620
658
|
else
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
if
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
659
|
+
terminal_parse_failure('if')
|
660
|
+
r15 = nil
|
661
|
+
end
|
662
|
+
s14 << r15
|
663
|
+
if r15
|
664
|
+
r17 = _nt_sp
|
665
|
+
if r17
|
666
|
+
r16 = r17
|
667
|
+
else
|
668
|
+
r16 = instantiate_node(SyntaxNode,input, index...index)
|
669
|
+
end
|
670
|
+
s14 << r16
|
671
|
+
if r16
|
672
|
+
r18 = _nt_expression
|
673
|
+
s14 << r18
|
674
|
+
if r18
|
675
|
+
r20 = _nt_sp
|
676
|
+
if r20
|
677
|
+
r19 = r20
|
639
678
|
else
|
640
|
-
|
641
|
-
r13 = nil
|
679
|
+
r19 = instantiate_node(SyntaxNode,input, index...index)
|
642
680
|
end
|
643
|
-
|
644
|
-
if
|
645
|
-
|
646
|
-
|
647
|
-
|
681
|
+
s14 << r19
|
682
|
+
if r19
|
683
|
+
if has_terminal?('then', false, index)
|
684
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
685
|
+
@index += 4
|
648
686
|
else
|
649
|
-
|
687
|
+
terminal_parse_failure('then')
|
688
|
+
r21 = nil
|
650
689
|
end
|
651
|
-
|
652
|
-
if
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
if
|
664
|
-
|
665
|
-
|
666
|
-
|
690
|
+
s14 << r21
|
691
|
+
if r21
|
692
|
+
r23 = _nt_sp
|
693
|
+
if r23
|
694
|
+
r22 = r23
|
695
|
+
else
|
696
|
+
r22 = instantiate_node(SyntaxNode,input, index...index)
|
697
|
+
end
|
698
|
+
s14 << r22
|
699
|
+
if r22
|
700
|
+
r24 = _nt_expression
|
701
|
+
s14 << r24
|
702
|
+
if r24
|
703
|
+
r26 = _nt_sp
|
704
|
+
if r26
|
705
|
+
r25 = r26
|
667
706
|
else
|
668
|
-
|
669
|
-
r19 = nil
|
707
|
+
r25 = instantiate_node(SyntaxNode,input, index...index)
|
670
708
|
end
|
671
|
-
|
672
|
-
if
|
673
|
-
|
674
|
-
|
675
|
-
|
709
|
+
s14 << r25
|
710
|
+
if r25
|
711
|
+
if has_terminal?('else', false, index)
|
712
|
+
r27 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
713
|
+
@index += 4
|
676
714
|
else
|
677
|
-
|
715
|
+
terminal_parse_failure('else')
|
716
|
+
r27 = nil
|
678
717
|
end
|
679
|
-
|
680
|
-
if
|
681
|
-
|
682
|
-
|
718
|
+
s14 << r27
|
719
|
+
if r27
|
720
|
+
r29 = _nt_sp
|
721
|
+
if r29
|
722
|
+
r28 = r29
|
723
|
+
else
|
724
|
+
r28 = instantiate_node(SyntaxNode,input, index...index)
|
725
|
+
end
|
726
|
+
s14 << r28
|
727
|
+
if r28
|
728
|
+
r30 = _nt_expression
|
729
|
+
s14 << r30
|
730
|
+
end
|
683
731
|
end
|
684
732
|
end
|
685
733
|
end
|
@@ -689,55 +737,15 @@ module Delorean
|
|
689
737
|
end
|
690
738
|
end
|
691
739
|
end
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
r6.extend(Expression1)
|
696
|
-
else
|
697
|
-
@index = i6
|
698
|
-
r6 = nil
|
699
|
-
end
|
700
|
-
if r6
|
701
|
-
r0 = r6
|
702
|
-
else
|
703
|
-
i23, s23 = index, []
|
704
|
-
r24 = _nt_getattr_exp
|
705
|
-
s23 << r24
|
706
|
-
if r24
|
707
|
-
r26 = _nt_sp
|
708
|
-
if r26
|
709
|
-
r25 = r26
|
710
|
-
else
|
711
|
-
r25 = instantiate_node(SyntaxNode,input, index...index)
|
712
|
-
end
|
713
|
-
s23 << r25
|
714
|
-
if r25
|
715
|
-
r27 = _nt_binary_op
|
716
|
-
s23 << r27
|
717
|
-
if r27
|
718
|
-
r29 = _nt_sp
|
719
|
-
if r29
|
720
|
-
r28 = r29
|
721
|
-
else
|
722
|
-
r28 = instantiate_node(SyntaxNode,input, index...index)
|
723
|
-
end
|
724
|
-
s23 << r28
|
725
|
-
if r28
|
726
|
-
r30 = _nt_expression
|
727
|
-
s23 << r30
|
728
|
-
end
|
729
|
-
end
|
730
|
-
end
|
731
|
-
end
|
732
|
-
if s23.last
|
733
|
-
r23 = instantiate_node(BinOp,input, i23...index, s23)
|
734
|
-
r23.extend(Expression2)
|
740
|
+
if s14.last
|
741
|
+
r14 = instantiate_node(IfElse,input, i14...index, s14)
|
742
|
+
r14.extend(Expression2)
|
735
743
|
else
|
736
|
-
@index =
|
737
|
-
|
744
|
+
@index = i14
|
745
|
+
r14 = nil
|
738
746
|
end
|
739
|
-
if
|
740
|
-
r0 =
|
747
|
+
if r14
|
748
|
+
r0 = r14
|
741
749
|
else
|
742
750
|
i31, s31 = index, []
|
743
751
|
r32 = _nt_getattr_exp
|
@@ -751,13 +759,7 @@ module Delorean
|
|
751
759
|
end
|
752
760
|
s31 << r33
|
753
761
|
if r33
|
754
|
-
|
755
|
-
r35 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
756
|
-
@index += 1
|
757
|
-
else
|
758
|
-
terminal_parse_failure('[')
|
759
|
-
r35 = nil
|
760
|
-
end
|
762
|
+
r35 = _nt_binary_op
|
761
763
|
s31 << r35
|
762
764
|
if r35
|
763
765
|
r37 = _nt_sp
|
@@ -768,33 +770,14 @@ module Delorean
|
|
768
770
|
end
|
769
771
|
s31 << r36
|
770
772
|
if r36
|
771
|
-
r38 =
|
773
|
+
r38 = _nt_expression
|
772
774
|
s31 << r38
|
773
|
-
if r38
|
774
|
-
r40 = _nt_sp
|
775
|
-
if r40
|
776
|
-
r39 = r40
|
777
|
-
else
|
778
|
-
r39 = instantiate_node(SyntaxNode,input, index...index)
|
779
|
-
end
|
780
|
-
s31 << r39
|
781
|
-
if r39
|
782
|
-
if has_terminal?(']', false, index)
|
783
|
-
r41 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
784
|
-
@index += 1
|
785
|
-
else
|
786
|
-
terminal_parse_failure(']')
|
787
|
-
r41 = nil
|
788
|
-
end
|
789
|
-
s31 << r41
|
790
|
-
end
|
791
|
-
end
|
792
775
|
end
|
793
776
|
end
|
794
777
|
end
|
795
778
|
end
|
796
779
|
if s31.last
|
797
|
-
r31 = instantiate_node(
|
780
|
+
r31 = instantiate_node(BinOp,input, i31...index, s31)
|
798
781
|
r31.extend(Expression3)
|
799
782
|
else
|
800
783
|
@index = i31
|
@@ -803,9 +786,9 @@ module Delorean
|
|
803
786
|
if r31
|
804
787
|
r0 = r31
|
805
788
|
else
|
806
|
-
|
807
|
-
if
|
808
|
-
r0 =
|
789
|
+
r39 = _nt_getattr_exp
|
790
|
+
if r39
|
791
|
+
r0 = r39
|
809
792
|
else
|
810
793
|
@index = i0
|
811
794
|
r0 = nil
|
@@ -821,17 +804,11 @@ module Delorean
|
|
821
804
|
end
|
822
805
|
|
823
806
|
module GetattrExp0
|
824
|
-
def identifier
|
825
|
-
elements[1]
|
826
|
-
end
|
827
|
-
end
|
828
|
-
|
829
|
-
module GetattrExp1
|
830
807
|
def v
|
831
808
|
elements[0]
|
832
809
|
end
|
833
810
|
|
834
|
-
def
|
811
|
+
def dotted
|
835
812
|
elements[1]
|
836
813
|
end
|
837
814
|
end
|
@@ -847,111 +824,119 @@ module Delorean
|
|
847
824
|
return cached
|
848
825
|
end
|
849
826
|
|
827
|
+
i0 = index
|
828
|
+
i1, s1 = index, []
|
829
|
+
r2 = _nt_value
|
830
|
+
s1 << r2
|
831
|
+
if r2
|
832
|
+
r3 = _nt_dotted
|
833
|
+
s1 << r3
|
834
|
+
end
|
835
|
+
if s1.last
|
836
|
+
r1 = instantiate_node(GetattrExp,input, i1...index, s1)
|
837
|
+
r1.extend(GetattrExp0)
|
838
|
+
else
|
839
|
+
@index = i1
|
840
|
+
r1 = nil
|
841
|
+
end
|
842
|
+
if r1
|
843
|
+
r0 = r1
|
844
|
+
else
|
845
|
+
r4 = _nt_value
|
846
|
+
if r4
|
847
|
+
r0 = r4
|
848
|
+
else
|
849
|
+
@index = i0
|
850
|
+
r0 = nil
|
851
|
+
end
|
852
|
+
end
|
853
|
+
|
854
|
+
node_cache[:getattr_exp][start_index] = r0
|
855
|
+
|
856
|
+
r0
|
857
|
+
end
|
858
|
+
|
859
|
+
module Dotted0
|
860
|
+
def d
|
861
|
+
elements[0]
|
862
|
+
end
|
863
|
+
|
864
|
+
def d_rest
|
865
|
+
elements[1]
|
866
|
+
end
|
867
|
+
end
|
868
|
+
|
869
|
+
def _nt_dotted
|
870
|
+
start_index = index
|
871
|
+
if node_cache[:dotted].has_key?(index)
|
872
|
+
cached = node_cache[:dotted][index]
|
873
|
+
if cached
|
874
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
875
|
+
@index = cached.interval.end
|
876
|
+
end
|
877
|
+
return cached
|
878
|
+
end
|
879
|
+
|
850
880
|
i0, s0 = index, []
|
851
|
-
r1 =
|
881
|
+
r1 = _nt_dot_exp
|
852
882
|
s0 << r1
|
853
883
|
if r1
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
@index += 1
|
860
|
-
else
|
861
|
-
terminal_parse_failure('.')
|
862
|
-
r4 = nil
|
863
|
-
end
|
864
|
-
s3 << r4
|
865
|
-
if r4
|
866
|
-
r5 = _nt_identifier
|
867
|
-
s3 << r5
|
868
|
-
end
|
869
|
-
if s3.last
|
870
|
-
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
871
|
-
r3.extend(GetattrExp0)
|
872
|
-
else
|
873
|
-
@index = i3
|
874
|
-
r3 = nil
|
875
|
-
end
|
876
|
-
if r3
|
877
|
-
s2 << r3
|
878
|
-
else
|
879
|
-
break
|
880
|
-
end
|
884
|
+
r3 = _nt_dotted
|
885
|
+
if r3
|
886
|
+
r2 = r3
|
887
|
+
else
|
888
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
881
889
|
end
|
882
|
-
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
883
890
|
s0 << r2
|
884
891
|
end
|
885
892
|
if s0.last
|
886
|
-
r0 = instantiate_node(
|
887
|
-
r0.extend(
|
893
|
+
r0 = instantiate_node(Dotted,input, i0...index, s0)
|
894
|
+
r0.extend(Dotted0)
|
888
895
|
else
|
889
896
|
@index = i0
|
890
897
|
r0 = nil
|
891
898
|
end
|
892
899
|
|
893
|
-
node_cache[:
|
900
|
+
node_cache[:dotted][start_index] = r0
|
894
901
|
|
895
902
|
r0
|
896
903
|
end
|
897
904
|
|
898
|
-
module
|
899
|
-
def
|
900
|
-
elements[1]
|
901
|
-
end
|
902
|
-
|
903
|
-
def e3
|
905
|
+
module DotExp0
|
906
|
+
def args
|
904
907
|
elements[2]
|
905
908
|
end
|
906
909
|
|
907
910
|
end
|
908
911
|
|
909
|
-
module
|
910
|
-
def
|
912
|
+
module DotExp1
|
913
|
+
def al
|
911
914
|
elements[2]
|
912
915
|
end
|
913
916
|
|
914
|
-
|
915
|
-
elements[3]
|
916
|
-
end
|
917
|
-
|
918
|
-
def sp2
|
919
|
-
elements[5]
|
920
|
-
end
|
917
|
+
end
|
921
918
|
|
919
|
+
module DotExp2
|
922
920
|
def i
|
923
|
-
elements[
|
924
|
-
end
|
925
|
-
|
926
|
-
def sp3
|
927
|
-
elements[7]
|
928
|
-
end
|
929
|
-
|
930
|
-
def sp4
|
931
|
-
elements[9]
|
932
|
-
end
|
933
|
-
|
934
|
-
def e1
|
935
|
-
elements[10]
|
921
|
+
elements[2]
|
936
922
|
end
|
937
923
|
|
938
|
-
def
|
939
|
-
elements[
|
924
|
+
def al
|
925
|
+
elements[5]
|
940
926
|
end
|
941
927
|
|
942
928
|
end
|
943
929
|
|
944
|
-
module
|
945
|
-
def
|
930
|
+
module DotExp3
|
931
|
+
def i
|
946
932
|
elements[2]
|
947
933
|
end
|
948
|
-
|
949
934
|
end
|
950
935
|
|
951
|
-
def
|
936
|
+
def _nt_dot_exp
|
952
937
|
start_index = index
|
953
|
-
if node_cache[:
|
954
|
-
cached = node_cache[:
|
938
|
+
if node_cache[:dot_exp].has_key?(index)
|
939
|
+
cached = node_cache[:dot_exp][index]
|
955
940
|
if cached
|
956
941
|
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
957
942
|
@index = cached.interval.end
|
@@ -960,38 +945,333 @@ module Delorean
|
|
960
945
|
end
|
961
946
|
|
962
947
|
i0 = index
|
963
|
-
|
964
|
-
|
965
|
-
|
948
|
+
i1, s1 = index, []
|
949
|
+
if has_terminal?('[', false, index)
|
950
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
951
|
+
@index += 1
|
966
952
|
else
|
967
|
-
terminal_parse_failure('[
|
968
|
-
|
953
|
+
terminal_parse_failure('[')
|
954
|
+
r2 = nil
|
969
955
|
end
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
976
|
-
@index += 1
|
956
|
+
s1 << r2
|
957
|
+
if r2
|
958
|
+
r4 = _nt_sp
|
959
|
+
if r4
|
960
|
+
r3 = r4
|
977
961
|
else
|
978
|
-
|
979
|
-
r3 = nil
|
962
|
+
r3 = instantiate_node(SyntaxNode,input, index...index)
|
980
963
|
end
|
981
|
-
|
964
|
+
s1 << r3
|
982
965
|
if r3
|
983
|
-
r5 =
|
966
|
+
r5 = _nt_fn_args
|
967
|
+
s1 << r5
|
984
968
|
if r5
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
s2 << r6
|
969
|
+
r7 = _nt_sp
|
970
|
+
if r7
|
971
|
+
r6 = r7
|
972
|
+
else
|
973
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
974
|
+
end
|
975
|
+
s1 << r6
|
993
976
|
if r6
|
994
|
-
|
977
|
+
if has_terminal?(']', false, index)
|
978
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
979
|
+
@index += 1
|
980
|
+
else
|
981
|
+
terminal_parse_failure(']')
|
982
|
+
r8 = nil
|
983
|
+
end
|
984
|
+
s1 << r8
|
985
|
+
end
|
986
|
+
end
|
987
|
+
end
|
988
|
+
end
|
989
|
+
if s1.last
|
990
|
+
r1 = instantiate_node(IndexOp,input, i1...index, s1)
|
991
|
+
r1.extend(DotExp0)
|
992
|
+
else
|
993
|
+
@index = i1
|
994
|
+
r1 = nil
|
995
|
+
end
|
996
|
+
if r1
|
997
|
+
r0 = r1
|
998
|
+
else
|
999
|
+
i9, s9 = index, []
|
1000
|
+
if has_terminal?('(', false, index)
|
1001
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1002
|
+
@index += 1
|
1003
|
+
else
|
1004
|
+
terminal_parse_failure('(')
|
1005
|
+
r10 = nil
|
1006
|
+
end
|
1007
|
+
s9 << r10
|
1008
|
+
if r10
|
1009
|
+
r12 = _nt_sp
|
1010
|
+
if r12
|
1011
|
+
r11 = r12
|
1012
|
+
else
|
1013
|
+
r11 = instantiate_node(SyntaxNode,input, index...index)
|
1014
|
+
end
|
1015
|
+
s9 << r11
|
1016
|
+
if r11
|
1017
|
+
r14 = _nt_kw_args
|
1018
|
+
if r14
|
1019
|
+
r13 = r14
|
1020
|
+
else
|
1021
|
+
r13 = instantiate_node(SyntaxNode,input, index...index)
|
1022
|
+
end
|
1023
|
+
s9 << r13
|
1024
|
+
if r13
|
1025
|
+
r16 = _nt_sp
|
1026
|
+
if r16
|
1027
|
+
r15 = r16
|
1028
|
+
else
|
1029
|
+
r15 = instantiate_node(SyntaxNode,input, index...index)
|
1030
|
+
end
|
1031
|
+
s9 << r15
|
1032
|
+
if r15
|
1033
|
+
if has_terminal?(')', false, index)
|
1034
|
+
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1035
|
+
@index += 1
|
1036
|
+
else
|
1037
|
+
terminal_parse_failure(')')
|
1038
|
+
r17 = nil
|
1039
|
+
end
|
1040
|
+
s9 << r17
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
end
|
1045
|
+
if s9.last
|
1046
|
+
r9 = instantiate_node(NodeCall,input, i9...index, s9)
|
1047
|
+
r9.extend(DotExp1)
|
1048
|
+
else
|
1049
|
+
@index = i9
|
1050
|
+
r9 = nil
|
1051
|
+
end
|
1052
|
+
if r9
|
1053
|
+
r0 = r9
|
1054
|
+
else
|
1055
|
+
i18, s18 = index, []
|
1056
|
+
if has_terminal?('.', false, index)
|
1057
|
+
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1058
|
+
@index += 1
|
1059
|
+
else
|
1060
|
+
terminal_parse_failure('.')
|
1061
|
+
r19 = nil
|
1062
|
+
end
|
1063
|
+
s18 << r19
|
1064
|
+
if r19
|
1065
|
+
r21 = _nt_sp
|
1066
|
+
if r21
|
1067
|
+
r20 = r21
|
1068
|
+
else
|
1069
|
+
r20 = instantiate_node(SyntaxNode,input, index...index)
|
1070
|
+
end
|
1071
|
+
s18 << r20
|
1072
|
+
if r20
|
1073
|
+
r22 = _nt_identifier
|
1074
|
+
s18 << r22
|
1075
|
+
if r22
|
1076
|
+
if has_terminal?('(', false, index)
|
1077
|
+
r23 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1078
|
+
@index += 1
|
1079
|
+
else
|
1080
|
+
terminal_parse_failure('(')
|
1081
|
+
r23 = nil
|
1082
|
+
end
|
1083
|
+
s18 << r23
|
1084
|
+
if r23
|
1085
|
+
r25 = _nt_sp
|
1086
|
+
if r25
|
1087
|
+
r24 = r25
|
1088
|
+
else
|
1089
|
+
r24 = instantiate_node(SyntaxNode,input, index...index)
|
1090
|
+
end
|
1091
|
+
s18 << r24
|
1092
|
+
if r24
|
1093
|
+
r27 = _nt_kw_args
|
1094
|
+
if r27
|
1095
|
+
r26 = r27
|
1096
|
+
else
|
1097
|
+
r26 = instantiate_node(SyntaxNode,input, index...index)
|
1098
|
+
end
|
1099
|
+
s18 << r26
|
1100
|
+
if r26
|
1101
|
+
r29 = _nt_sp
|
1102
|
+
if r29
|
1103
|
+
r28 = r29
|
1104
|
+
else
|
1105
|
+
r28 = instantiate_node(SyntaxNode,input, index...index)
|
1106
|
+
end
|
1107
|
+
s18 << r28
|
1108
|
+
if r28
|
1109
|
+
if has_terminal?(')', false, index)
|
1110
|
+
r30 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1111
|
+
@index += 1
|
1112
|
+
else
|
1113
|
+
terminal_parse_failure(')')
|
1114
|
+
r30 = nil
|
1115
|
+
end
|
1116
|
+
s18 << r30
|
1117
|
+
end
|
1118
|
+
end
|
1119
|
+
end
|
1120
|
+
end
|
1121
|
+
end
|
1122
|
+
end
|
1123
|
+
end
|
1124
|
+
if s18.last
|
1125
|
+
r18 = instantiate_node(Call,input, i18...index, s18)
|
1126
|
+
r18.extend(DotExp2)
|
1127
|
+
else
|
1128
|
+
@index = i18
|
1129
|
+
r18 = nil
|
1130
|
+
end
|
1131
|
+
if r18
|
1132
|
+
r0 = r18
|
1133
|
+
else
|
1134
|
+
i31, s31 = index, []
|
1135
|
+
if has_terminal?('.', false, index)
|
1136
|
+
r32 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1137
|
+
@index += 1
|
1138
|
+
else
|
1139
|
+
terminal_parse_failure('.')
|
1140
|
+
r32 = nil
|
1141
|
+
end
|
1142
|
+
s31 << r32
|
1143
|
+
if r32
|
1144
|
+
r34 = _nt_sp
|
1145
|
+
if r34
|
1146
|
+
r33 = r34
|
1147
|
+
else
|
1148
|
+
r33 = instantiate_node(SyntaxNode,input, index...index)
|
1149
|
+
end
|
1150
|
+
s31 << r33
|
1151
|
+
if r33
|
1152
|
+
r35 = _nt_identifier
|
1153
|
+
s31 << r35
|
1154
|
+
end
|
1155
|
+
end
|
1156
|
+
if s31.last
|
1157
|
+
r31 = instantiate_node(GetAttr,input, i31...index, s31)
|
1158
|
+
r31.extend(DotExp3)
|
1159
|
+
else
|
1160
|
+
@index = i31
|
1161
|
+
r31 = nil
|
1162
|
+
end
|
1163
|
+
if r31
|
1164
|
+
r0 = r31
|
1165
|
+
else
|
1166
|
+
@index = i0
|
1167
|
+
r0 = nil
|
1168
|
+
end
|
1169
|
+
end
|
1170
|
+
end
|
1171
|
+
end
|
1172
|
+
|
1173
|
+
node_cache[:dot_exp][start_index] = r0
|
1174
|
+
|
1175
|
+
r0
|
1176
|
+
end
|
1177
|
+
|
1178
|
+
module ListExpr0
|
1179
|
+
def sp
|
1180
|
+
elements[1]
|
1181
|
+
end
|
1182
|
+
|
1183
|
+
def e3
|
1184
|
+
elements[2]
|
1185
|
+
end
|
1186
|
+
|
1187
|
+
end
|
1188
|
+
|
1189
|
+
module ListExpr1
|
1190
|
+
def e2
|
1191
|
+
elements[2]
|
1192
|
+
end
|
1193
|
+
|
1194
|
+
def sp1
|
1195
|
+
elements[3]
|
1196
|
+
end
|
1197
|
+
|
1198
|
+
def sp2
|
1199
|
+
elements[5]
|
1200
|
+
end
|
1201
|
+
|
1202
|
+
def i
|
1203
|
+
elements[6]
|
1204
|
+
end
|
1205
|
+
|
1206
|
+
def sp3
|
1207
|
+
elements[7]
|
1208
|
+
end
|
1209
|
+
|
1210
|
+
def sp4
|
1211
|
+
elements[9]
|
1212
|
+
end
|
1213
|
+
|
1214
|
+
def e1
|
1215
|
+
elements[10]
|
1216
|
+
end
|
1217
|
+
|
1218
|
+
def ifexp
|
1219
|
+
elements[12]
|
1220
|
+
end
|
1221
|
+
|
1222
|
+
end
|
1223
|
+
|
1224
|
+
module ListExpr2
|
1225
|
+
def args
|
1226
|
+
elements[2]
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
end
|
1230
|
+
|
1231
|
+
def _nt_list_expr
|
1232
|
+
start_index = index
|
1233
|
+
if node_cache[:list_expr].has_key?(index)
|
1234
|
+
cached = node_cache[:list_expr][index]
|
1235
|
+
if cached
|
1236
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1237
|
+
@index = cached.interval.end
|
1238
|
+
end
|
1239
|
+
return cached
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
i0 = index
|
1243
|
+
if has_terminal?('[]', false, index)
|
1244
|
+
r1 = instantiate_node(ListExpr,input, index...(index + 2))
|
1245
|
+
@index += 2
|
1246
|
+
else
|
1247
|
+
terminal_parse_failure('[]')
|
1248
|
+
r1 = nil
|
1249
|
+
end
|
1250
|
+
if r1
|
1251
|
+
r0 = r1
|
1252
|
+
else
|
1253
|
+
i2, s2 = index, []
|
1254
|
+
if has_terminal?('[', false, index)
|
1255
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1256
|
+
@index += 1
|
1257
|
+
else
|
1258
|
+
terminal_parse_failure('[')
|
1259
|
+
r3 = nil
|
1260
|
+
end
|
1261
|
+
s2 << r3
|
1262
|
+
if r3
|
1263
|
+
r5 = _nt_sp
|
1264
|
+
if r5
|
1265
|
+
r4 = r5
|
1266
|
+
else
|
1267
|
+
r4 = instantiate_node(SyntaxNode,input, index...index)
|
1268
|
+
end
|
1269
|
+
s2 << r4
|
1270
|
+
if r4
|
1271
|
+
r6 = _nt_expression
|
1272
|
+
s2 << r6
|
1273
|
+
if r6
|
1274
|
+
r7 = _nt_sp
|
995
1275
|
s2 << r7
|
996
1276
|
if r7
|
997
1277
|
if has_terminal?('for', false, index)
|
@@ -1734,128 +2014,113 @@ module Delorean
|
|
1734
2014
|
if r4
|
1735
2015
|
r0 = r4
|
1736
2016
|
else
|
1737
|
-
r5 =
|
2017
|
+
r5 = _nt_identifier
|
1738
2018
|
if r5
|
1739
2019
|
r0 = r5
|
1740
2020
|
else
|
1741
|
-
r6 =
|
2021
|
+
r6 = _nt_list_expr
|
1742
2022
|
if r6
|
1743
2023
|
r0 = r6
|
1744
2024
|
else
|
1745
|
-
r7 =
|
2025
|
+
r7 = _nt_hash_expr
|
1746
2026
|
if r7
|
1747
2027
|
r0 = r7
|
1748
2028
|
else
|
1749
|
-
|
2029
|
+
i8, s8 = index, []
|
2030
|
+
i10, s10 = index, []
|
2031
|
+
r11 = _nt_class_name
|
2032
|
+
s10 << r11
|
2033
|
+
if r11
|
2034
|
+
if has_terminal?('::', false, index)
|
2035
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2036
|
+
@index += 2
|
2037
|
+
else
|
2038
|
+
terminal_parse_failure('::')
|
2039
|
+
r12 = nil
|
2040
|
+
end
|
2041
|
+
s10 << r12
|
2042
|
+
end
|
2043
|
+
if s10.last
|
2044
|
+
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
2045
|
+
r10.extend(Value0)
|
2046
|
+
else
|
2047
|
+
@index = i10
|
2048
|
+
r10 = nil
|
2049
|
+
end
|
2050
|
+
if r10
|
2051
|
+
r9 = r10
|
2052
|
+
else
|
2053
|
+
r9 = instantiate_node(SyntaxNode,input, index...index)
|
2054
|
+
end
|
2055
|
+
s8 << r9
|
2056
|
+
if r9
|
2057
|
+
r13 = _nt_class_name
|
2058
|
+
s8 << r13
|
2059
|
+
end
|
2060
|
+
if s8.last
|
2061
|
+
r8 = instantiate_node(NodeAsValue,input, i8...index, s8)
|
2062
|
+
r8.extend(Value1)
|
2063
|
+
else
|
2064
|
+
@index = i8
|
2065
|
+
r8 = nil
|
2066
|
+
end
|
1750
2067
|
if r8
|
1751
2068
|
r0 = r8
|
1752
2069
|
else
|
1753
|
-
|
1754
|
-
if
|
1755
|
-
|
2070
|
+
i14, s14 = index, []
|
2071
|
+
if has_terminal?('(', false, index)
|
2072
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2073
|
+
@index += 1
|
1756
2074
|
else
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
2075
|
+
terminal_parse_failure('(')
|
2076
|
+
r15 = nil
|
2077
|
+
end
|
2078
|
+
s14 << r15
|
2079
|
+
if r15
|
2080
|
+
r17 = _nt_sp
|
2081
|
+
if r17
|
2082
|
+
r16 = r17
|
1760
2083
|
else
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
r15 = nil
|
1772
|
-
end
|
1773
|
-
s13 << r15
|
1774
|
-
end
|
1775
|
-
if s13.last
|
1776
|
-
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
1777
|
-
r13.extend(Value0)
|
1778
|
-
else
|
1779
|
-
@index = i13
|
1780
|
-
r13 = nil
|
1781
|
-
end
|
1782
|
-
if r13
|
1783
|
-
r12 = r13
|
1784
|
-
else
|
1785
|
-
r12 = instantiate_node(SyntaxNode,input, index...index)
|
1786
|
-
end
|
1787
|
-
s11 << r12
|
1788
|
-
if r12
|
1789
|
-
r16 = _nt_class_name
|
1790
|
-
s11 << r16
|
1791
|
-
end
|
1792
|
-
if s11.last
|
1793
|
-
r11 = instantiate_node(NodeAsValue,input, i11...index, s11)
|
1794
|
-
r11.extend(Value1)
|
1795
|
-
else
|
1796
|
-
@index = i11
|
1797
|
-
r11 = nil
|
1798
|
-
end
|
1799
|
-
if r11
|
1800
|
-
r0 = r11
|
1801
|
-
else
|
1802
|
-
i17, s17 = index, []
|
1803
|
-
if has_terminal?('(', false, index)
|
1804
|
-
r18 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1805
|
-
@index += 1
|
2084
|
+
r16 = instantiate_node(SyntaxNode,input, index...index)
|
2085
|
+
end
|
2086
|
+
s14 << r16
|
2087
|
+
if r16
|
2088
|
+
r18 = _nt_expression
|
2089
|
+
s14 << r18
|
2090
|
+
if r18
|
2091
|
+
r20 = _nt_sp
|
2092
|
+
if r20
|
2093
|
+
r19 = r20
|
1806
2094
|
else
|
1807
|
-
|
1808
|
-
r18 = nil
|
2095
|
+
r19 = instantiate_node(SyntaxNode,input, index...index)
|
1809
2096
|
end
|
1810
|
-
|
1811
|
-
if
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
2097
|
+
s14 << r19
|
2098
|
+
if r19
|
2099
|
+
if has_terminal?(')', false, index)
|
2100
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2101
|
+
@index += 1
|
1815
2102
|
else
|
1816
|
-
|
2103
|
+
terminal_parse_failure(')')
|
2104
|
+
r21 = nil
|
1817
2105
|
end
|
1818
|
-
|
1819
|
-
if r19
|
1820
|
-
r21 = _nt_expression
|
1821
|
-
s17 << r21
|
1822
|
-
if r21
|
1823
|
-
r23 = _nt_sp
|
1824
|
-
if r23
|
1825
|
-
r22 = r23
|
1826
|
-
else
|
1827
|
-
r22 = instantiate_node(SyntaxNode,input, index...index)
|
1828
|
-
end
|
1829
|
-
s17 << r22
|
1830
|
-
if r22
|
1831
|
-
if has_terminal?(')', false, index)
|
1832
|
-
r24 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1833
|
-
@index += 1
|
1834
|
-
else
|
1835
|
-
terminal_parse_failure(')')
|
1836
|
-
r24 = nil
|
1837
|
-
end
|
1838
|
-
s17 << r24
|
1839
|
-
end
|
1840
|
-
end
|
1841
|
-
end
|
1842
|
-
end
|
1843
|
-
if s17.last
|
1844
|
-
r17 = instantiate_node(Expr,input, i17...index, s17)
|
1845
|
-
r17.extend(Value2)
|
1846
|
-
else
|
1847
|
-
@index = i17
|
1848
|
-
r17 = nil
|
1849
|
-
end
|
1850
|
-
if r17
|
1851
|
-
r0 = r17
|
1852
|
-
else
|
1853
|
-
@index = i0
|
1854
|
-
r0 = nil
|
2106
|
+
s14 << r21
|
1855
2107
|
end
|
1856
2108
|
end
|
1857
2109
|
end
|
1858
2110
|
end
|
2111
|
+
if s14.last
|
2112
|
+
r14 = instantiate_node(Expr,input, i14...index, s14)
|
2113
|
+
r14.extend(Value2)
|
2114
|
+
else
|
2115
|
+
@index = i14
|
2116
|
+
r14 = nil
|
2117
|
+
end
|
2118
|
+
if r14
|
2119
|
+
r0 = r14
|
2120
|
+
else
|
2121
|
+
@index = i0
|
2122
|
+
r0 = nil
|
2123
|
+
end
|
1859
2124
|
end
|
1860
2125
|
end
|
1861
2126
|
end
|
@@ -1870,91 +2135,6 @@ module Delorean
|
|
1870
2135
|
r0
|
1871
2136
|
end
|
1872
2137
|
|
1873
|
-
module Fn0
|
1874
|
-
def fn
|
1875
|
-
elements[0]
|
1876
|
-
end
|
1877
|
-
|
1878
|
-
def args
|
1879
|
-
elements[3]
|
1880
|
-
end
|
1881
|
-
|
1882
|
-
end
|
1883
|
-
|
1884
|
-
def _nt_fn
|
1885
|
-
start_index = index
|
1886
|
-
if node_cache[:fn].has_key?(index)
|
1887
|
-
cached = node_cache[:fn][index]
|
1888
|
-
if cached
|
1889
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1890
|
-
@index = cached.interval.end
|
1891
|
-
end
|
1892
|
-
return cached
|
1893
|
-
end
|
1894
|
-
|
1895
|
-
i0, s0 = index, []
|
1896
|
-
r1 = _nt_fn_name
|
1897
|
-
s0 << r1
|
1898
|
-
if r1
|
1899
|
-
if has_terminal?('(', false, index)
|
1900
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1901
|
-
@index += 1
|
1902
|
-
else
|
1903
|
-
terminal_parse_failure('(')
|
1904
|
-
r2 = nil
|
1905
|
-
end
|
1906
|
-
s0 << r2
|
1907
|
-
if r2
|
1908
|
-
r4 = _nt_sp
|
1909
|
-
if r4
|
1910
|
-
r3 = r4
|
1911
|
-
else
|
1912
|
-
r3 = instantiate_node(SyntaxNode,input, index...index)
|
1913
|
-
end
|
1914
|
-
s0 << r3
|
1915
|
-
if r3
|
1916
|
-
r6 = _nt_fn_args
|
1917
|
-
if r6
|
1918
|
-
r5 = r6
|
1919
|
-
else
|
1920
|
-
r5 = instantiate_node(SyntaxNode,input, index...index)
|
1921
|
-
end
|
1922
|
-
s0 << r5
|
1923
|
-
if r5
|
1924
|
-
r8 = _nt_sp
|
1925
|
-
if r8
|
1926
|
-
r7 = r8
|
1927
|
-
else
|
1928
|
-
r7 = instantiate_node(SyntaxNode,input, index...index)
|
1929
|
-
end
|
1930
|
-
s0 << r7
|
1931
|
-
if r7
|
1932
|
-
if has_terminal?(')', false, index)
|
1933
|
-
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1934
|
-
@index += 1
|
1935
|
-
else
|
1936
|
-
terminal_parse_failure(')')
|
1937
|
-
r9 = nil
|
1938
|
-
end
|
1939
|
-
s0 << r9
|
1940
|
-
end
|
1941
|
-
end
|
1942
|
-
end
|
1943
|
-
end
|
1944
|
-
end
|
1945
|
-
if s0.last
|
1946
|
-
r0 = instantiate_node(Fn,input, i0...index, s0)
|
1947
|
-
r0.extend(Fn0)
|
1948
|
-
else
|
1949
|
-
@index = i0
|
1950
|
-
r0 = nil
|
1951
|
-
end
|
1952
|
-
|
1953
|
-
node_cache[:fn][start_index] = r0
|
1954
|
-
|
1955
|
-
r0
|
1956
|
-
end
|
1957
|
-
|
1958
2138
|
module FnArgs0
|
1959
2139
|
def args
|
1960
2140
|
elements[3]
|
@@ -2049,518 +2229,6 @@ module Delorean
|
|
2049
2229
|
r0
|
2050
2230
|
end
|
2051
2231
|
|
2052
|
-
module ModelFn0
|
2053
|
-
def m
|
2054
|
-
elements[0]
|
2055
|
-
end
|
2056
|
-
|
2057
|
-
def fn
|
2058
|
-
elements[2]
|
2059
|
-
end
|
2060
|
-
|
2061
|
-
end
|
2062
|
-
|
2063
|
-
module ModelFn1
|
2064
|
-
def m
|
2065
|
-
elements[0]
|
2066
|
-
end
|
2067
|
-
|
2068
|
-
def fn
|
2069
|
-
elements[2]
|
2070
|
-
end
|
2071
|
-
|
2072
|
-
def args
|
2073
|
-
elements[5]
|
2074
|
-
end
|
2075
|
-
|
2076
|
-
end
|
2077
|
-
|
2078
|
-
def _nt_model_fn
|
2079
|
-
start_index = index
|
2080
|
-
if node_cache[:model_fn].has_key?(index)
|
2081
|
-
cached = node_cache[:model_fn][index]
|
2082
|
-
if cached
|
2083
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2084
|
-
@index = cached.interval.end
|
2085
|
-
end
|
2086
|
-
return cached
|
2087
|
-
end
|
2088
|
-
|
2089
|
-
i0 = index
|
2090
|
-
i1, s1 = index, []
|
2091
|
-
r2 = _nt_model_name
|
2092
|
-
s1 << r2
|
2093
|
-
if r2
|
2094
|
-
if has_terminal?('.', false, index)
|
2095
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2096
|
-
@index += 1
|
2097
|
-
else
|
2098
|
-
terminal_parse_failure('.')
|
2099
|
-
r3 = nil
|
2100
|
-
end
|
2101
|
-
s1 << r3
|
2102
|
-
if r3
|
2103
|
-
r4 = _nt_identifier
|
2104
|
-
s1 << r4
|
2105
|
-
if r4
|
2106
|
-
if has_terminal?('(', false, index)
|
2107
|
-
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2108
|
-
@index += 1
|
2109
|
-
else
|
2110
|
-
terminal_parse_failure('(')
|
2111
|
-
r5 = nil
|
2112
|
-
end
|
2113
|
-
s1 << r5
|
2114
|
-
if r5
|
2115
|
-
r7 = _nt_sp
|
2116
|
-
if r7
|
2117
|
-
r6 = r7
|
2118
|
-
else
|
2119
|
-
r6 = instantiate_node(SyntaxNode,input, index...index)
|
2120
|
-
end
|
2121
|
-
s1 << r6
|
2122
|
-
if r6
|
2123
|
-
if has_terminal?(')', false, index)
|
2124
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2125
|
-
@index += 1
|
2126
|
-
else
|
2127
|
-
terminal_parse_failure(')')
|
2128
|
-
r8 = nil
|
2129
|
-
end
|
2130
|
-
s1 << r8
|
2131
|
-
end
|
2132
|
-
end
|
2133
|
-
end
|
2134
|
-
end
|
2135
|
-
end
|
2136
|
-
if s1.last
|
2137
|
-
r1 = instantiate_node(ModelFn,input, i1...index, s1)
|
2138
|
-
r1.extend(ModelFn0)
|
2139
|
-
else
|
2140
|
-
@index = i1
|
2141
|
-
r1 = nil
|
2142
|
-
end
|
2143
|
-
if r1
|
2144
|
-
r0 = r1
|
2145
|
-
else
|
2146
|
-
i9, s9 = index, []
|
2147
|
-
r10 = _nt_model_name
|
2148
|
-
s9 << r10
|
2149
|
-
if r10
|
2150
|
-
if has_terminal?('.', false, index)
|
2151
|
-
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2152
|
-
@index += 1
|
2153
|
-
else
|
2154
|
-
terminal_parse_failure('.')
|
2155
|
-
r11 = nil
|
2156
|
-
end
|
2157
|
-
s9 << r11
|
2158
|
-
if r11
|
2159
|
-
r12 = _nt_identifier
|
2160
|
-
s9 << r12
|
2161
|
-
if r12
|
2162
|
-
if has_terminal?('(', false, index)
|
2163
|
-
r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2164
|
-
@index += 1
|
2165
|
-
else
|
2166
|
-
terminal_parse_failure('(')
|
2167
|
-
r13 = nil
|
2168
|
-
end
|
2169
|
-
s9 << r13
|
2170
|
-
if r13
|
2171
|
-
r15 = _nt_sp
|
2172
|
-
if r15
|
2173
|
-
r14 = r15
|
2174
|
-
else
|
2175
|
-
r14 = instantiate_node(SyntaxNode,input, index...index)
|
2176
|
-
end
|
2177
|
-
s9 << r14
|
2178
|
-
if r14
|
2179
|
-
r16 = _nt_fn_args
|
2180
|
-
s9 << r16
|
2181
|
-
if r16
|
2182
|
-
r18 = _nt_sp
|
2183
|
-
if r18
|
2184
|
-
r17 = r18
|
2185
|
-
else
|
2186
|
-
r17 = instantiate_node(SyntaxNode,input, index...index)
|
2187
|
-
end
|
2188
|
-
s9 << r17
|
2189
|
-
if r17
|
2190
|
-
if has_terminal?(')', false, index)
|
2191
|
-
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2192
|
-
@index += 1
|
2193
|
-
else
|
2194
|
-
terminal_parse_failure(')')
|
2195
|
-
r19 = nil
|
2196
|
-
end
|
2197
|
-
s9 << r19
|
2198
|
-
end
|
2199
|
-
end
|
2200
|
-
end
|
2201
|
-
end
|
2202
|
-
end
|
2203
|
-
end
|
2204
|
-
end
|
2205
|
-
if s9.last
|
2206
|
-
r9 = instantiate_node(ModelFn,input, i9...index, s9)
|
2207
|
-
r9.extend(ModelFn1)
|
2208
|
-
else
|
2209
|
-
@index = i9
|
2210
|
-
r9 = nil
|
2211
|
-
end
|
2212
|
-
if r9
|
2213
|
-
r0 = r9
|
2214
|
-
else
|
2215
|
-
@index = i0
|
2216
|
-
r0 = nil
|
2217
|
-
end
|
2218
|
-
end
|
2219
|
-
|
2220
|
-
node_cache[:model_fn][start_index] = r0
|
2221
|
-
|
2222
|
-
r0
|
2223
|
-
end
|
2224
|
-
|
2225
|
-
module ModelName0
|
2226
|
-
def model_name
|
2227
|
-
elements[1]
|
2228
|
-
end
|
2229
|
-
end
|
2230
|
-
|
2231
|
-
module ModelName1
|
2232
|
-
def class_name
|
2233
|
-
elements[0]
|
2234
|
-
end
|
2235
|
-
|
2236
|
-
end
|
2237
|
-
|
2238
|
-
def _nt_model_name
|
2239
|
-
start_index = index
|
2240
|
-
if node_cache[:model_name].has_key?(index)
|
2241
|
-
cached = node_cache[:model_name][index]
|
2242
|
-
if cached
|
2243
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2244
|
-
@index = cached.interval.end
|
2245
|
-
end
|
2246
|
-
return cached
|
2247
|
-
end
|
2248
|
-
|
2249
|
-
i0, s0 = index, []
|
2250
|
-
r1 = _nt_class_name
|
2251
|
-
s0 << r1
|
2252
|
-
if r1
|
2253
|
-
i3, s3 = index, []
|
2254
|
-
if has_terminal?('::', false, index)
|
2255
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2256
|
-
@index += 2
|
2257
|
-
else
|
2258
|
-
terminal_parse_failure('::')
|
2259
|
-
r4 = nil
|
2260
|
-
end
|
2261
|
-
s3 << r4
|
2262
|
-
if r4
|
2263
|
-
r5 = _nt_model_name
|
2264
|
-
s3 << r5
|
2265
|
-
end
|
2266
|
-
if s3.last
|
2267
|
-
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2268
|
-
r3.extend(ModelName0)
|
2269
|
-
else
|
2270
|
-
@index = i3
|
2271
|
-
r3 = nil
|
2272
|
-
end
|
2273
|
-
if r3
|
2274
|
-
r2 = r3
|
2275
|
-
else
|
2276
|
-
r2 = instantiate_node(SyntaxNode,input, index...index)
|
2277
|
-
end
|
2278
|
-
s0 << r2
|
2279
|
-
end
|
2280
|
-
if s0.last
|
2281
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2282
|
-
r0.extend(ModelName1)
|
2283
|
-
else
|
2284
|
-
@index = i0
|
2285
|
-
r0 = nil
|
2286
|
-
end
|
2287
|
-
|
2288
|
-
node_cache[:model_name][start_index] = r0
|
2289
|
-
|
2290
|
-
r0
|
2291
|
-
end
|
2292
|
-
|
2293
|
-
module FnName0
|
2294
|
-
end
|
2295
|
-
|
2296
|
-
def _nt_fn_name
|
2297
|
-
start_index = index
|
2298
|
-
if node_cache[:fn_name].has_key?(index)
|
2299
|
-
cached = node_cache[:fn_name][index]
|
2300
|
-
if cached
|
2301
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2302
|
-
@index = cached.interval.end
|
2303
|
-
end
|
2304
|
-
return cached
|
2305
|
-
end
|
2306
|
-
|
2307
|
-
i0, s0 = index, []
|
2308
|
-
if has_terminal?('\G[A-Z]', true, index)
|
2309
|
-
r1 = true
|
2310
|
-
@index += 1
|
2311
|
-
else
|
2312
|
-
r1 = nil
|
2313
|
-
end
|
2314
|
-
s0 << r1
|
2315
|
-
if r1
|
2316
|
-
s2, i2 = [], index
|
2317
|
-
loop do
|
2318
|
-
if has_terminal?('\G[A-Z0-9]', true, index)
|
2319
|
-
r3 = true
|
2320
|
-
@index += 1
|
2321
|
-
else
|
2322
|
-
r3 = nil
|
2323
|
-
end
|
2324
|
-
if r3
|
2325
|
-
s2 << r3
|
2326
|
-
else
|
2327
|
-
break
|
2328
|
-
end
|
2329
|
-
end
|
2330
|
-
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
2331
|
-
s0 << r2
|
2332
|
-
end
|
2333
|
-
if s0.last
|
2334
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2335
|
-
r0.extend(FnName0)
|
2336
|
-
else
|
2337
|
-
@index = i0
|
2338
|
-
r0 = nil
|
2339
|
-
end
|
2340
|
-
|
2341
|
-
node_cache[:fn_name][start_index] = r0
|
2342
|
-
|
2343
|
-
r0
|
2344
|
-
end
|
2345
|
-
|
2346
|
-
module ScriptCall0
|
2347
|
-
def m
|
2348
|
-
elements[0]
|
2349
|
-
end
|
2350
|
-
|
2351
|
-
end
|
2352
|
-
|
2353
|
-
module ScriptCall1
|
2354
|
-
def mod
|
2355
|
-
elements[1]
|
2356
|
-
end
|
2357
|
-
|
2358
|
-
def c
|
2359
|
-
elements[2]
|
2360
|
-
end
|
2361
|
-
|
2362
|
-
def al
|
2363
|
-
elements[5]
|
2364
|
-
end
|
2365
|
-
|
2366
|
-
end
|
2367
|
-
|
2368
|
-
module ScriptCall2
|
2369
|
-
def i
|
2370
|
-
elements[1]
|
2371
|
-
end
|
2372
|
-
|
2373
|
-
def al
|
2374
|
-
elements[4]
|
2375
|
-
end
|
2376
|
-
|
2377
|
-
end
|
2378
|
-
|
2379
|
-
def _nt_script_call
|
2380
|
-
start_index = index
|
2381
|
-
if node_cache[:script_call].has_key?(index)
|
2382
|
-
cached = node_cache[:script_call][index]
|
2383
|
-
if cached
|
2384
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2385
|
-
@index = cached.interval.end
|
2386
|
-
end
|
2387
|
-
return cached
|
2388
|
-
end
|
2389
|
-
|
2390
|
-
i0 = index
|
2391
|
-
i1, s1 = index, []
|
2392
|
-
if has_terminal?('@', false, index)
|
2393
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2394
|
-
@index += 1
|
2395
|
-
else
|
2396
|
-
terminal_parse_failure('@')
|
2397
|
-
r2 = nil
|
2398
|
-
end
|
2399
|
-
s1 << r2
|
2400
|
-
if r2
|
2401
|
-
i4, s4 = index, []
|
2402
|
-
r5 = _nt_class_name
|
2403
|
-
s4 << r5
|
2404
|
-
if r5
|
2405
|
-
if has_terminal?('::', false, index)
|
2406
|
-
r6 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2407
|
-
@index += 2
|
2408
|
-
else
|
2409
|
-
terminal_parse_failure('::')
|
2410
|
-
r6 = nil
|
2411
|
-
end
|
2412
|
-
s4 << r6
|
2413
|
-
end
|
2414
|
-
if s4.last
|
2415
|
-
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
2416
|
-
r4.extend(ScriptCall0)
|
2417
|
-
else
|
2418
|
-
@index = i4
|
2419
|
-
r4 = nil
|
2420
|
-
end
|
2421
|
-
if r4
|
2422
|
-
r3 = r4
|
2423
|
-
else
|
2424
|
-
r3 = instantiate_node(SyntaxNode,input, index...index)
|
2425
|
-
end
|
2426
|
-
s1 << r3
|
2427
|
-
if r3
|
2428
|
-
r7 = _nt_class_name
|
2429
|
-
s1 << r7
|
2430
|
-
if r7
|
2431
|
-
if has_terminal?('(', false, index)
|
2432
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2433
|
-
@index += 1
|
2434
|
-
else
|
2435
|
-
terminal_parse_failure('(')
|
2436
|
-
r8 = nil
|
2437
|
-
end
|
2438
|
-
s1 << r8
|
2439
|
-
if r8
|
2440
|
-
r10 = _nt_sp
|
2441
|
-
if r10
|
2442
|
-
r9 = r10
|
2443
|
-
else
|
2444
|
-
r9 = instantiate_node(SyntaxNode,input, index...index)
|
2445
|
-
end
|
2446
|
-
s1 << r9
|
2447
|
-
if r9
|
2448
|
-
r11 = _nt_kw_args
|
2449
|
-
s1 << r11
|
2450
|
-
if r11
|
2451
|
-
r13 = _nt_sp
|
2452
|
-
if r13
|
2453
|
-
r12 = r13
|
2454
|
-
else
|
2455
|
-
r12 = instantiate_node(SyntaxNode,input, index...index)
|
2456
|
-
end
|
2457
|
-
s1 << r12
|
2458
|
-
if r12
|
2459
|
-
if has_terminal?(')', false, index)
|
2460
|
-
r14 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2461
|
-
@index += 1
|
2462
|
-
else
|
2463
|
-
terminal_parse_failure(')')
|
2464
|
-
r14 = nil
|
2465
|
-
end
|
2466
|
-
s1 << r14
|
2467
|
-
end
|
2468
|
-
end
|
2469
|
-
end
|
2470
|
-
end
|
2471
|
-
end
|
2472
|
-
end
|
2473
|
-
end
|
2474
|
-
if s1.last
|
2475
|
-
r1 = instantiate_node(ScriptCallNode,input, i1...index, s1)
|
2476
|
-
r1.extend(ScriptCall1)
|
2477
|
-
else
|
2478
|
-
@index = i1
|
2479
|
-
r1 = nil
|
2480
|
-
end
|
2481
|
-
if r1
|
2482
|
-
r0 = r1
|
2483
|
-
else
|
2484
|
-
i15, s15 = index, []
|
2485
|
-
if has_terminal?('@', false, index)
|
2486
|
-
r16 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2487
|
-
@index += 1
|
2488
|
-
else
|
2489
|
-
terminal_parse_failure('@')
|
2490
|
-
r16 = nil
|
2491
|
-
end
|
2492
|
-
s15 << r16
|
2493
|
-
if r16
|
2494
|
-
r18 = _nt_identifier
|
2495
|
-
if r18
|
2496
|
-
r17 = r18
|
2497
|
-
else
|
2498
|
-
r17 = instantiate_node(SyntaxNode,input, index...index)
|
2499
|
-
end
|
2500
|
-
s15 << r17
|
2501
|
-
if r17
|
2502
|
-
if has_terminal?('(', false, index)
|
2503
|
-
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2504
|
-
@index += 1
|
2505
|
-
else
|
2506
|
-
terminal_parse_failure('(')
|
2507
|
-
r19 = nil
|
2508
|
-
end
|
2509
|
-
s15 << r19
|
2510
|
-
if r19
|
2511
|
-
r21 = _nt_sp
|
2512
|
-
if r21
|
2513
|
-
r20 = r21
|
2514
|
-
else
|
2515
|
-
r20 = instantiate_node(SyntaxNode,input, index...index)
|
2516
|
-
end
|
2517
|
-
s15 << r20
|
2518
|
-
if r20
|
2519
|
-
r22 = _nt_kw_args
|
2520
|
-
s15 << r22
|
2521
|
-
if r22
|
2522
|
-
r24 = _nt_sp
|
2523
|
-
if r24
|
2524
|
-
r23 = r24
|
2525
|
-
else
|
2526
|
-
r23 = instantiate_node(SyntaxNode,input, index...index)
|
2527
|
-
end
|
2528
|
-
s15 << r23
|
2529
|
-
if r23
|
2530
|
-
if has_terminal?(')', false, index)
|
2531
|
-
r25 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2532
|
-
@index += 1
|
2533
|
-
else
|
2534
|
-
terminal_parse_failure(')')
|
2535
|
-
r25 = nil
|
2536
|
-
end
|
2537
|
-
s15 << r25
|
2538
|
-
end
|
2539
|
-
end
|
2540
|
-
end
|
2541
|
-
end
|
2542
|
-
end
|
2543
|
-
end
|
2544
|
-
if s15.last
|
2545
|
-
r15 = instantiate_node(ScriptCall,input, i15...index, s15)
|
2546
|
-
r15.extend(ScriptCall2)
|
2547
|
-
else
|
2548
|
-
@index = i15
|
2549
|
-
r15 = nil
|
2550
|
-
end
|
2551
|
-
if r15
|
2552
|
-
r0 = r15
|
2553
|
-
else
|
2554
|
-
@index = i0
|
2555
|
-
r0 = nil
|
2556
|
-
end
|
2557
|
-
end
|
2558
|
-
|
2559
|
-
node_cache[:script_call][start_index] = r0
|
2560
|
-
|
2561
|
-
r0
|
2562
|
-
end
|
2563
|
-
|
2564
2232
|
module HashArgs0
|
2565
2233
|
def al
|
2566
2234
|
elements[3]
|
@@ -3237,7 +2905,7 @@ module Delorean
|
|
3237
2905
|
end
|
3238
2906
|
end
|
3239
2907
|
if s1.last
|
3240
|
-
r1 = instantiate_node(
|
2908
|
+
r1 = instantiate_node(DString,input, i1...index, s1)
|
3241
2909
|
r1.extend(String1)
|
3242
2910
|
else
|
3243
2911
|
@index = i1
|
@@ -3284,7 +2952,7 @@ module Delorean
|
|
3284
2952
|
end
|
3285
2953
|
end
|
3286
2954
|
if s11.last
|
3287
|
-
r11 = instantiate_node(
|
2955
|
+
r11 = instantiate_node(DString,input, i11...index, s11)
|
3288
2956
|
r11.extend(String2)
|
3289
2957
|
else
|
3290
2958
|
@index = i11
|