delorean_lang 0.3.26 → 0.3.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delorean/delorean.rb +127 -122
- data/lib/delorean/delorean.treetop +1 -1
- data/lib/delorean/nodes.rb +2 -2
- data/lib/delorean/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bfab39c7eb2f5b9b6e1d555a7619fc328bb35ba
|
4
|
+
data.tar.gz: 500fb6c1f12b2c6720cf44dc364050a8ba000af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25fa6a67fa25baa3a5df0cd3490a907d16450d9d99a03569b4183bff6f36c111720ba56d22dc5793ef1ff7877ec2c2170312254a01dcfc70e3c1947c5a361711
|
7
|
+
data.tar.gz: 31356b5b797cac7920c14e162422f6dcfb89b227ec5fe2b9e66236473418bbcfed3bb610b50fc620a1d32f95886cc9c9db6dcb5ade6641239de7b9a869f65310
|
data/lib/delorean/delorean.rb
CHANGED
@@ -584,25 +584,30 @@ module Delorean
|
|
584
584
|
end
|
585
585
|
s1 << r3
|
586
586
|
if r3
|
587
|
-
|
587
|
+
r6 = _nt_fn_args
|
588
|
+
if r6
|
589
|
+
r5 = r6
|
590
|
+
else
|
591
|
+
r5 = instantiate_node(SyntaxNode,input, index...index)
|
592
|
+
end
|
588
593
|
s1 << r5
|
589
594
|
if r5
|
590
|
-
|
591
|
-
if
|
592
|
-
|
595
|
+
r8 = _nt_sp
|
596
|
+
if r8
|
597
|
+
r7 = r8
|
593
598
|
else
|
594
|
-
|
599
|
+
r7 = instantiate_node(SyntaxNode,input, index...index)
|
595
600
|
end
|
596
|
-
s1 <<
|
597
|
-
if
|
601
|
+
s1 << r7
|
602
|
+
if r7
|
598
603
|
if (match_len = has_terminal?(')', false, index))
|
599
|
-
|
604
|
+
r9 = true
|
600
605
|
@index += match_len
|
601
606
|
else
|
602
607
|
terminal_parse_failure('\')\'')
|
603
|
-
|
608
|
+
r9 = nil
|
604
609
|
end
|
605
|
-
s1 <<
|
610
|
+
s1 << r9
|
606
611
|
end
|
607
612
|
end
|
608
613
|
end
|
@@ -618,109 +623,109 @@ module Delorean
|
|
618
623
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
619
624
|
r0 = r1
|
620
625
|
else
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
if
|
625
|
-
|
626
|
-
if
|
627
|
-
|
626
|
+
i10, s10 = index, []
|
627
|
+
r11 = _nt_unary_op
|
628
|
+
s10 << r11
|
629
|
+
if r11
|
630
|
+
r13 = _nt_sp
|
631
|
+
if r13
|
632
|
+
r12 = r13
|
628
633
|
else
|
629
|
-
|
634
|
+
r12 = instantiate_node(SyntaxNode,input, index...index)
|
630
635
|
end
|
631
|
-
|
632
|
-
if
|
633
|
-
|
634
|
-
|
636
|
+
s10 << r12
|
637
|
+
if r12
|
638
|
+
r14 = _nt_expression
|
639
|
+
s10 << r14
|
635
640
|
end
|
636
641
|
end
|
637
|
-
if
|
638
|
-
|
639
|
-
|
642
|
+
if s10.last
|
643
|
+
r10 = instantiate_node(UnOp,input, i10...index, s10)
|
644
|
+
r10.extend(Expression1)
|
640
645
|
else
|
641
|
-
@index =
|
642
|
-
|
646
|
+
@index = i10
|
647
|
+
r10 = nil
|
643
648
|
end
|
644
|
-
if
|
645
|
-
|
646
|
-
r0 =
|
649
|
+
if r10
|
650
|
+
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
651
|
+
r0 = r10
|
647
652
|
else
|
648
|
-
|
653
|
+
i15, s15 = index, []
|
649
654
|
if (match_len = has_terminal?('if', false, index))
|
650
|
-
|
655
|
+
r16 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
651
656
|
@index += match_len
|
652
657
|
else
|
653
658
|
terminal_parse_failure('\'if\'')
|
654
|
-
|
659
|
+
r16 = nil
|
655
660
|
end
|
656
|
-
|
657
|
-
if
|
658
|
-
|
659
|
-
if
|
660
|
-
|
661
|
+
s15 << r16
|
662
|
+
if r16
|
663
|
+
r18 = _nt_sp
|
664
|
+
if r18
|
665
|
+
r17 = r18
|
661
666
|
else
|
662
|
-
|
667
|
+
r17 = instantiate_node(SyntaxNode,input, index...index)
|
663
668
|
end
|
664
|
-
|
665
|
-
if
|
666
|
-
|
667
|
-
|
668
|
-
if
|
669
|
-
|
670
|
-
if
|
671
|
-
|
669
|
+
s15 << r17
|
670
|
+
if r17
|
671
|
+
r19 = _nt_expression
|
672
|
+
s15 << r19
|
673
|
+
if r19
|
674
|
+
r21 = _nt_sp
|
675
|
+
if r21
|
676
|
+
r20 = r21
|
672
677
|
else
|
673
|
-
|
678
|
+
r20 = instantiate_node(SyntaxNode,input, index...index)
|
674
679
|
end
|
675
|
-
|
676
|
-
if
|
680
|
+
s15 << r20
|
681
|
+
if r20
|
677
682
|
if (match_len = has_terminal?('then', false, index))
|
678
|
-
|
683
|
+
r22 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
679
684
|
@index += match_len
|
680
685
|
else
|
681
686
|
terminal_parse_failure('\'then\'')
|
682
|
-
|
687
|
+
r22 = nil
|
683
688
|
end
|
684
|
-
|
685
|
-
if
|
686
|
-
|
687
|
-
if
|
688
|
-
|
689
|
+
s15 << r22
|
690
|
+
if r22
|
691
|
+
r24 = _nt_sp
|
692
|
+
if r24
|
693
|
+
r23 = r24
|
689
694
|
else
|
690
|
-
|
695
|
+
r23 = instantiate_node(SyntaxNode,input, index...index)
|
691
696
|
end
|
692
|
-
|
693
|
-
if
|
694
|
-
|
695
|
-
|
696
|
-
if
|
697
|
-
|
698
|
-
if
|
699
|
-
|
697
|
+
s15 << r23
|
698
|
+
if r23
|
699
|
+
r25 = _nt_expression
|
700
|
+
s15 << r25
|
701
|
+
if r25
|
702
|
+
r27 = _nt_sp
|
703
|
+
if r27
|
704
|
+
r26 = r27
|
700
705
|
else
|
701
|
-
|
706
|
+
r26 = instantiate_node(SyntaxNode,input, index...index)
|
702
707
|
end
|
703
|
-
|
704
|
-
if
|
708
|
+
s15 << r26
|
709
|
+
if r26
|
705
710
|
if (match_len = has_terminal?('else', false, index))
|
706
|
-
|
711
|
+
r28 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
707
712
|
@index += match_len
|
708
713
|
else
|
709
714
|
terminal_parse_failure('\'else\'')
|
710
|
-
|
715
|
+
r28 = nil
|
711
716
|
end
|
712
|
-
|
713
|
-
if
|
714
|
-
|
715
|
-
if
|
716
|
-
|
717
|
+
s15 << r28
|
718
|
+
if r28
|
719
|
+
r30 = _nt_sp
|
720
|
+
if r30
|
721
|
+
r29 = r30
|
717
722
|
else
|
718
|
-
|
723
|
+
r29 = instantiate_node(SyntaxNode,input, index...index)
|
719
724
|
end
|
720
|
-
|
721
|
-
if
|
722
|
-
|
723
|
-
|
725
|
+
s15 << r29
|
726
|
+
if r29
|
727
|
+
r31 = _nt_expression
|
728
|
+
s15 << r31
|
724
729
|
end
|
725
730
|
end
|
726
731
|
end
|
@@ -731,61 +736,61 @@ module Delorean
|
|
731
736
|
end
|
732
737
|
end
|
733
738
|
end
|
734
|
-
if
|
735
|
-
|
736
|
-
|
739
|
+
if s15.last
|
740
|
+
r15 = instantiate_node(IfElse,input, i15...index, s15)
|
741
|
+
r15.extend(Expression2)
|
737
742
|
else
|
738
|
-
@index =
|
739
|
-
|
743
|
+
@index = i15
|
744
|
+
r15 = nil
|
740
745
|
end
|
741
|
-
if
|
742
|
-
|
743
|
-
r0 =
|
746
|
+
if r15
|
747
|
+
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
748
|
+
r0 = r15
|
744
749
|
else
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
if
|
749
|
-
|
750
|
-
if
|
751
|
-
|
750
|
+
i32, s32 = index, []
|
751
|
+
r33 = _nt_getattr_exp
|
752
|
+
s32 << r33
|
753
|
+
if r33
|
754
|
+
r35 = _nt_sp
|
755
|
+
if r35
|
756
|
+
r34 = r35
|
752
757
|
else
|
753
|
-
|
758
|
+
r34 = instantiate_node(SyntaxNode,input, index...index)
|
754
759
|
end
|
755
|
-
|
756
|
-
if
|
757
|
-
|
758
|
-
|
759
|
-
if
|
760
|
-
|
761
|
-
if
|
762
|
-
|
760
|
+
s32 << r34
|
761
|
+
if r34
|
762
|
+
r36 = _nt_binary_op
|
763
|
+
s32 << r36
|
764
|
+
if r36
|
765
|
+
r38 = _nt_sp
|
766
|
+
if r38
|
767
|
+
r37 = r38
|
763
768
|
else
|
764
|
-
|
769
|
+
r37 = instantiate_node(SyntaxNode,input, index...index)
|
765
770
|
end
|
766
|
-
|
767
|
-
if
|
768
|
-
|
769
|
-
|
771
|
+
s32 << r37
|
772
|
+
if r37
|
773
|
+
r39 = _nt_expression
|
774
|
+
s32 << r39
|
770
775
|
end
|
771
776
|
end
|
772
777
|
end
|
773
778
|
end
|
774
|
-
if
|
775
|
-
|
776
|
-
|
779
|
+
if s32.last
|
780
|
+
r32 = instantiate_node(BinOp,input, i32...index, s32)
|
781
|
+
r32.extend(Expression3)
|
777
782
|
else
|
778
|
-
@index =
|
779
|
-
|
783
|
+
@index = i32
|
784
|
+
r32 = nil
|
780
785
|
end
|
781
|
-
if
|
782
|
-
|
783
|
-
r0 =
|
786
|
+
if r32
|
787
|
+
r32 = SyntaxNode.new(input, (index-1)...index) if r32 == true
|
788
|
+
r0 = r32
|
784
789
|
else
|
785
|
-
|
786
|
-
if
|
787
|
-
|
788
|
-
r0 =
|
790
|
+
r40 = _nt_getattr_exp
|
791
|
+
if r40
|
792
|
+
r40 = SyntaxNode.new(input, (index-1)...index) if r40 == true
|
793
|
+
r0 = r40
|
789
794
|
else
|
790
795
|
@index = i0
|
791
796
|
r0 = nil
|
data/lib/delorean/nodes.rb
CHANGED
@@ -194,11 +194,11 @@ eos
|
|
194
194
|
# hacky, for backwards compatibility
|
195
195
|
class ErrorOp < SNode
|
196
196
|
def check(context, *)
|
197
|
-
args.check(context)
|
197
|
+
args.text_value=='' ? [] : args.check(context)
|
198
198
|
end
|
199
199
|
|
200
200
|
def rewrite(context, *)
|
201
|
-
"_err(#{args.rewrite(context)})"
|
201
|
+
args.text_value!='' ? "_err(#{args.rewrite(context)})" : "binding.pry; 0"
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
data/lib/delorean/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delorean_lang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|