delorean_lang 0.3.7 → 0.3.8
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/delorean.gemspec +1 -1
- data/lib/delorean/delorean.rb +295 -370
- data/lib/delorean/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f84252e434574c4818888ea07ea617d1f4766fe
|
|
4
|
+
data.tar.gz: 5ff551551c97120833357e2c9efbd614fa2cf8e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61e69948cf64fd5f480f37c7eced6b2d5de22dc9c8e427bff91dea6b0a8d4256185fd52c5c4571adcc3e0712a9dff963ce504d099a84db0b3d2c5b2286736b61
|
|
7
|
+
data.tar.gz: f74d5a623f97f109c998335f4427b2af1dcde43da190c019407933c12de62c07c8cc7178e587fd20c602c60c65ce1daa6746ef5bba2d973497dcbbc03baf0b3f
|
data/delorean.gemspec
CHANGED
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.licenses = ['MIT']
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
gem.add_dependency "treetop", "~> 1.4"
|
|
19
|
+
gem.add_dependency "treetop", "~> 1.4.8"
|
|
20
20
|
gem.add_dependency "activerecord", "~> 3.2"
|
|
21
21
|
gem.add_development_dependency "rspec", '~> 2.10'
|
|
22
22
|
gem.add_development_dependency "sqlite3", '~> 1.3'
|
data/lib/delorean/delorean.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Delorean
|
|
|
23
23
|
if node_cache[:line].has_key?(index)
|
|
24
24
|
cached = node_cache[:line][index]
|
|
25
25
|
if cached
|
|
26
|
-
|
|
26
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
27
27
|
@index = cached.interval.end
|
|
28
28
|
end
|
|
29
29
|
return cached
|
|
@@ -42,9 +42,9 @@ module Delorean
|
|
|
42
42
|
s0 << r2
|
|
43
43
|
if r2
|
|
44
44
|
i5, s5 = index, []
|
|
45
|
-
if
|
|
46
|
-
r6 =
|
|
47
|
-
@index +=
|
|
45
|
+
if has_terminal?('#', false, index)
|
|
46
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
47
|
+
@index += 1
|
|
48
48
|
else
|
|
49
49
|
terminal_parse_failure('#')
|
|
50
50
|
r6 = nil
|
|
@@ -54,7 +54,7 @@ module Delorean
|
|
|
54
54
|
s7, i7 = [], index
|
|
55
55
|
loop do
|
|
56
56
|
if index < input_length
|
|
57
|
-
r8 =
|
|
57
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
58
58
|
@index += 1
|
|
59
59
|
else
|
|
60
60
|
terminal_parse_failure("any character")
|
|
@@ -179,7 +179,7 @@ module Delorean
|
|
|
179
179
|
if node_cache[:formula].has_key?(index)
|
|
180
180
|
cached = node_cache[:formula][index]
|
|
181
181
|
if cached
|
|
182
|
-
|
|
182
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
183
183
|
@index = cached.interval.end
|
|
184
184
|
end
|
|
185
185
|
return cached
|
|
@@ -201,9 +201,9 @@ module Delorean
|
|
|
201
201
|
end
|
|
202
202
|
s1 << r4
|
|
203
203
|
if r4
|
|
204
|
-
if
|
|
205
|
-
r6 = instantiate_node(SyntaxNode,input, index...(index +
|
|
206
|
-
@index +=
|
|
204
|
+
if has_terminal?('=?', false, index)
|
|
205
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
206
|
+
@index += 2
|
|
207
207
|
else
|
|
208
208
|
terminal_parse_failure('=?')
|
|
209
209
|
r6 = nil
|
|
@@ -233,7 +233,6 @@ module Delorean
|
|
|
233
233
|
r1 = nil
|
|
234
234
|
end
|
|
235
235
|
if r1
|
|
236
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
237
236
|
r0 = r1
|
|
238
237
|
else
|
|
239
238
|
i10, s10 = index, []
|
|
@@ -251,9 +250,9 @@ module Delorean
|
|
|
251
250
|
end
|
|
252
251
|
s10 << r13
|
|
253
252
|
if r13
|
|
254
|
-
if
|
|
255
|
-
r15 = instantiate_node(SyntaxNode,input, index...(index +
|
|
256
|
-
@index +=
|
|
253
|
+
if has_terminal?('=?', false, index)
|
|
254
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
255
|
+
@index += 2
|
|
257
256
|
else
|
|
258
257
|
terminal_parse_failure('=?')
|
|
259
258
|
r15 = nil
|
|
@@ -270,7 +269,6 @@ module Delorean
|
|
|
270
269
|
r10 = nil
|
|
271
270
|
end
|
|
272
271
|
if r10
|
|
273
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
274
272
|
r0 = r10
|
|
275
273
|
else
|
|
276
274
|
i16, s16 = index, []
|
|
@@ -288,9 +286,9 @@ module Delorean
|
|
|
288
286
|
end
|
|
289
287
|
s16 << r19
|
|
290
288
|
if r19
|
|
291
|
-
if
|
|
292
|
-
r21 =
|
|
293
|
-
@index +=
|
|
289
|
+
if has_terminal?('=', false, index)
|
|
290
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
291
|
+
@index += 1
|
|
294
292
|
else
|
|
295
293
|
terminal_parse_failure('=')
|
|
296
294
|
r21 = nil
|
|
@@ -320,16 +318,15 @@ module Delorean
|
|
|
320
318
|
r16 = nil
|
|
321
319
|
end
|
|
322
320
|
if r16
|
|
323
|
-
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
|
324
321
|
r0 = r16
|
|
325
322
|
else
|
|
326
323
|
i25, s25 = index, []
|
|
327
324
|
r26 = _nt_class_name
|
|
328
325
|
s25 << r26
|
|
329
326
|
if r26
|
|
330
|
-
if
|
|
331
|
-
r27 =
|
|
332
|
-
@index +=
|
|
327
|
+
if has_terminal?(':', false, index)
|
|
328
|
+
r27 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
329
|
+
@index += 1
|
|
333
330
|
else
|
|
334
331
|
terminal_parse_failure(':')
|
|
335
332
|
r27 = nil
|
|
@@ -348,9 +345,9 @@ module Delorean
|
|
|
348
345
|
r32 = _nt_class_name
|
|
349
346
|
s31 << r32
|
|
350
347
|
if r32
|
|
351
|
-
if
|
|
352
|
-
r33 = instantiate_node(SyntaxNode,input, index...(index +
|
|
353
|
-
@index +=
|
|
348
|
+
if has_terminal?('::', false, index)
|
|
349
|
+
r33 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
350
|
+
@index += 2
|
|
354
351
|
else
|
|
355
352
|
terminal_parse_failure('::')
|
|
356
353
|
r33 = nil
|
|
@@ -385,16 +382,15 @@ module Delorean
|
|
|
385
382
|
r25 = nil
|
|
386
383
|
end
|
|
387
384
|
if r25
|
|
388
|
-
r25 = SyntaxNode.new(input, (index-1)...index) if r25 == true
|
|
389
385
|
r0 = r25
|
|
390
386
|
else
|
|
391
387
|
i35, s35 = index, []
|
|
392
388
|
r36 = _nt_class_name
|
|
393
389
|
s35 << r36
|
|
394
390
|
if r36
|
|
395
|
-
if
|
|
396
|
-
r37 =
|
|
397
|
-
@index +=
|
|
391
|
+
if has_terminal?(':', false, index)
|
|
392
|
+
r37 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
393
|
+
@index += 1
|
|
398
394
|
else
|
|
399
395
|
terminal_parse_failure(':')
|
|
400
396
|
r37 = nil
|
|
@@ -409,13 +405,12 @@ module Delorean
|
|
|
409
405
|
r35 = nil
|
|
410
406
|
end
|
|
411
407
|
if r35
|
|
412
|
-
r35 = SyntaxNode.new(input, (index-1)...index) if r35 == true
|
|
413
408
|
r0 = r35
|
|
414
409
|
else
|
|
415
410
|
i38, s38 = index, []
|
|
416
|
-
if
|
|
417
|
-
r39 = instantiate_node(SyntaxNode,input, index...(index +
|
|
418
|
-
@index +=
|
|
411
|
+
if has_terminal?('import', false, index)
|
|
412
|
+
r39 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
|
413
|
+
@index += 6
|
|
419
414
|
else
|
|
420
415
|
terminal_parse_failure('import')
|
|
421
416
|
r39 = nil
|
|
@@ -437,7 +432,6 @@ module Delorean
|
|
|
437
432
|
r38 = nil
|
|
438
433
|
end
|
|
439
434
|
if r38
|
|
440
|
-
r38 = SyntaxNode.new(input, (index-1)...index) if r38 == true
|
|
441
435
|
r0 = r38
|
|
442
436
|
else
|
|
443
437
|
@index = i0
|
|
@@ -462,29 +456,27 @@ module Delorean
|
|
|
462
456
|
if node_cache[:class_name].has_key?(index)
|
|
463
457
|
cached = node_cache[:class_name][index]
|
|
464
458
|
if cached
|
|
465
|
-
|
|
459
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
466
460
|
@index = cached.interval.end
|
|
467
461
|
end
|
|
468
462
|
return cached
|
|
469
463
|
end
|
|
470
464
|
|
|
471
465
|
i0, s0 = index, []
|
|
472
|
-
if has_terminal?(
|
|
466
|
+
if has_terminal?('\G[A-Z]', true, index)
|
|
473
467
|
r1 = true
|
|
474
468
|
@index += 1
|
|
475
469
|
else
|
|
476
|
-
terminal_parse_failure('[A-Z]')
|
|
477
470
|
r1 = nil
|
|
478
471
|
end
|
|
479
472
|
s0 << r1
|
|
480
473
|
if r1
|
|
481
474
|
s2, i2 = [], index
|
|
482
475
|
loop do
|
|
483
|
-
if has_terminal?(
|
|
476
|
+
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
|
484
477
|
r3 = true
|
|
485
478
|
@index += 1
|
|
486
479
|
else
|
|
487
|
-
terminal_parse_failure('[a-zA-Z0-9_]')
|
|
488
480
|
r3 = nil
|
|
489
481
|
end
|
|
490
482
|
if r3
|
|
@@ -559,7 +551,7 @@ module Delorean
|
|
|
559
551
|
if node_cache[:expression].has_key?(index)
|
|
560
552
|
cached = node_cache[:expression][index]
|
|
561
553
|
if cached
|
|
562
|
-
|
|
554
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
563
555
|
@index = cached.interval.end
|
|
564
556
|
end
|
|
565
557
|
return cached
|
|
@@ -567,9 +559,9 @@ module Delorean
|
|
|
567
559
|
|
|
568
560
|
i0 = index
|
|
569
561
|
i1, s1 = index, []
|
|
570
|
-
if
|
|
571
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index +
|
|
572
|
-
@index +=
|
|
562
|
+
if has_terminal?('ERR(', false, index)
|
|
563
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
564
|
+
@index += 4
|
|
573
565
|
else
|
|
574
566
|
terminal_parse_failure('ERR(')
|
|
575
567
|
r2 = nil
|
|
@@ -595,9 +587,9 @@ module Delorean
|
|
|
595
587
|
end
|
|
596
588
|
s1 << r6
|
|
597
589
|
if r6
|
|
598
|
-
if
|
|
599
|
-
r8 =
|
|
600
|
-
@index +=
|
|
590
|
+
if has_terminal?(')', false, index)
|
|
591
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
592
|
+
@index += 1
|
|
601
593
|
else
|
|
602
594
|
terminal_parse_failure(')')
|
|
603
595
|
r8 = nil
|
|
@@ -615,7 +607,6 @@ module Delorean
|
|
|
615
607
|
r1 = nil
|
|
616
608
|
end
|
|
617
609
|
if r1
|
|
618
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
619
610
|
r0 = r1
|
|
620
611
|
else
|
|
621
612
|
i9, s9 = index, []
|
|
@@ -642,13 +633,12 @@ module Delorean
|
|
|
642
633
|
r9 = nil
|
|
643
634
|
end
|
|
644
635
|
if r9
|
|
645
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
646
636
|
r0 = r9
|
|
647
637
|
else
|
|
648
638
|
i14, s14 = index, []
|
|
649
|
-
if
|
|
650
|
-
r15 = instantiate_node(SyntaxNode,input, index...(index +
|
|
651
|
-
@index +=
|
|
639
|
+
if has_terminal?('if', false, index)
|
|
640
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
641
|
+
@index += 2
|
|
652
642
|
else
|
|
653
643
|
terminal_parse_failure('if')
|
|
654
644
|
r15 = nil
|
|
@@ -674,9 +664,9 @@ module Delorean
|
|
|
674
664
|
end
|
|
675
665
|
s14 << r19
|
|
676
666
|
if r19
|
|
677
|
-
if
|
|
678
|
-
r21 = instantiate_node(SyntaxNode,input, index...(index +
|
|
679
|
-
@index +=
|
|
667
|
+
if has_terminal?('then', false, index)
|
|
668
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
669
|
+
@index += 4
|
|
680
670
|
else
|
|
681
671
|
terminal_parse_failure('then')
|
|
682
672
|
r21 = nil
|
|
@@ -702,9 +692,9 @@ module Delorean
|
|
|
702
692
|
end
|
|
703
693
|
s14 << r25
|
|
704
694
|
if r25
|
|
705
|
-
if
|
|
706
|
-
r27 = instantiate_node(SyntaxNode,input, index...(index +
|
|
707
|
-
@index +=
|
|
695
|
+
if has_terminal?('else', false, index)
|
|
696
|
+
r27 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
697
|
+
@index += 4
|
|
708
698
|
else
|
|
709
699
|
terminal_parse_failure('else')
|
|
710
700
|
r27 = nil
|
|
@@ -739,7 +729,6 @@ module Delorean
|
|
|
739
729
|
r14 = nil
|
|
740
730
|
end
|
|
741
731
|
if r14
|
|
742
|
-
r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
|
|
743
732
|
r0 = r14
|
|
744
733
|
else
|
|
745
734
|
i31, s31 = index, []
|
|
@@ -779,12 +768,10 @@ module Delorean
|
|
|
779
768
|
r31 = nil
|
|
780
769
|
end
|
|
781
770
|
if r31
|
|
782
|
-
r31 = SyntaxNode.new(input, (index-1)...index) if r31 == true
|
|
783
771
|
r0 = r31
|
|
784
772
|
else
|
|
785
773
|
r39 = _nt_getattr_exp
|
|
786
774
|
if r39
|
|
787
|
-
r39 = SyntaxNode.new(input, (index-1)...index) if r39 == true
|
|
788
775
|
r0 = r39
|
|
789
776
|
else
|
|
790
777
|
@index = i0
|
|
@@ -815,7 +802,7 @@ module Delorean
|
|
|
815
802
|
if node_cache[:getattr_exp].has_key?(index)
|
|
816
803
|
cached = node_cache[:getattr_exp][index]
|
|
817
804
|
if cached
|
|
818
|
-
|
|
805
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
819
806
|
@index = cached.interval.end
|
|
820
807
|
end
|
|
821
808
|
return cached
|
|
@@ -837,12 +824,10 @@ module Delorean
|
|
|
837
824
|
r1 = nil
|
|
838
825
|
end
|
|
839
826
|
if r1
|
|
840
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
841
827
|
r0 = r1
|
|
842
828
|
else
|
|
843
829
|
r4 = _nt_value
|
|
844
830
|
if r4
|
|
845
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
846
831
|
r0 = r4
|
|
847
832
|
else
|
|
848
833
|
@index = i0
|
|
@@ -870,7 +855,7 @@ module Delorean
|
|
|
870
855
|
if node_cache[:dotted].has_key?(index)
|
|
871
856
|
cached = node_cache[:dotted][index]
|
|
872
857
|
if cached
|
|
873
|
-
|
|
858
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
874
859
|
@index = cached.interval.end
|
|
875
860
|
end
|
|
876
861
|
return cached
|
|
@@ -937,7 +922,7 @@ module Delorean
|
|
|
937
922
|
if node_cache[:dot_exp].has_key?(index)
|
|
938
923
|
cached = node_cache[:dot_exp][index]
|
|
939
924
|
if cached
|
|
940
|
-
|
|
925
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
941
926
|
@index = cached.interval.end
|
|
942
927
|
end
|
|
943
928
|
return cached
|
|
@@ -945,9 +930,9 @@ module Delorean
|
|
|
945
930
|
|
|
946
931
|
i0 = index
|
|
947
932
|
i1, s1 = index, []
|
|
948
|
-
if
|
|
949
|
-
r2 =
|
|
950
|
-
@index +=
|
|
933
|
+
if has_terminal?('[', false, index)
|
|
934
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
935
|
+
@index += 1
|
|
951
936
|
else
|
|
952
937
|
terminal_parse_failure('[')
|
|
953
938
|
r2 = nil
|
|
@@ -973,9 +958,9 @@ module Delorean
|
|
|
973
958
|
end
|
|
974
959
|
s1 << r6
|
|
975
960
|
if r6
|
|
976
|
-
if
|
|
977
|
-
r8 =
|
|
978
|
-
@index +=
|
|
961
|
+
if has_terminal?(']', false, index)
|
|
962
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
963
|
+
@index += 1
|
|
979
964
|
else
|
|
980
965
|
terminal_parse_failure(']')
|
|
981
966
|
r8 = nil
|
|
@@ -993,13 +978,12 @@ module Delorean
|
|
|
993
978
|
r1 = nil
|
|
994
979
|
end
|
|
995
980
|
if r1
|
|
996
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
997
981
|
r0 = r1
|
|
998
982
|
else
|
|
999
983
|
i9, s9 = index, []
|
|
1000
|
-
if
|
|
1001
|
-
r10 =
|
|
1002
|
-
@index +=
|
|
984
|
+
if has_terminal?('(', false, index)
|
|
985
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
986
|
+
@index += 1
|
|
1003
987
|
else
|
|
1004
988
|
terminal_parse_failure('(')
|
|
1005
989
|
r10 = nil
|
|
@@ -1030,9 +1014,9 @@ module Delorean
|
|
|
1030
1014
|
end
|
|
1031
1015
|
s9 << r15
|
|
1032
1016
|
if r15
|
|
1033
|
-
if
|
|
1034
|
-
r17 =
|
|
1035
|
-
@index +=
|
|
1017
|
+
if has_terminal?(')', false, index)
|
|
1018
|
+
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1019
|
+
@index += 1
|
|
1036
1020
|
else
|
|
1037
1021
|
terminal_parse_failure(')')
|
|
1038
1022
|
r17 = nil
|
|
@@ -1050,13 +1034,12 @@ module Delorean
|
|
|
1050
1034
|
r9 = nil
|
|
1051
1035
|
end
|
|
1052
1036
|
if r9
|
|
1053
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
1054
1037
|
r0 = r9
|
|
1055
1038
|
else
|
|
1056
1039
|
i18, s18 = index, []
|
|
1057
|
-
if
|
|
1058
|
-
r19 =
|
|
1059
|
-
@index +=
|
|
1040
|
+
if has_terminal?('.', false, index)
|
|
1041
|
+
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1042
|
+
@index += 1
|
|
1060
1043
|
else
|
|
1061
1044
|
terminal_parse_failure('.')
|
|
1062
1045
|
r19 = nil
|
|
@@ -1074,9 +1057,9 @@ module Delorean
|
|
|
1074
1057
|
r22 = _nt_identifier
|
|
1075
1058
|
s18 << r22
|
|
1076
1059
|
if r22
|
|
1077
|
-
if
|
|
1078
|
-
r23 =
|
|
1079
|
-
@index +=
|
|
1060
|
+
if has_terminal?('(', false, index)
|
|
1061
|
+
r23 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1062
|
+
@index += 1
|
|
1080
1063
|
else
|
|
1081
1064
|
terminal_parse_failure('(')
|
|
1082
1065
|
r23 = nil
|
|
@@ -1107,9 +1090,9 @@ module Delorean
|
|
|
1107
1090
|
end
|
|
1108
1091
|
s18 << r28
|
|
1109
1092
|
if r28
|
|
1110
|
-
if
|
|
1111
|
-
r30 =
|
|
1112
|
-
@index +=
|
|
1093
|
+
if has_terminal?(')', false, index)
|
|
1094
|
+
r30 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1095
|
+
@index += 1
|
|
1113
1096
|
else
|
|
1114
1097
|
terminal_parse_failure(')')
|
|
1115
1098
|
r30 = nil
|
|
@@ -1130,13 +1113,12 @@ module Delorean
|
|
|
1130
1113
|
r18 = nil
|
|
1131
1114
|
end
|
|
1132
1115
|
if r18
|
|
1133
|
-
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
|
1134
1116
|
r0 = r18
|
|
1135
1117
|
else
|
|
1136
1118
|
i31, s31 = index, []
|
|
1137
|
-
if
|
|
1138
|
-
r32 =
|
|
1139
|
-
@index +=
|
|
1119
|
+
if has_terminal?('.', false, index)
|
|
1120
|
+
r32 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1121
|
+
@index += 1
|
|
1140
1122
|
else
|
|
1141
1123
|
terminal_parse_failure('.')
|
|
1142
1124
|
r32 = nil
|
|
@@ -1154,12 +1136,10 @@ module Delorean
|
|
|
1154
1136
|
i35 = index
|
|
1155
1137
|
r36 = _nt_identifier
|
|
1156
1138
|
if r36
|
|
1157
|
-
r36 = SyntaxNode.new(input, (index-1)...index) if r36 == true
|
|
1158
1139
|
r35 = r36
|
|
1159
1140
|
else
|
|
1160
1141
|
r37 = _nt_integer
|
|
1161
1142
|
if r37
|
|
1162
|
-
r37 = SyntaxNode.new(input, (index-1)...index) if r37 == true
|
|
1163
1143
|
r35 = r37
|
|
1164
1144
|
else
|
|
1165
1145
|
@index = i35
|
|
@@ -1177,7 +1157,6 @@ module Delorean
|
|
|
1177
1157
|
r31 = nil
|
|
1178
1158
|
end
|
|
1179
1159
|
if r31
|
|
1180
|
-
r31 = SyntaxNode.new(input, (index-1)...index) if r31 == true
|
|
1181
1160
|
r0 = r31
|
|
1182
1161
|
else
|
|
1183
1162
|
@index = i0
|
|
@@ -1213,7 +1192,7 @@ module Delorean
|
|
|
1213
1192
|
if node_cache[:unpack_args].has_key?(index)
|
|
1214
1193
|
cached = node_cache[:unpack_args][index]
|
|
1215
1194
|
if cached
|
|
1216
|
-
|
|
1195
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1217
1196
|
@index = cached.interval.end
|
|
1218
1197
|
end
|
|
1219
1198
|
return cached
|
|
@@ -1232,9 +1211,9 @@ module Delorean
|
|
|
1232
1211
|
end
|
|
1233
1212
|
s3 << r4
|
|
1234
1213
|
if r4
|
|
1235
|
-
if
|
|
1236
|
-
r6 =
|
|
1237
|
-
@index +=
|
|
1214
|
+
if has_terminal?(',', false, index)
|
|
1215
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1216
|
+
@index += 1
|
|
1238
1217
|
else
|
|
1239
1218
|
terminal_parse_failure(',')
|
|
1240
1219
|
r6 = nil
|
|
@@ -1344,28 +1323,27 @@ module Delorean
|
|
|
1344
1323
|
if node_cache[:list_expr].has_key?(index)
|
|
1345
1324
|
cached = node_cache[:list_expr][index]
|
|
1346
1325
|
if cached
|
|
1347
|
-
|
|
1326
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1348
1327
|
@index = cached.interval.end
|
|
1349
1328
|
end
|
|
1350
1329
|
return cached
|
|
1351
1330
|
end
|
|
1352
1331
|
|
|
1353
1332
|
i0 = index
|
|
1354
|
-
if
|
|
1355
|
-
r1 = instantiate_node(ListExpr,input, index...(index +
|
|
1356
|
-
@index +=
|
|
1333
|
+
if has_terminal?('[]', false, index)
|
|
1334
|
+
r1 = instantiate_node(ListExpr,input, index...(index + 2))
|
|
1335
|
+
@index += 2
|
|
1357
1336
|
else
|
|
1358
1337
|
terminal_parse_failure('[]')
|
|
1359
1338
|
r1 = nil
|
|
1360
1339
|
end
|
|
1361
1340
|
if r1
|
|
1362
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1363
1341
|
r0 = r1
|
|
1364
1342
|
else
|
|
1365
1343
|
i2, s2 = index, []
|
|
1366
|
-
if
|
|
1367
|
-
r3 =
|
|
1368
|
-
@index +=
|
|
1344
|
+
if has_terminal?('[', false, index)
|
|
1345
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1346
|
+
@index += 1
|
|
1369
1347
|
else
|
|
1370
1348
|
terminal_parse_failure('[')
|
|
1371
1349
|
r3 = nil
|
|
@@ -1386,9 +1364,9 @@ module Delorean
|
|
|
1386
1364
|
r7 = _nt_sp
|
|
1387
1365
|
s2 << r7
|
|
1388
1366
|
if r7
|
|
1389
|
-
if
|
|
1390
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1391
|
-
@index +=
|
|
1367
|
+
if has_terminal?('for', false, index)
|
|
1368
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1369
|
+
@index += 3
|
|
1392
1370
|
else
|
|
1393
1371
|
terminal_parse_failure('for')
|
|
1394
1372
|
r8 = nil
|
|
@@ -1404,9 +1382,9 @@ module Delorean
|
|
|
1404
1382
|
r11 = _nt_sp
|
|
1405
1383
|
s2 << r11
|
|
1406
1384
|
if r11
|
|
1407
|
-
if
|
|
1408
|
-
r12 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1409
|
-
@index +=
|
|
1385
|
+
if has_terminal?('in', false, index)
|
|
1386
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1387
|
+
@index += 2
|
|
1410
1388
|
else
|
|
1411
1389
|
terminal_parse_failure('in')
|
|
1412
1390
|
r12 = nil
|
|
@@ -1428,9 +1406,9 @@ module Delorean
|
|
|
1428
1406
|
s2 << r15
|
|
1429
1407
|
if r15
|
|
1430
1408
|
i18, s18 = index, []
|
|
1431
|
-
if
|
|
1432
|
-
r19 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1433
|
-
@index +=
|
|
1409
|
+
if has_terminal?('if', false, index)
|
|
1410
|
+
r19 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1411
|
+
@index += 2
|
|
1434
1412
|
else
|
|
1435
1413
|
terminal_parse_failure('if')
|
|
1436
1414
|
r19 = nil
|
|
@@ -1467,9 +1445,9 @@ module Delorean
|
|
|
1467
1445
|
end
|
|
1468
1446
|
s2 << r17
|
|
1469
1447
|
if r17
|
|
1470
|
-
if
|
|
1471
|
-
r24 =
|
|
1472
|
-
@index +=
|
|
1448
|
+
if has_terminal?(']', false, index)
|
|
1449
|
+
r24 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1450
|
+
@index += 1
|
|
1473
1451
|
else
|
|
1474
1452
|
terminal_parse_failure(']')
|
|
1475
1453
|
r24 = nil
|
|
@@ -1496,13 +1474,12 @@ module Delorean
|
|
|
1496
1474
|
r2 = nil
|
|
1497
1475
|
end
|
|
1498
1476
|
if r2
|
|
1499
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1500
1477
|
r0 = r2
|
|
1501
1478
|
else
|
|
1502
1479
|
i25, s25 = index, []
|
|
1503
|
-
if
|
|
1504
|
-
r26 =
|
|
1505
|
-
@index +=
|
|
1480
|
+
if has_terminal?('[', false, index)
|
|
1481
|
+
r26 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1482
|
+
@index += 1
|
|
1506
1483
|
else
|
|
1507
1484
|
terminal_parse_failure('[')
|
|
1508
1485
|
r26 = nil
|
|
@@ -1528,9 +1505,9 @@ module Delorean
|
|
|
1528
1505
|
end
|
|
1529
1506
|
s25 << r30
|
|
1530
1507
|
if r30
|
|
1531
|
-
if
|
|
1532
|
-
r32 =
|
|
1533
|
-
@index +=
|
|
1508
|
+
if has_terminal?(']', false, index)
|
|
1509
|
+
r32 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1510
|
+
@index += 1
|
|
1534
1511
|
else
|
|
1535
1512
|
terminal_parse_failure(']')
|
|
1536
1513
|
r32 = nil
|
|
@@ -1548,7 +1525,6 @@ module Delorean
|
|
|
1548
1525
|
r25 = nil
|
|
1549
1526
|
end
|
|
1550
1527
|
if r25
|
|
1551
|
-
r25 = SyntaxNode.new(input, (index-1)...index) if r25 == true
|
|
1552
1528
|
r0 = r25
|
|
1553
1529
|
else
|
|
1554
1530
|
@index = i0
|
|
@@ -1620,28 +1596,27 @@ module Delorean
|
|
|
1620
1596
|
if node_cache[:set_expr].has_key?(index)
|
|
1621
1597
|
cached = node_cache[:set_expr][index]
|
|
1622
1598
|
if cached
|
|
1623
|
-
|
|
1599
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1624
1600
|
@index = cached.interval.end
|
|
1625
1601
|
end
|
|
1626
1602
|
return cached
|
|
1627
1603
|
end
|
|
1628
1604
|
|
|
1629
1605
|
i0 = index
|
|
1630
|
-
if
|
|
1631
|
-
r1 = instantiate_node(SetExpr,input, index...(index +
|
|
1632
|
-
@index +=
|
|
1606
|
+
if has_terminal?('{-}', false, index)
|
|
1607
|
+
r1 = instantiate_node(SetExpr,input, index...(index + 3))
|
|
1608
|
+
@index += 3
|
|
1633
1609
|
else
|
|
1634
1610
|
terminal_parse_failure('{-}')
|
|
1635
1611
|
r1 = nil
|
|
1636
1612
|
end
|
|
1637
1613
|
if r1
|
|
1638
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1639
1614
|
r0 = r1
|
|
1640
1615
|
else
|
|
1641
1616
|
i2, s2 = index, []
|
|
1642
|
-
if
|
|
1643
|
-
r3 =
|
|
1644
|
-
@index +=
|
|
1617
|
+
if has_terminal?('{', false, index)
|
|
1618
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1619
|
+
@index += 1
|
|
1645
1620
|
else
|
|
1646
1621
|
terminal_parse_failure('{')
|
|
1647
1622
|
r3 = nil
|
|
@@ -1662,9 +1637,9 @@ module Delorean
|
|
|
1662
1637
|
r7 = _nt_sp
|
|
1663
1638
|
s2 << r7
|
|
1664
1639
|
if r7
|
|
1665
|
-
if
|
|
1666
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1667
|
-
@index +=
|
|
1640
|
+
if has_terminal?('for', false, index)
|
|
1641
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1642
|
+
@index += 3
|
|
1668
1643
|
else
|
|
1669
1644
|
terminal_parse_failure('for')
|
|
1670
1645
|
r8 = nil
|
|
@@ -1680,9 +1655,9 @@ module Delorean
|
|
|
1680
1655
|
r11 = _nt_sp
|
|
1681
1656
|
s2 << r11
|
|
1682
1657
|
if r11
|
|
1683
|
-
if
|
|
1684
|
-
r12 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1685
|
-
@index +=
|
|
1658
|
+
if has_terminal?('in', false, index)
|
|
1659
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1660
|
+
@index += 2
|
|
1686
1661
|
else
|
|
1687
1662
|
terminal_parse_failure('in')
|
|
1688
1663
|
r12 = nil
|
|
@@ -1704,9 +1679,9 @@ module Delorean
|
|
|
1704
1679
|
s2 << r15
|
|
1705
1680
|
if r15
|
|
1706
1681
|
i18, s18 = index, []
|
|
1707
|
-
if
|
|
1708
|
-
r19 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1709
|
-
@index +=
|
|
1682
|
+
if has_terminal?('if', false, index)
|
|
1683
|
+
r19 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1684
|
+
@index += 2
|
|
1710
1685
|
else
|
|
1711
1686
|
terminal_parse_failure('if')
|
|
1712
1687
|
r19 = nil
|
|
@@ -1743,9 +1718,9 @@ module Delorean
|
|
|
1743
1718
|
end
|
|
1744
1719
|
s2 << r17
|
|
1745
1720
|
if r17
|
|
1746
|
-
if
|
|
1747
|
-
r24 =
|
|
1748
|
-
@index +=
|
|
1721
|
+
if has_terminal?('}', false, index)
|
|
1722
|
+
r24 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1723
|
+
@index += 1
|
|
1749
1724
|
else
|
|
1750
1725
|
terminal_parse_failure('}')
|
|
1751
1726
|
r24 = nil
|
|
@@ -1772,13 +1747,12 @@ module Delorean
|
|
|
1772
1747
|
r2 = nil
|
|
1773
1748
|
end
|
|
1774
1749
|
if r2
|
|
1775
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1776
1750
|
r0 = r2
|
|
1777
1751
|
else
|
|
1778
1752
|
i25, s25 = index, []
|
|
1779
|
-
if
|
|
1780
|
-
r26 =
|
|
1781
|
-
@index +=
|
|
1753
|
+
if has_terminal?('{', false, index)
|
|
1754
|
+
r26 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1755
|
+
@index += 1
|
|
1782
1756
|
else
|
|
1783
1757
|
terminal_parse_failure('{')
|
|
1784
1758
|
r26 = nil
|
|
@@ -1804,9 +1778,9 @@ module Delorean
|
|
|
1804
1778
|
end
|
|
1805
1779
|
s25 << r30
|
|
1806
1780
|
if r30
|
|
1807
|
-
if
|
|
1808
|
-
r32 =
|
|
1809
|
-
@index +=
|
|
1781
|
+
if has_terminal?('}', false, index)
|
|
1782
|
+
r32 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1783
|
+
@index += 1
|
|
1810
1784
|
else
|
|
1811
1785
|
terminal_parse_failure('}')
|
|
1812
1786
|
r32 = nil
|
|
@@ -1824,7 +1798,6 @@ module Delorean
|
|
|
1824
1798
|
r25 = nil
|
|
1825
1799
|
end
|
|
1826
1800
|
if r25
|
|
1827
|
-
r25 = SyntaxNode.new(input, (index-1)...index) if r25 == true
|
|
1828
1801
|
r0 = r25
|
|
1829
1802
|
else
|
|
1830
1803
|
@index = i0
|
|
@@ -1900,28 +1873,27 @@ module Delorean
|
|
|
1900
1873
|
if node_cache[:hash_expr].has_key?(index)
|
|
1901
1874
|
cached = node_cache[:hash_expr][index]
|
|
1902
1875
|
if cached
|
|
1903
|
-
|
|
1876
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1904
1877
|
@index = cached.interval.end
|
|
1905
1878
|
end
|
|
1906
1879
|
return cached
|
|
1907
1880
|
end
|
|
1908
1881
|
|
|
1909
1882
|
i0 = index
|
|
1910
|
-
if
|
|
1911
|
-
r1 = instantiate_node(HashExpr,input, index...(index +
|
|
1912
|
-
@index +=
|
|
1883
|
+
if has_terminal?('{}', false, index)
|
|
1884
|
+
r1 = instantiate_node(HashExpr,input, index...(index + 2))
|
|
1885
|
+
@index += 2
|
|
1913
1886
|
else
|
|
1914
1887
|
terminal_parse_failure('{}')
|
|
1915
1888
|
r1 = nil
|
|
1916
1889
|
end
|
|
1917
1890
|
if r1
|
|
1918
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1919
1891
|
r0 = r1
|
|
1920
1892
|
else
|
|
1921
1893
|
i2, s2 = index, []
|
|
1922
|
-
if
|
|
1923
|
-
r3 =
|
|
1924
|
-
@index +=
|
|
1894
|
+
if has_terminal?('{', false, index)
|
|
1895
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1896
|
+
@index += 1
|
|
1925
1897
|
else
|
|
1926
1898
|
terminal_parse_failure('{')
|
|
1927
1899
|
r3 = nil
|
|
@@ -1947,9 +1919,9 @@ module Delorean
|
|
|
1947
1919
|
end
|
|
1948
1920
|
s2 << r7
|
|
1949
1921
|
if r7
|
|
1950
|
-
if
|
|
1951
|
-
r9 =
|
|
1952
|
-
@index +=
|
|
1922
|
+
if has_terminal?(':', false, index)
|
|
1923
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1924
|
+
@index += 1
|
|
1953
1925
|
else
|
|
1954
1926
|
terminal_parse_failure(':')
|
|
1955
1927
|
r9 = nil
|
|
@@ -1970,9 +1942,9 @@ module Delorean
|
|
|
1970
1942
|
r13 = _nt_sp
|
|
1971
1943
|
s2 << r13
|
|
1972
1944
|
if r13
|
|
1973
|
-
if
|
|
1974
|
-
r14 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1975
|
-
@index +=
|
|
1945
|
+
if has_terminal?('for', false, index)
|
|
1946
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1947
|
+
@index += 3
|
|
1976
1948
|
else
|
|
1977
1949
|
terminal_parse_failure('for')
|
|
1978
1950
|
r14 = nil
|
|
@@ -1988,9 +1960,9 @@ module Delorean
|
|
|
1988
1960
|
r17 = _nt_sp
|
|
1989
1961
|
s2 << r17
|
|
1990
1962
|
if r17
|
|
1991
|
-
if
|
|
1992
|
-
r18 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1993
|
-
@index +=
|
|
1963
|
+
if has_terminal?('in', false, index)
|
|
1964
|
+
r18 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1965
|
+
@index += 2
|
|
1994
1966
|
else
|
|
1995
1967
|
terminal_parse_failure('in')
|
|
1996
1968
|
r18 = nil
|
|
@@ -2012,9 +1984,9 @@ module Delorean
|
|
|
2012
1984
|
s2 << r21
|
|
2013
1985
|
if r21
|
|
2014
1986
|
i24, s24 = index, []
|
|
2015
|
-
if
|
|
2016
|
-
r25 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2017
|
-
@index +=
|
|
1987
|
+
if has_terminal?('if', false, index)
|
|
1988
|
+
r25 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1989
|
+
@index += 2
|
|
2018
1990
|
else
|
|
2019
1991
|
terminal_parse_failure('if')
|
|
2020
1992
|
r25 = nil
|
|
@@ -2051,9 +2023,9 @@ module Delorean
|
|
|
2051
2023
|
end
|
|
2052
2024
|
s2 << r23
|
|
2053
2025
|
if r23
|
|
2054
|
-
if
|
|
2055
|
-
r30 =
|
|
2056
|
-
@index +=
|
|
2026
|
+
if has_terminal?('}', false, index)
|
|
2027
|
+
r30 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2028
|
+
@index += 1
|
|
2057
2029
|
else
|
|
2058
2030
|
terminal_parse_failure('}')
|
|
2059
2031
|
r30 = nil
|
|
@@ -2084,13 +2056,12 @@ module Delorean
|
|
|
2084
2056
|
r2 = nil
|
|
2085
2057
|
end
|
|
2086
2058
|
if r2
|
|
2087
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2088
2059
|
r0 = r2
|
|
2089
2060
|
else
|
|
2090
2061
|
i31, s31 = index, []
|
|
2091
|
-
if
|
|
2092
|
-
r32 =
|
|
2093
|
-
@index +=
|
|
2062
|
+
if has_terminal?('{', false, index)
|
|
2063
|
+
r32 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2064
|
+
@index += 1
|
|
2094
2065
|
else
|
|
2095
2066
|
terminal_parse_failure('{')
|
|
2096
2067
|
r32 = nil
|
|
@@ -2116,9 +2087,9 @@ module Delorean
|
|
|
2116
2087
|
end
|
|
2117
2088
|
s31 << r36
|
|
2118
2089
|
if r36
|
|
2119
|
-
if
|
|
2120
|
-
r38 =
|
|
2121
|
-
@index +=
|
|
2090
|
+
if has_terminal?('}', false, index)
|
|
2091
|
+
r38 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2092
|
+
@index += 1
|
|
2122
2093
|
else
|
|
2123
2094
|
terminal_parse_failure('}')
|
|
2124
2095
|
r38 = nil
|
|
@@ -2136,7 +2107,6 @@ module Delorean
|
|
|
2136
2107
|
r31 = nil
|
|
2137
2108
|
end
|
|
2138
2109
|
if r31
|
|
2139
|
-
r31 = SyntaxNode.new(input, (index-1)...index) if r31 == true
|
|
2140
2110
|
r0 = r31
|
|
2141
2111
|
else
|
|
2142
2112
|
@index = i0
|
|
@@ -2155,187 +2125,171 @@ module Delorean
|
|
|
2155
2125
|
if node_cache[:binary_op].has_key?(index)
|
|
2156
2126
|
cached = node_cache[:binary_op][index]
|
|
2157
2127
|
if cached
|
|
2158
|
-
|
|
2128
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2159
2129
|
@index = cached.interval.end
|
|
2160
2130
|
end
|
|
2161
2131
|
return cached
|
|
2162
2132
|
end
|
|
2163
2133
|
|
|
2164
2134
|
i0 = index
|
|
2165
|
-
if
|
|
2166
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2167
|
-
@index +=
|
|
2135
|
+
if has_terminal?('==', false, index)
|
|
2136
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2137
|
+
@index += 2
|
|
2168
2138
|
else
|
|
2169
2139
|
terminal_parse_failure('==')
|
|
2170
2140
|
r1 = nil
|
|
2171
2141
|
end
|
|
2172
2142
|
if r1
|
|
2173
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2174
2143
|
r0 = r1
|
|
2175
2144
|
else
|
|
2176
|
-
if
|
|
2177
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2178
|
-
@index +=
|
|
2145
|
+
if has_terminal?('!=', false, index)
|
|
2146
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2147
|
+
@index += 2
|
|
2179
2148
|
else
|
|
2180
2149
|
terminal_parse_failure('!=')
|
|
2181
2150
|
r2 = nil
|
|
2182
2151
|
end
|
|
2183
2152
|
if r2
|
|
2184
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2185
2153
|
r0 = r2
|
|
2186
2154
|
else
|
|
2187
|
-
if
|
|
2188
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2189
|
-
@index +=
|
|
2155
|
+
if has_terminal?('>=', false, index)
|
|
2156
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2157
|
+
@index += 2
|
|
2190
2158
|
else
|
|
2191
2159
|
terminal_parse_failure('>=')
|
|
2192
2160
|
r3 = nil
|
|
2193
2161
|
end
|
|
2194
2162
|
if r3
|
|
2195
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2196
2163
|
r0 = r3
|
|
2197
2164
|
else
|
|
2198
|
-
if
|
|
2199
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2200
|
-
@index +=
|
|
2165
|
+
if has_terminal?('<=', false, index)
|
|
2166
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2167
|
+
@index += 2
|
|
2201
2168
|
else
|
|
2202
2169
|
terminal_parse_failure('<=')
|
|
2203
2170
|
r4 = nil
|
|
2204
2171
|
end
|
|
2205
2172
|
if r4
|
|
2206
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2207
2173
|
r0 = r4
|
|
2208
2174
|
else
|
|
2209
|
-
if
|
|
2210
|
-
r5 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2211
|
-
@index +=
|
|
2175
|
+
if has_terminal?('&&', false, index)
|
|
2176
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2177
|
+
@index += 2
|
|
2212
2178
|
else
|
|
2213
2179
|
terminal_parse_failure('&&')
|
|
2214
2180
|
r5 = nil
|
|
2215
2181
|
end
|
|
2216
2182
|
if r5
|
|
2217
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2218
2183
|
r0 = r5
|
|
2219
2184
|
else
|
|
2220
|
-
if
|
|
2221
|
-
r6 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2222
|
-
@index +=
|
|
2185
|
+
if has_terminal?('||', false, index)
|
|
2186
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2187
|
+
@index += 2
|
|
2223
2188
|
else
|
|
2224
2189
|
terminal_parse_failure('||')
|
|
2225
2190
|
r6 = nil
|
|
2226
2191
|
end
|
|
2227
2192
|
if r6
|
|
2228
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2229
2193
|
r0 = r6
|
|
2230
2194
|
else
|
|
2231
|
-
if
|
|
2232
|
-
r7 =
|
|
2233
|
-
@index +=
|
|
2195
|
+
if has_terminal?('>', false, index)
|
|
2196
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2197
|
+
@index += 1
|
|
2234
2198
|
else
|
|
2235
2199
|
terminal_parse_failure('>')
|
|
2236
2200
|
r7 = nil
|
|
2237
2201
|
end
|
|
2238
2202
|
if r7
|
|
2239
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2240
2203
|
r0 = r7
|
|
2241
2204
|
else
|
|
2242
|
-
if
|
|
2243
|
-
r8 =
|
|
2244
|
-
@index +=
|
|
2205
|
+
if has_terminal?('<', false, index)
|
|
2206
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2207
|
+
@index += 1
|
|
2245
2208
|
else
|
|
2246
2209
|
terminal_parse_failure('<')
|
|
2247
2210
|
r8 = nil
|
|
2248
2211
|
end
|
|
2249
2212
|
if r8
|
|
2250
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2251
2213
|
r0 = r8
|
|
2252
2214
|
else
|
|
2253
|
-
if
|
|
2254
|
-
r9 =
|
|
2255
|
-
@index +=
|
|
2215
|
+
if has_terminal?('+', false, index)
|
|
2216
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2217
|
+
@index += 1
|
|
2256
2218
|
else
|
|
2257
2219
|
terminal_parse_failure('+')
|
|
2258
2220
|
r9 = nil
|
|
2259
2221
|
end
|
|
2260
2222
|
if r9
|
|
2261
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
2262
2223
|
r0 = r9
|
|
2263
2224
|
else
|
|
2264
|
-
if
|
|
2265
|
-
r10 =
|
|
2266
|
-
@index +=
|
|
2225
|
+
if has_terminal?('-', false, index)
|
|
2226
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2227
|
+
@index += 1
|
|
2267
2228
|
else
|
|
2268
2229
|
terminal_parse_failure('-')
|
|
2269
2230
|
r10 = nil
|
|
2270
2231
|
end
|
|
2271
2232
|
if r10
|
|
2272
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
2273
2233
|
r0 = r10
|
|
2274
2234
|
else
|
|
2275
|
-
if
|
|
2276
|
-
r11 =
|
|
2277
|
-
@index +=
|
|
2235
|
+
if has_terminal?('*', false, index)
|
|
2236
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2237
|
+
@index += 1
|
|
2278
2238
|
else
|
|
2279
2239
|
terminal_parse_failure('*')
|
|
2280
2240
|
r11 = nil
|
|
2281
2241
|
end
|
|
2282
2242
|
if r11
|
|
2283
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
2284
2243
|
r0 = r11
|
|
2285
2244
|
else
|
|
2286
|
-
if
|
|
2287
|
-
r12 =
|
|
2288
|
-
@index +=
|
|
2245
|
+
if has_terminal?('/', false, index)
|
|
2246
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2247
|
+
@index += 1
|
|
2289
2248
|
else
|
|
2290
2249
|
terminal_parse_failure('/')
|
|
2291
2250
|
r12 = nil
|
|
2292
2251
|
end
|
|
2293
2252
|
if r12
|
|
2294
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2295
2253
|
r0 = r12
|
|
2296
2254
|
else
|
|
2297
|
-
if
|
|
2298
|
-
r13 =
|
|
2299
|
-
@index +=
|
|
2255
|
+
if has_terminal?('%', false, index)
|
|
2256
|
+
r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2257
|
+
@index += 1
|
|
2300
2258
|
else
|
|
2301
2259
|
terminal_parse_failure('%')
|
|
2302
2260
|
r13 = nil
|
|
2303
2261
|
end
|
|
2304
2262
|
if r13
|
|
2305
|
-
r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true
|
|
2306
2263
|
r0 = r13
|
|
2307
2264
|
else
|
|
2308
|
-
if
|
|
2309
|
-
r14 =
|
|
2310
|
-
@index +=
|
|
2265
|
+
if has_terminal?('&', false, index)
|
|
2266
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2267
|
+
@index += 1
|
|
2311
2268
|
else
|
|
2312
2269
|
terminal_parse_failure('&')
|
|
2313
2270
|
r14 = nil
|
|
2314
2271
|
end
|
|
2315
2272
|
if r14
|
|
2316
|
-
r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
|
|
2317
2273
|
r0 = r14
|
|
2318
2274
|
else
|
|
2319
|
-
if
|
|
2320
|
-
r15 =
|
|
2321
|
-
@index +=
|
|
2275
|
+
if has_terminal?('^', false, index)
|
|
2276
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2277
|
+
@index += 1
|
|
2322
2278
|
else
|
|
2323
2279
|
terminal_parse_failure('^')
|
|
2324
2280
|
r15 = nil
|
|
2325
2281
|
end
|
|
2326
2282
|
if r15
|
|
2327
|
-
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
|
2328
2283
|
r0 = r15
|
|
2329
2284
|
else
|
|
2330
|
-
if
|
|
2331
|
-
r16 =
|
|
2332
|
-
@index +=
|
|
2285
|
+
if has_terminal?('|', false, index)
|
|
2286
|
+
r16 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2287
|
+
@index += 1
|
|
2333
2288
|
else
|
|
2334
2289
|
terminal_parse_failure('|')
|
|
2335
2290
|
r16 = nil
|
|
2336
2291
|
end
|
|
2337
2292
|
if r16
|
|
2338
|
-
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
|
2339
2293
|
r0 = r16
|
|
2340
2294
|
else
|
|
2341
2295
|
@index = i0
|
|
@@ -2367,33 +2321,31 @@ module Delorean
|
|
|
2367
2321
|
if node_cache[:unary_op].has_key?(index)
|
|
2368
2322
|
cached = node_cache[:unary_op][index]
|
|
2369
2323
|
if cached
|
|
2370
|
-
|
|
2324
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2371
2325
|
@index = cached.interval.end
|
|
2372
2326
|
end
|
|
2373
2327
|
return cached
|
|
2374
2328
|
end
|
|
2375
2329
|
|
|
2376
2330
|
i0 = index
|
|
2377
|
-
if
|
|
2378
|
-
r1 =
|
|
2379
|
-
@index +=
|
|
2331
|
+
if has_terminal?('!', false, index)
|
|
2332
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2333
|
+
@index += 1
|
|
2380
2334
|
else
|
|
2381
2335
|
terminal_parse_failure('!')
|
|
2382
2336
|
r1 = nil
|
|
2383
2337
|
end
|
|
2384
2338
|
if r1
|
|
2385
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2386
2339
|
r0 = r1
|
|
2387
2340
|
else
|
|
2388
|
-
if
|
|
2389
|
-
r2 =
|
|
2390
|
-
@index +=
|
|
2341
|
+
if has_terminal?('-', false, index)
|
|
2342
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2343
|
+
@index += 1
|
|
2391
2344
|
else
|
|
2392
2345
|
terminal_parse_failure('-')
|
|
2393
2346
|
r2 = nil
|
|
2394
2347
|
end
|
|
2395
2348
|
if r2
|
|
2396
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2397
2349
|
r0 = r2
|
|
2398
2350
|
else
|
|
2399
2351
|
@index = i0
|
|
@@ -2435,7 +2387,7 @@ module Delorean
|
|
|
2435
2387
|
if node_cache[:value].has_key?(index)
|
|
2436
2388
|
cached = node_cache[:value][index]
|
|
2437
2389
|
if cached
|
|
2438
|
-
|
|
2390
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2439
2391
|
@index = cached.interval.end
|
|
2440
2392
|
end
|
|
2441
2393
|
return cached
|
|
@@ -2444,52 +2396,42 @@ module Delorean
|
|
|
2444
2396
|
i0 = index
|
|
2445
2397
|
r1 = _nt_decimal
|
|
2446
2398
|
if r1
|
|
2447
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2448
2399
|
r0 = r1
|
|
2449
2400
|
else
|
|
2450
2401
|
r2 = _nt_integer
|
|
2451
2402
|
if r2
|
|
2452
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2453
2403
|
r0 = r2
|
|
2454
2404
|
else
|
|
2455
2405
|
r3 = _nt_string
|
|
2456
2406
|
if r3
|
|
2457
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2458
2407
|
r0 = r3
|
|
2459
2408
|
else
|
|
2460
2409
|
r4 = _nt_boolean
|
|
2461
2410
|
if r4
|
|
2462
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2463
2411
|
r0 = r4
|
|
2464
2412
|
else
|
|
2465
2413
|
r5 = _nt_nil_val
|
|
2466
2414
|
if r5
|
|
2467
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2468
2415
|
r0 = r5
|
|
2469
2416
|
else
|
|
2470
2417
|
r6 = _nt_identifier
|
|
2471
2418
|
if r6
|
|
2472
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2473
2419
|
r0 = r6
|
|
2474
2420
|
else
|
|
2475
2421
|
r7 = _nt_self
|
|
2476
2422
|
if r7
|
|
2477
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2478
2423
|
r0 = r7
|
|
2479
2424
|
else
|
|
2480
2425
|
r8 = _nt_list_expr
|
|
2481
2426
|
if r8
|
|
2482
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2483
2427
|
r0 = r8
|
|
2484
2428
|
else
|
|
2485
2429
|
r9 = _nt_set_expr
|
|
2486
2430
|
if r9
|
|
2487
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
2488
2431
|
r0 = r9
|
|
2489
2432
|
else
|
|
2490
2433
|
r10 = _nt_hash_expr
|
|
2491
2434
|
if r10
|
|
2492
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
2493
2435
|
r0 = r10
|
|
2494
2436
|
else
|
|
2495
2437
|
i11, s11 = index, []
|
|
@@ -2497,9 +2439,9 @@ module Delorean
|
|
|
2497
2439
|
r14 = _nt_class_name
|
|
2498
2440
|
s13 << r14
|
|
2499
2441
|
if r14
|
|
2500
|
-
if
|
|
2501
|
-
r15 = instantiate_node(SyntaxNode,input, index...(index +
|
|
2502
|
-
@index +=
|
|
2442
|
+
if has_terminal?('::', false, index)
|
|
2443
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
2444
|
+
@index += 2
|
|
2503
2445
|
else
|
|
2504
2446
|
terminal_parse_failure('::')
|
|
2505
2447
|
r15 = nil
|
|
@@ -2531,13 +2473,12 @@ module Delorean
|
|
|
2531
2473
|
r11 = nil
|
|
2532
2474
|
end
|
|
2533
2475
|
if r11
|
|
2534
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
2535
2476
|
r0 = r11
|
|
2536
2477
|
else
|
|
2537
2478
|
i17, s17 = index, []
|
|
2538
|
-
if
|
|
2539
|
-
r18 =
|
|
2540
|
-
@index +=
|
|
2479
|
+
if has_terminal?('(', false, index)
|
|
2480
|
+
r18 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2481
|
+
@index += 1
|
|
2541
2482
|
else
|
|
2542
2483
|
terminal_parse_failure('(')
|
|
2543
2484
|
r18 = nil
|
|
@@ -2563,9 +2504,9 @@ module Delorean
|
|
|
2563
2504
|
end
|
|
2564
2505
|
s17 << r22
|
|
2565
2506
|
if r22
|
|
2566
|
-
if
|
|
2567
|
-
r24 =
|
|
2568
|
-
@index +=
|
|
2507
|
+
if has_terminal?(')', false, index)
|
|
2508
|
+
r24 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2509
|
+
@index += 1
|
|
2569
2510
|
else
|
|
2570
2511
|
terminal_parse_failure(')')
|
|
2571
2512
|
r24 = nil
|
|
@@ -2583,7 +2524,6 @@ module Delorean
|
|
|
2583
2524
|
r17 = nil
|
|
2584
2525
|
end
|
|
2585
2526
|
if r17
|
|
2586
|
-
r17 = SyntaxNode.new(input, (index-1)...index) if r17 == true
|
|
2587
2527
|
r0 = r17
|
|
2588
2528
|
else
|
|
2589
2529
|
@index = i0
|
|
@@ -2627,7 +2567,7 @@ module Delorean
|
|
|
2627
2567
|
if node_cache[:fn_args].has_key?(index)
|
|
2628
2568
|
cached = node_cache[:fn_args][index]
|
|
2629
2569
|
if cached
|
|
2630
|
-
|
|
2570
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2631
2571
|
@index = cached.interval.end
|
|
2632
2572
|
end
|
|
2633
2573
|
return cached
|
|
@@ -2646,9 +2586,9 @@ module Delorean
|
|
|
2646
2586
|
end
|
|
2647
2587
|
s3 << r4
|
|
2648
2588
|
if r4
|
|
2649
|
-
if
|
|
2650
|
-
r6 =
|
|
2651
|
-
@index +=
|
|
2589
|
+
if has_terminal?(',', false, index)
|
|
2590
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2591
|
+
@index += 1
|
|
2652
2592
|
else
|
|
2653
2593
|
terminal_parse_failure(',')
|
|
2654
2594
|
r6 = nil
|
|
@@ -2725,7 +2665,7 @@ module Delorean
|
|
|
2725
2665
|
if node_cache[:hash_args].has_key?(index)
|
|
2726
2666
|
cached = node_cache[:hash_args][index]
|
|
2727
2667
|
if cached
|
|
2728
|
-
|
|
2668
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2729
2669
|
@index = cached.interval.end
|
|
2730
2670
|
end
|
|
2731
2671
|
return cached
|
|
@@ -2743,9 +2683,9 @@ module Delorean
|
|
|
2743
2683
|
end
|
|
2744
2684
|
s0 << r2
|
|
2745
2685
|
if r2
|
|
2746
|
-
if
|
|
2747
|
-
r4 =
|
|
2748
|
-
@index +=
|
|
2686
|
+
if has_terminal?(':', false, index)
|
|
2687
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2688
|
+
@index += 1
|
|
2749
2689
|
else
|
|
2750
2690
|
terminal_parse_failure(':')
|
|
2751
2691
|
r4 = nil
|
|
@@ -2772,9 +2712,9 @@ module Delorean
|
|
|
2772
2712
|
end
|
|
2773
2713
|
s9 << r10
|
|
2774
2714
|
if r10
|
|
2775
|
-
if
|
|
2776
|
-
r12 =
|
|
2777
|
-
@index +=
|
|
2715
|
+
if has_terminal?(',', false, index)
|
|
2716
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2717
|
+
@index += 1
|
|
2778
2718
|
else
|
|
2779
2719
|
terminal_parse_failure(',')
|
|
2780
2720
|
r12 = nil
|
|
@@ -2862,7 +2802,7 @@ module Delorean
|
|
|
2862
2802
|
if node_cache[:kw_args].has_key?(index)
|
|
2863
2803
|
cached = node_cache[:kw_args][index]
|
|
2864
2804
|
if cached
|
|
2865
|
-
|
|
2805
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2866
2806
|
@index = cached.interval.end
|
|
2867
2807
|
end
|
|
2868
2808
|
return cached
|
|
@@ -2881,9 +2821,9 @@ module Delorean
|
|
|
2881
2821
|
end
|
|
2882
2822
|
s2 << r4
|
|
2883
2823
|
if r4
|
|
2884
|
-
if
|
|
2885
|
-
r6 =
|
|
2886
|
-
@index +=
|
|
2824
|
+
if has_terminal?('=', false, index)
|
|
2825
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2826
|
+
@index += 1
|
|
2887
2827
|
else
|
|
2888
2828
|
terminal_parse_failure('=')
|
|
2889
2829
|
r6 = nil
|
|
@@ -2926,9 +2866,9 @@ module Delorean
|
|
|
2926
2866
|
end
|
|
2927
2867
|
s11 << r12
|
|
2928
2868
|
if r12
|
|
2929
|
-
if
|
|
2930
|
-
r14 =
|
|
2931
|
-
@index +=
|
|
2869
|
+
if has_terminal?(',', false, index)
|
|
2870
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2871
|
+
@index += 1
|
|
2932
2872
|
else
|
|
2933
2873
|
terminal_parse_failure(',')
|
|
2934
2874
|
r14 = nil
|
|
@@ -2993,7 +2933,7 @@ module Delorean
|
|
|
2993
2933
|
if node_cache[:decimal].has_key?(index)
|
|
2994
2934
|
cached = node_cache[:decimal][index]
|
|
2995
2935
|
if cached
|
|
2996
|
-
|
|
2936
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2997
2937
|
@index = cached.interval.end
|
|
2998
2938
|
end
|
|
2999
2939
|
return cached
|
|
@@ -3003,9 +2943,9 @@ module Delorean
|
|
|
3003
2943
|
r1 = _nt_integer
|
|
3004
2944
|
s0 << r1
|
|
3005
2945
|
if r1
|
|
3006
|
-
if
|
|
3007
|
-
r2 =
|
|
3008
|
-
@index +=
|
|
2946
|
+
if has_terminal?('.', false, index)
|
|
2947
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2948
|
+
@index += 1
|
|
3009
2949
|
else
|
|
3010
2950
|
terminal_parse_failure('.')
|
|
3011
2951
|
r2 = nil
|
|
@@ -3014,11 +2954,10 @@ module Delorean
|
|
|
3014
2954
|
if r2
|
|
3015
2955
|
s3, i3 = [], index
|
|
3016
2956
|
loop do
|
|
3017
|
-
if has_terminal?(
|
|
2957
|
+
if has_terminal?('\G[0-9]', true, index)
|
|
3018
2958
|
r4 = true
|
|
3019
2959
|
@index += 1
|
|
3020
2960
|
else
|
|
3021
|
-
terminal_parse_failure('[0-9]')
|
|
3022
2961
|
r4 = nil
|
|
3023
2962
|
end
|
|
3024
2963
|
if r4
|
|
@@ -3057,41 +2996,38 @@ module Delorean
|
|
|
3057
2996
|
if node_cache[:integer].has_key?(index)
|
|
3058
2997
|
cached = node_cache[:integer][index]
|
|
3059
2998
|
if cached
|
|
3060
|
-
|
|
2999
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3061
3000
|
@index = cached.interval.end
|
|
3062
3001
|
end
|
|
3063
3002
|
return cached
|
|
3064
3003
|
end
|
|
3065
3004
|
|
|
3066
3005
|
i0 = index
|
|
3067
|
-
if
|
|
3068
|
-
r1 = instantiate_node(Literal,input, index...(index +
|
|
3069
|
-
@index +=
|
|
3006
|
+
if has_terminal?('0', false, index)
|
|
3007
|
+
r1 = instantiate_node(Literal,input, index...(index + 1))
|
|
3008
|
+
@index += 1
|
|
3070
3009
|
else
|
|
3071
3010
|
terminal_parse_failure('0')
|
|
3072
3011
|
r1 = nil
|
|
3073
3012
|
end
|
|
3074
3013
|
if r1
|
|
3075
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
3076
3014
|
r0 = r1
|
|
3077
3015
|
else
|
|
3078
3016
|
i2, s2 = index, []
|
|
3079
|
-
if has_terminal?(
|
|
3017
|
+
if has_terminal?('\G[1-9]', true, index)
|
|
3080
3018
|
r3 = true
|
|
3081
3019
|
@index += 1
|
|
3082
3020
|
else
|
|
3083
|
-
terminal_parse_failure('[1-9]')
|
|
3084
3021
|
r3 = nil
|
|
3085
3022
|
end
|
|
3086
3023
|
s2 << r3
|
|
3087
3024
|
if r3
|
|
3088
3025
|
s4, i4 = [], index
|
|
3089
3026
|
loop do
|
|
3090
|
-
if has_terminal?(
|
|
3027
|
+
if has_terminal?('\G[0-9]', true, index)
|
|
3091
3028
|
r5 = true
|
|
3092
3029
|
@index += 1
|
|
3093
3030
|
else
|
|
3094
|
-
terminal_parse_failure('[0-9]')
|
|
3095
3031
|
r5 = nil
|
|
3096
3032
|
end
|
|
3097
3033
|
if r5
|
|
@@ -3111,7 +3047,6 @@ module Delorean
|
|
|
3111
3047
|
r2 = nil
|
|
3112
3048
|
end
|
|
3113
3049
|
if r2
|
|
3114
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
3115
3050
|
r0 = r2
|
|
3116
3051
|
else
|
|
3117
3052
|
@index = i0
|
|
@@ -3132,29 +3067,27 @@ module Delorean
|
|
|
3132
3067
|
if node_cache[:identifier].has_key?(index)
|
|
3133
3068
|
cached = node_cache[:identifier][index]
|
|
3134
3069
|
if cached
|
|
3135
|
-
|
|
3070
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3136
3071
|
@index = cached.interval.end
|
|
3137
3072
|
end
|
|
3138
3073
|
return cached
|
|
3139
3074
|
end
|
|
3140
3075
|
|
|
3141
3076
|
i0, s0 = index, []
|
|
3142
|
-
if has_terminal?(
|
|
3077
|
+
if has_terminal?('\G[a-z]', true, index)
|
|
3143
3078
|
r1 = true
|
|
3144
3079
|
@index += 1
|
|
3145
3080
|
else
|
|
3146
|
-
terminal_parse_failure('[a-z]')
|
|
3147
3081
|
r1 = nil
|
|
3148
3082
|
end
|
|
3149
3083
|
s0 << r1
|
|
3150
3084
|
if r1
|
|
3151
3085
|
s2, i2 = [], index
|
|
3152
3086
|
loop do
|
|
3153
|
-
if has_terminal?(
|
|
3087
|
+
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
|
3154
3088
|
r3 = true
|
|
3155
3089
|
@index += 1
|
|
3156
3090
|
else
|
|
3157
|
-
terminal_parse_failure('[a-zA-Z0-9_]')
|
|
3158
3091
|
r3 = nil
|
|
3159
3092
|
end
|
|
3160
3093
|
if r3
|
|
@@ -3184,33 +3117,31 @@ module Delorean
|
|
|
3184
3117
|
if node_cache[:boolean].has_key?(index)
|
|
3185
3118
|
cached = node_cache[:boolean][index]
|
|
3186
3119
|
if cached
|
|
3187
|
-
|
|
3120
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3188
3121
|
@index = cached.interval.end
|
|
3189
3122
|
end
|
|
3190
3123
|
return cached
|
|
3191
3124
|
end
|
|
3192
3125
|
|
|
3193
3126
|
i0 = index
|
|
3194
|
-
if
|
|
3195
|
-
r1 = instantiate_node(Literal,input, index...(index +
|
|
3196
|
-
@index +=
|
|
3127
|
+
if has_terminal?('true', false, index)
|
|
3128
|
+
r1 = instantiate_node(Literal,input, index...(index + 4))
|
|
3129
|
+
@index += 4
|
|
3197
3130
|
else
|
|
3198
3131
|
terminal_parse_failure('true')
|
|
3199
3132
|
r1 = nil
|
|
3200
3133
|
end
|
|
3201
3134
|
if r1
|
|
3202
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
3203
3135
|
r0 = r1
|
|
3204
3136
|
else
|
|
3205
|
-
if
|
|
3206
|
-
r2 = instantiate_node(Literal,input, index...(index +
|
|
3207
|
-
@index +=
|
|
3137
|
+
if has_terminal?('false', false, index)
|
|
3138
|
+
r2 = instantiate_node(Literal,input, index...(index + 5))
|
|
3139
|
+
@index += 5
|
|
3208
3140
|
else
|
|
3209
3141
|
terminal_parse_failure('false')
|
|
3210
3142
|
r2 = nil
|
|
3211
3143
|
end
|
|
3212
3144
|
if r2
|
|
3213
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
3214
3145
|
r0 = r2
|
|
3215
3146
|
else
|
|
3216
3147
|
@index = i0
|
|
@@ -3228,15 +3159,15 @@ module Delorean
|
|
|
3228
3159
|
if node_cache[:self].has_key?(index)
|
|
3229
3160
|
cached = node_cache[:self][index]
|
|
3230
3161
|
if cached
|
|
3231
|
-
|
|
3162
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3232
3163
|
@index = cached.interval.end
|
|
3233
3164
|
end
|
|
3234
3165
|
return cached
|
|
3235
3166
|
end
|
|
3236
3167
|
|
|
3237
|
-
if
|
|
3238
|
-
r0 = instantiate_node(Self,input, index...(index +
|
|
3239
|
-
@index +=
|
|
3168
|
+
if has_terminal?('_', false, index)
|
|
3169
|
+
r0 = instantiate_node(Self,input, index...(index + 1))
|
|
3170
|
+
@index += 1
|
|
3240
3171
|
else
|
|
3241
3172
|
terminal_parse_failure('_')
|
|
3242
3173
|
r0 = nil
|
|
@@ -3252,15 +3183,15 @@ module Delorean
|
|
|
3252
3183
|
if node_cache[:nil_val].has_key?(index)
|
|
3253
3184
|
cached = node_cache[:nil_val][index]
|
|
3254
3185
|
if cached
|
|
3255
|
-
|
|
3186
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3256
3187
|
@index = cached.interval.end
|
|
3257
3188
|
end
|
|
3258
3189
|
return cached
|
|
3259
3190
|
end
|
|
3260
3191
|
|
|
3261
|
-
if
|
|
3262
|
-
r0 = instantiate_node(Literal,input, index...(index +
|
|
3263
|
-
@index +=
|
|
3192
|
+
if has_terminal?('nil', false, index)
|
|
3193
|
+
r0 = instantiate_node(Literal,input, index...(index + 3))
|
|
3194
|
+
@index += 3
|
|
3264
3195
|
else
|
|
3265
3196
|
terminal_parse_failure('nil')
|
|
3266
3197
|
r0 = nil
|
|
@@ -3276,15 +3207,15 @@ module Delorean
|
|
|
3276
3207
|
if node_cache[:sp4].has_key?(index)
|
|
3277
3208
|
cached = node_cache[:sp4][index]
|
|
3278
3209
|
if cached
|
|
3279
|
-
|
|
3210
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3280
3211
|
@index = cached.interval.end
|
|
3281
3212
|
end
|
|
3282
3213
|
return cached
|
|
3283
3214
|
end
|
|
3284
3215
|
|
|
3285
|
-
if
|
|
3286
|
-
r0 = instantiate_node(SyntaxNode,input, index...(index +
|
|
3287
|
-
@index +=
|
|
3216
|
+
if has_terminal?(' ', false, index)
|
|
3217
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
3218
|
+
@index += 4
|
|
3288
3219
|
else
|
|
3289
3220
|
terminal_parse_failure(' ')
|
|
3290
3221
|
r0 = nil
|
|
@@ -3300,7 +3231,7 @@ module Delorean
|
|
|
3300
3231
|
if node_cache[:sp].has_key?(index)
|
|
3301
3232
|
cached = node_cache[:sp][index]
|
|
3302
3233
|
if cached
|
|
3303
|
-
|
|
3234
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3304
3235
|
@index = cached.interval.end
|
|
3305
3236
|
end
|
|
3306
3237
|
return cached
|
|
@@ -3308,11 +3239,10 @@ module Delorean
|
|
|
3308
3239
|
|
|
3309
3240
|
s0, i0 = [], index
|
|
3310
3241
|
loop do
|
|
3311
|
-
if has_terminal?(
|
|
3242
|
+
if has_terminal?('\G[\\s]', true, index)
|
|
3312
3243
|
r1 = true
|
|
3313
3244
|
@index += 1
|
|
3314
3245
|
else
|
|
3315
|
-
terminal_parse_failure('[\\s]')
|
|
3316
3246
|
r1 = nil
|
|
3317
3247
|
end
|
|
3318
3248
|
if r1
|
|
@@ -3347,7 +3277,7 @@ module Delorean
|
|
|
3347
3277
|
if node_cache[:string].has_key?(index)
|
|
3348
3278
|
cached = node_cache[:string][index]
|
|
3349
3279
|
if cached
|
|
3350
|
-
|
|
3280
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
3351
3281
|
@index = cached.interval.end
|
|
3352
3282
|
end
|
|
3353
3283
|
return cached
|
|
@@ -3355,9 +3285,9 @@ module Delorean
|
|
|
3355
3285
|
|
|
3356
3286
|
i0 = index
|
|
3357
3287
|
i1, s1 = index, []
|
|
3358
|
-
if
|
|
3359
|
-
r2 =
|
|
3360
|
-
@index +=
|
|
3288
|
+
if has_terminal?('"', false, index)
|
|
3289
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
3290
|
+
@index += 1
|
|
3361
3291
|
else
|
|
3362
3292
|
terminal_parse_failure('"')
|
|
3363
3293
|
r2 = nil
|
|
@@ -3367,22 +3297,21 @@ module Delorean
|
|
|
3367
3297
|
s3, i3 = [], index
|
|
3368
3298
|
loop do
|
|
3369
3299
|
i4 = index
|
|
3370
|
-
if
|
|
3371
|
-
r5 = instantiate_node(SyntaxNode,input, index...(index +
|
|
3372
|
-
@index +=
|
|
3300
|
+
if has_terminal?('\"', false, index)
|
|
3301
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
3302
|
+
@index += 2
|
|
3373
3303
|
else
|
|
3374
3304
|
terminal_parse_failure('\"')
|
|
3375
3305
|
r5 = nil
|
|
3376
3306
|
end
|
|
3377
3307
|
if r5
|
|
3378
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
3379
3308
|
r4 = r5
|
|
3380
3309
|
else
|
|
3381
3310
|
i6, s6 = index, []
|
|
3382
3311
|
i7 = index
|
|
3383
|
-
if
|
|
3384
|
-
r8 =
|
|
3385
|
-
@index +=
|
|
3312
|
+
if has_terminal?('"', false, index)
|
|
3313
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
3314
|
+
@index += 1
|
|
3386
3315
|
else
|
|
3387
3316
|
terminal_parse_failure('"')
|
|
3388
3317
|
r8 = nil
|
|
@@ -3396,7 +3325,7 @@ module Delorean
|
|
|
3396
3325
|
s6 << r7
|
|
3397
3326
|
if r7
|
|
3398
3327
|
if index < input_length
|
|
3399
|
-
r9 =
|
|
3328
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
3400
3329
|
@index += 1
|
|
3401
3330
|
else
|
|
3402
3331
|
terminal_parse_failure("any character")
|
|
@@ -3412,7 +3341,6 @@ module Delorean
|
|
|
3412
3341
|
r6 = nil
|
|
3413
3342
|
end
|
|
3414
3343
|
if r6
|
|
3415
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
3416
3344
|
r4 = r6
|
|
3417
3345
|
else
|
|
3418
3346
|
@index = i4
|
|
@@ -3428,9 +3356,9 @@ module Delorean
|
|
|
3428
3356
|
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
|
3429
3357
|
s1 << r3
|
|
3430
3358
|
if r3
|
|
3431
|
-
if
|
|
3432
|
-
r10 =
|
|
3433
|
-
@index +=
|
|
3359
|
+
if has_terminal?('"', false, index)
|
|
3360
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
3361
|
+
@index += 1
|
|
3434
3362
|
else
|
|
3435
3363
|
terminal_parse_failure('"')
|
|
3436
3364
|
r10 = nil
|
|
@@ -3446,13 +3374,12 @@ module Delorean
|
|
|
3446
3374
|
r1 = nil
|
|
3447
3375
|
end
|
|
3448
3376
|
if r1
|
|
3449
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
3450
3377
|
r0 = r1
|
|
3451
3378
|
else
|
|
3452
3379
|
i11, s11 = index, []
|
|
3453
|
-
if
|
|
3454
|
-
r12 =
|
|
3455
|
-
@index +=
|
|
3380
|
+
if has_terminal?("'", false, index)
|
|
3381
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
3382
|
+
@index += 1
|
|
3456
3383
|
else
|
|
3457
3384
|
terminal_parse_failure("'")
|
|
3458
3385
|
r12 = nil
|
|
@@ -3461,11 +3388,10 @@ module Delorean
|
|
|
3461
3388
|
if r12
|
|
3462
3389
|
s13, i13 = [], index
|
|
3463
3390
|
loop do
|
|
3464
|
-
if has_terminal?(
|
|
3391
|
+
if has_terminal?('\G[^\']', true, index)
|
|
3465
3392
|
r14 = true
|
|
3466
3393
|
@index += 1
|
|
3467
3394
|
else
|
|
3468
|
-
terminal_parse_failure('[^\']')
|
|
3469
3395
|
r14 = nil
|
|
3470
3396
|
end
|
|
3471
3397
|
if r14
|
|
@@ -3477,9 +3403,9 @@ module Delorean
|
|
|
3477
3403
|
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
|
3478
3404
|
s11 << r13
|
|
3479
3405
|
if r13
|
|
3480
|
-
if
|
|
3481
|
-
r15 =
|
|
3482
|
-
@index +=
|
|
3406
|
+
if has_terminal?("'", false, index)
|
|
3407
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
3408
|
+
@index += 1
|
|
3483
3409
|
else
|
|
3484
3410
|
terminal_parse_failure("'")
|
|
3485
3411
|
r15 = nil
|
|
@@ -3495,7 +3421,6 @@ module Delorean
|
|
|
3495
3421
|
r11 = nil
|
|
3496
3422
|
end
|
|
3497
3423
|
if r11
|
|
3498
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
3499
3424
|
r0 = r11
|
|
3500
3425
|
else
|
|
3501
3426
|
@index = i0
|