timing 0.0.4 → 0.0.5
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/lib/timing/natural_time_language.rb +369 -488
- data/lib/timing/natural_time_language.treetop +58 -58
- data/lib/timing/natural_time_language_interpreters.rb +1 -1
- data/lib/timing/version.rb +1 -1
- data/timing.gemspec +1 -1
- metadata +4 -4
|
@@ -25,7 +25,7 @@ module Timing
|
|
|
25
25
|
if node_cache[:expression].has_key?(index)
|
|
26
26
|
cached = node_cache[:expression][index]
|
|
27
27
|
if cached
|
|
28
|
-
|
|
28
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
29
29
|
@index = cached.interval.end
|
|
30
30
|
end
|
|
31
31
|
return cached
|
|
@@ -100,7 +100,7 @@ module Timing
|
|
|
100
100
|
if node_cache[:moment].has_key?(index)
|
|
101
101
|
cached = node_cache[:moment][index]
|
|
102
102
|
if cached
|
|
103
|
-
|
|
103
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
104
104
|
@index = cached.interval.end
|
|
105
105
|
end
|
|
106
106
|
return cached
|
|
@@ -109,27 +109,22 @@ module Timing
|
|
|
109
109
|
i0 = index
|
|
110
110
|
r1 = _nt_timestamp
|
|
111
111
|
if r1
|
|
112
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
113
112
|
r0 = r1
|
|
114
113
|
else
|
|
115
114
|
r2 = _nt_time_ago
|
|
116
115
|
if r2
|
|
117
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
118
116
|
r0 = r2
|
|
119
117
|
else
|
|
120
118
|
r3 = _nt_moment_at_time
|
|
121
119
|
if r3
|
|
122
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
123
120
|
r0 = r3
|
|
124
121
|
else
|
|
125
122
|
r4 = _nt_before_from_moment
|
|
126
123
|
if r4
|
|
127
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
128
124
|
r0 = r4
|
|
129
125
|
else
|
|
130
126
|
r5 = _nt_date_moment
|
|
131
127
|
if r5
|
|
132
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
133
128
|
r0 = r5
|
|
134
129
|
else
|
|
135
130
|
@index = i0
|
|
@@ -150,7 +145,7 @@ module Timing
|
|
|
150
145
|
if node_cache[:date_moment].has_key?(index)
|
|
151
146
|
cached = node_cache[:date_moment][index]
|
|
152
147
|
if cached
|
|
153
|
-
|
|
148
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
154
149
|
@index = cached.interval.end
|
|
155
150
|
end
|
|
156
151
|
return cached
|
|
@@ -159,27 +154,22 @@ module Timing
|
|
|
159
154
|
i0 = index
|
|
160
155
|
r1 = _nt_named_moment
|
|
161
156
|
if r1
|
|
162
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
163
157
|
r0 = r1
|
|
164
158
|
else
|
|
165
159
|
r2 = _nt_last_next_day_name
|
|
166
160
|
if r2
|
|
167
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
168
161
|
r0 = r2
|
|
169
162
|
else
|
|
170
163
|
r3 = _nt_day_month_name_year
|
|
171
164
|
if r3
|
|
172
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
173
165
|
r0 = r3
|
|
174
166
|
else
|
|
175
167
|
r4 = _nt_year_month_day
|
|
176
168
|
if r4
|
|
177
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
178
169
|
r0 = r4
|
|
179
170
|
else
|
|
180
171
|
r5 = _nt_beginning_end_interval
|
|
181
172
|
if r5
|
|
182
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
183
173
|
r0 = r5
|
|
184
174
|
else
|
|
185
175
|
@index = i0
|
|
@@ -200,7 +190,7 @@ module Timing
|
|
|
200
190
|
if node_cache[:named_moment].has_key?(index)
|
|
201
191
|
cached = node_cache[:named_moment][index]
|
|
202
192
|
if cached
|
|
203
|
-
|
|
193
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
204
194
|
@index = cached.interval.end
|
|
205
195
|
end
|
|
206
196
|
return cached
|
|
@@ -209,22 +199,18 @@ module Timing
|
|
|
209
199
|
i0 = index
|
|
210
200
|
r1 = _nt_now
|
|
211
201
|
if r1
|
|
212
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
213
202
|
r0 = r1
|
|
214
203
|
else
|
|
215
204
|
r2 = _nt_today
|
|
216
205
|
if r2
|
|
217
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
218
206
|
r0 = r2
|
|
219
207
|
else
|
|
220
208
|
r3 = _nt_tomorrow
|
|
221
209
|
if r3
|
|
222
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
223
210
|
r0 = r3
|
|
224
211
|
else
|
|
225
212
|
r4 = _nt_yesterday
|
|
226
213
|
if r4
|
|
227
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
228
214
|
r0 = r4
|
|
229
215
|
else
|
|
230
216
|
@index = i0
|
|
@@ -254,7 +240,7 @@ module Timing
|
|
|
254
240
|
if node_cache[:last_next_day_name].has_key?(index)
|
|
255
241
|
cached = node_cache[:last_next_day_name][index]
|
|
256
242
|
if cached
|
|
257
|
-
|
|
243
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
258
244
|
@index = cached.interval.end
|
|
259
245
|
end
|
|
260
246
|
return cached
|
|
@@ -313,7 +299,7 @@ module Timing
|
|
|
313
299
|
if node_cache[:day_month_name_year].has_key?(index)
|
|
314
300
|
cached = node_cache[:day_month_name_year][index]
|
|
315
301
|
if cached
|
|
316
|
-
|
|
302
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
317
303
|
@index = cached.interval.end
|
|
318
304
|
end
|
|
319
305
|
return cached
|
|
@@ -406,7 +392,7 @@ module Timing
|
|
|
406
392
|
if node_cache[:year_month_day].has_key?(index)
|
|
407
393
|
cached = node_cache[:year_month_day][index]
|
|
408
394
|
if cached
|
|
409
|
-
|
|
395
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
410
396
|
@index = cached.interval.end
|
|
411
397
|
end
|
|
412
398
|
return cached
|
|
@@ -416,11 +402,11 @@ module Timing
|
|
|
416
402
|
r1 = _nt_integer
|
|
417
403
|
s0 << r1
|
|
418
404
|
if r1
|
|
419
|
-
if
|
|
420
|
-
r2 =
|
|
421
|
-
@index +=
|
|
405
|
+
if has_terminal?('-', false, index)
|
|
406
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
407
|
+
@index += 1
|
|
422
408
|
else
|
|
423
|
-
terminal_parse_failure('
|
|
409
|
+
terminal_parse_failure('-')
|
|
424
410
|
r2 = nil
|
|
425
411
|
end
|
|
426
412
|
s0 << r2
|
|
@@ -428,11 +414,11 @@ module Timing
|
|
|
428
414
|
r3 = _nt_integer
|
|
429
415
|
s0 << r3
|
|
430
416
|
if r3
|
|
431
|
-
if
|
|
432
|
-
r4 =
|
|
433
|
-
@index +=
|
|
417
|
+
if has_terminal?('-', false, index)
|
|
418
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
419
|
+
@index += 1
|
|
434
420
|
else
|
|
435
|
-
terminal_parse_failure('
|
|
421
|
+
terminal_parse_failure('-')
|
|
436
422
|
r4 = nil
|
|
437
423
|
end
|
|
438
424
|
s0 << r4
|
|
@@ -471,7 +457,7 @@ module Timing
|
|
|
471
457
|
if node_cache[:beginning_end_interval].has_key?(index)
|
|
472
458
|
cached = node_cache[:beginning_end_interval][index]
|
|
473
459
|
if cached
|
|
474
|
-
|
|
460
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
475
461
|
@index = cached.interval.end
|
|
476
462
|
end
|
|
477
463
|
return cached
|
|
@@ -526,7 +512,7 @@ module Timing
|
|
|
526
512
|
if node_cache[:time_ago].has_key?(index)
|
|
527
513
|
cached = node_cache[:time_ago][index]
|
|
528
514
|
if cached
|
|
529
|
-
|
|
515
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
530
516
|
@index = cached.interval.end
|
|
531
517
|
end
|
|
532
518
|
return cached
|
|
@@ -563,11 +549,11 @@ module Timing
|
|
|
563
549
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
564
550
|
s0 << r5
|
|
565
551
|
if r5
|
|
566
|
-
if
|
|
567
|
-
r7 = instantiate_node(SyntaxNode,input, index...(index +
|
|
568
|
-
@index +=
|
|
552
|
+
if has_terminal?('ago', false, index)
|
|
553
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
554
|
+
@index += 3
|
|
569
555
|
else
|
|
570
|
-
terminal_parse_failure('
|
|
556
|
+
terminal_parse_failure('ago')
|
|
571
557
|
r7 = nil
|
|
572
558
|
end
|
|
573
559
|
s0 << r7
|
|
@@ -603,7 +589,7 @@ module Timing
|
|
|
603
589
|
if node_cache[:moment_at_time].has_key?(index)
|
|
604
590
|
cached = node_cache[:moment_at_time][index]
|
|
605
591
|
if cached
|
|
606
|
-
|
|
592
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
607
593
|
@index = cached.interval.end
|
|
608
594
|
end
|
|
609
595
|
return cached
|
|
@@ -625,11 +611,11 @@ module Timing
|
|
|
625
611
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
626
612
|
s0 << r2
|
|
627
613
|
if r2
|
|
628
|
-
if
|
|
629
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
630
|
-
@index +=
|
|
614
|
+
if has_terminal?('at', false, index)
|
|
615
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
616
|
+
@index += 2
|
|
631
617
|
else
|
|
632
|
-
terminal_parse_failure('
|
|
618
|
+
terminal_parse_failure('at')
|
|
633
619
|
r4 = nil
|
|
634
620
|
end
|
|
635
621
|
s0 << r4
|
|
@@ -688,7 +674,7 @@ module Timing
|
|
|
688
674
|
if node_cache[:before_from_moment].has_key?(index)
|
|
689
675
|
cached = node_cache[:before_from_moment][index]
|
|
690
676
|
if cached
|
|
691
|
-
|
|
677
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
692
678
|
@index = cached.interval.end
|
|
693
679
|
end
|
|
694
680
|
return cached
|
|
@@ -769,7 +755,7 @@ module Timing
|
|
|
769
755
|
if node_cache[:timestamp].has_key?(index)
|
|
770
756
|
cached = node_cache[:timestamp][index]
|
|
771
757
|
if cached
|
|
772
|
-
|
|
758
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
773
759
|
@index = cached.interval.end
|
|
774
760
|
end
|
|
775
761
|
return cached
|
|
@@ -778,11 +764,10 @@ module Timing
|
|
|
778
764
|
i0, s0 = index, []
|
|
779
765
|
s1, i1 = [], index
|
|
780
766
|
loop do
|
|
781
|
-
if has_terminal?(
|
|
767
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
782
768
|
r2 = true
|
|
783
769
|
@index += 1
|
|
784
770
|
else
|
|
785
|
-
terminal_parse_failure('[\\d]')
|
|
786
771
|
r2 = nil
|
|
787
772
|
end
|
|
788
773
|
if r2
|
|
@@ -798,29 +783,25 @@ module Timing
|
|
|
798
783
|
@index = i1
|
|
799
784
|
r1 = nil
|
|
800
785
|
else
|
|
801
|
-
if s1.size < 4
|
|
802
|
-
terminal_failures.pop
|
|
803
|
-
end
|
|
804
786
|
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
805
787
|
end
|
|
806
788
|
s0 << r1
|
|
807
789
|
if r1
|
|
808
|
-
if
|
|
809
|
-
r3 =
|
|
810
|
-
@index +=
|
|
790
|
+
if has_terminal?('-', false, index)
|
|
791
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
792
|
+
@index += 1
|
|
811
793
|
else
|
|
812
|
-
terminal_parse_failure('
|
|
794
|
+
terminal_parse_failure('-')
|
|
813
795
|
r3 = nil
|
|
814
796
|
end
|
|
815
797
|
s0 << r3
|
|
816
798
|
if r3
|
|
817
799
|
s4, i4 = [], index
|
|
818
800
|
loop do
|
|
819
|
-
if has_terminal?(
|
|
801
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
820
802
|
r5 = true
|
|
821
803
|
@index += 1
|
|
822
804
|
else
|
|
823
|
-
terminal_parse_failure('[\\d]')
|
|
824
805
|
r5 = nil
|
|
825
806
|
end
|
|
826
807
|
if r5
|
|
@@ -836,29 +817,25 @@ module Timing
|
|
|
836
817
|
@index = i4
|
|
837
818
|
r4 = nil
|
|
838
819
|
else
|
|
839
|
-
if s4.size < 2
|
|
840
|
-
terminal_failures.pop
|
|
841
|
-
end
|
|
842
820
|
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
|
843
821
|
end
|
|
844
822
|
s0 << r4
|
|
845
823
|
if r4
|
|
846
|
-
if
|
|
847
|
-
r6 =
|
|
848
|
-
@index +=
|
|
824
|
+
if has_terminal?('-', false, index)
|
|
825
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
826
|
+
@index += 1
|
|
849
827
|
else
|
|
850
|
-
terminal_parse_failure('
|
|
828
|
+
terminal_parse_failure('-')
|
|
851
829
|
r6 = nil
|
|
852
830
|
end
|
|
853
831
|
s0 << r6
|
|
854
832
|
if r6
|
|
855
833
|
s7, i7 = [], index
|
|
856
834
|
loop do
|
|
857
|
-
if has_terminal?(
|
|
835
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
858
836
|
r8 = true
|
|
859
837
|
@index += 1
|
|
860
838
|
else
|
|
861
|
-
terminal_parse_failure('[\\d]')
|
|
862
839
|
r8 = nil
|
|
863
840
|
end
|
|
864
841
|
if r8
|
|
@@ -874,9 +851,6 @@ module Timing
|
|
|
874
851
|
@index = i7
|
|
875
852
|
r7 = nil
|
|
876
853
|
else
|
|
877
|
-
if s7.size < 2
|
|
878
|
-
terminal_failures.pop
|
|
879
|
-
end
|
|
880
854
|
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
|
881
855
|
end
|
|
882
856
|
s0 << r7
|
|
@@ -893,11 +867,11 @@ module Timing
|
|
|
893
867
|
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
|
894
868
|
s0 << r9
|
|
895
869
|
if r9
|
|
896
|
-
if
|
|
897
|
-
r12 =
|
|
898
|
-
@index +=
|
|
870
|
+
if has_terminal?('t', false, index)
|
|
871
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
872
|
+
@index += 1
|
|
899
873
|
else
|
|
900
|
-
terminal_parse_failure('
|
|
874
|
+
terminal_parse_failure('t')
|
|
901
875
|
r12 = nil
|
|
902
876
|
end
|
|
903
877
|
if r12
|
|
@@ -921,11 +895,10 @@ module Timing
|
|
|
921
895
|
if r13
|
|
922
896
|
s15, i15 = [], index
|
|
923
897
|
loop do
|
|
924
|
-
if has_terminal?(
|
|
898
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
925
899
|
r16 = true
|
|
926
900
|
@index += 1
|
|
927
901
|
else
|
|
928
|
-
terminal_parse_failure('[\\d]')
|
|
929
902
|
r16 = nil
|
|
930
903
|
end
|
|
931
904
|
if r16
|
|
@@ -941,29 +914,25 @@ module Timing
|
|
|
941
914
|
@index = i15
|
|
942
915
|
r15 = nil
|
|
943
916
|
else
|
|
944
|
-
if s15.size < 2
|
|
945
|
-
terminal_failures.pop
|
|
946
|
-
end
|
|
947
917
|
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
|
948
918
|
end
|
|
949
919
|
s0 << r15
|
|
950
920
|
if r15
|
|
951
|
-
if
|
|
952
|
-
r17 =
|
|
953
|
-
@index +=
|
|
921
|
+
if has_terminal?(':', false, index)
|
|
922
|
+
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
923
|
+
@index += 1
|
|
954
924
|
else
|
|
955
|
-
terminal_parse_failure('
|
|
925
|
+
terminal_parse_failure(':')
|
|
956
926
|
r17 = nil
|
|
957
927
|
end
|
|
958
928
|
s0 << r17
|
|
959
929
|
if r17
|
|
960
930
|
s18, i18 = [], index
|
|
961
931
|
loop do
|
|
962
|
-
if has_terminal?(
|
|
932
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
963
933
|
r19 = true
|
|
964
934
|
@index += 1
|
|
965
935
|
else
|
|
966
|
-
terminal_parse_failure('[\\d]')
|
|
967
936
|
r19 = nil
|
|
968
937
|
end
|
|
969
938
|
if r19
|
|
@@ -979,29 +948,25 @@ module Timing
|
|
|
979
948
|
@index = i18
|
|
980
949
|
r18 = nil
|
|
981
950
|
else
|
|
982
|
-
if s18.size < 2
|
|
983
|
-
terminal_failures.pop
|
|
984
|
-
end
|
|
985
951
|
r18 = instantiate_node(SyntaxNode,input, i18...index, s18)
|
|
986
952
|
end
|
|
987
953
|
s0 << r18
|
|
988
954
|
if r18
|
|
989
|
-
if
|
|
990
|
-
r20 =
|
|
991
|
-
@index +=
|
|
955
|
+
if has_terminal?(':', false, index)
|
|
956
|
+
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
957
|
+
@index += 1
|
|
992
958
|
else
|
|
993
|
-
terminal_parse_failure('
|
|
959
|
+
terminal_parse_failure(':')
|
|
994
960
|
r20 = nil
|
|
995
961
|
end
|
|
996
962
|
s0 << r20
|
|
997
963
|
if r20
|
|
998
964
|
s21, i21 = [], index
|
|
999
965
|
loop do
|
|
1000
|
-
if has_terminal?(
|
|
966
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
1001
967
|
r22 = true
|
|
1002
968
|
@index += 1
|
|
1003
969
|
else
|
|
1004
|
-
terminal_parse_failure('[\\d]')
|
|
1005
970
|
r22 = nil
|
|
1006
971
|
end
|
|
1007
972
|
if r22
|
|
@@ -1017,9 +982,6 @@ module Timing
|
|
|
1017
982
|
@index = i21
|
|
1018
983
|
r21 = nil
|
|
1019
984
|
else
|
|
1020
|
-
if s21.size < 2
|
|
1021
|
-
terminal_failures.pop
|
|
1022
|
-
end
|
|
1023
985
|
r21 = instantiate_node(SyntaxNode,input, i21...index, s21)
|
|
1024
986
|
end
|
|
1025
987
|
s0 << r21
|
|
@@ -1053,17 +1015,17 @@ module Timing
|
|
|
1053
1015
|
if node_cache[:now].has_key?(index)
|
|
1054
1016
|
cached = node_cache[:now][index]
|
|
1055
1017
|
if cached
|
|
1056
|
-
|
|
1018
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1057
1019
|
@index = cached.interval.end
|
|
1058
1020
|
end
|
|
1059
1021
|
return cached
|
|
1060
1022
|
end
|
|
1061
1023
|
|
|
1062
|
-
if
|
|
1063
|
-
r0 = instantiate_node(Now,input, index...(index +
|
|
1064
|
-
@index +=
|
|
1024
|
+
if has_terminal?('now', false, index)
|
|
1025
|
+
r0 = instantiate_node(Now,input, index...(index + 3))
|
|
1026
|
+
@index += 3
|
|
1065
1027
|
else
|
|
1066
|
-
terminal_parse_failure('
|
|
1028
|
+
terminal_parse_failure('now')
|
|
1067
1029
|
r0 = nil
|
|
1068
1030
|
end
|
|
1069
1031
|
|
|
@@ -1077,17 +1039,17 @@ module Timing
|
|
|
1077
1039
|
if node_cache[:today].has_key?(index)
|
|
1078
1040
|
cached = node_cache[:today][index]
|
|
1079
1041
|
if cached
|
|
1080
|
-
|
|
1042
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1081
1043
|
@index = cached.interval.end
|
|
1082
1044
|
end
|
|
1083
1045
|
return cached
|
|
1084
1046
|
end
|
|
1085
1047
|
|
|
1086
|
-
if
|
|
1087
|
-
r0 = instantiate_node(Today,input, index...(index +
|
|
1088
|
-
@index +=
|
|
1048
|
+
if has_terminal?('today', false, index)
|
|
1049
|
+
r0 = instantiate_node(Today,input, index...(index + 5))
|
|
1050
|
+
@index += 5
|
|
1089
1051
|
else
|
|
1090
|
-
terminal_parse_failure('
|
|
1052
|
+
terminal_parse_failure('today')
|
|
1091
1053
|
r0 = nil
|
|
1092
1054
|
end
|
|
1093
1055
|
|
|
@@ -1101,17 +1063,17 @@ module Timing
|
|
|
1101
1063
|
if node_cache[:tomorrow].has_key?(index)
|
|
1102
1064
|
cached = node_cache[:tomorrow][index]
|
|
1103
1065
|
if cached
|
|
1104
|
-
|
|
1066
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1105
1067
|
@index = cached.interval.end
|
|
1106
1068
|
end
|
|
1107
1069
|
return cached
|
|
1108
1070
|
end
|
|
1109
1071
|
|
|
1110
|
-
if
|
|
1111
|
-
r0 = instantiate_node(Tomorrow,input, index...(index +
|
|
1112
|
-
@index +=
|
|
1072
|
+
if has_terminal?('tomorrow', false, index)
|
|
1073
|
+
r0 = instantiate_node(Tomorrow,input, index...(index + 8))
|
|
1074
|
+
@index += 8
|
|
1113
1075
|
else
|
|
1114
|
-
terminal_parse_failure('
|
|
1076
|
+
terminal_parse_failure('tomorrow')
|
|
1115
1077
|
r0 = nil
|
|
1116
1078
|
end
|
|
1117
1079
|
|
|
@@ -1125,17 +1087,17 @@ module Timing
|
|
|
1125
1087
|
if node_cache[:yesterday].has_key?(index)
|
|
1126
1088
|
cached = node_cache[:yesterday][index]
|
|
1127
1089
|
if cached
|
|
1128
|
-
|
|
1090
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1129
1091
|
@index = cached.interval.end
|
|
1130
1092
|
end
|
|
1131
1093
|
return cached
|
|
1132
1094
|
end
|
|
1133
1095
|
|
|
1134
|
-
if
|
|
1135
|
-
r0 = instantiate_node(Yesterday,input, index...(index +
|
|
1136
|
-
@index +=
|
|
1096
|
+
if has_terminal?('yesterday', false, index)
|
|
1097
|
+
r0 = instantiate_node(Yesterday,input, index...(index + 9))
|
|
1098
|
+
@index += 9
|
|
1137
1099
|
else
|
|
1138
|
-
terminal_parse_failure('
|
|
1100
|
+
terminal_parse_failure('yesterday')
|
|
1139
1101
|
r0 = nil
|
|
1140
1102
|
end
|
|
1141
1103
|
|
|
@@ -1149,7 +1111,7 @@ module Timing
|
|
|
1149
1111
|
if node_cache[:last_next].has_key?(index)
|
|
1150
1112
|
cached = node_cache[:last_next][index]
|
|
1151
1113
|
if cached
|
|
1152
|
-
|
|
1114
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1153
1115
|
@index = cached.interval.end
|
|
1154
1116
|
end
|
|
1155
1117
|
return cached
|
|
@@ -1158,12 +1120,10 @@ module Timing
|
|
|
1158
1120
|
i0 = index
|
|
1159
1121
|
r1 = _nt_last
|
|
1160
1122
|
if r1
|
|
1161
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1162
1123
|
r0 = r1
|
|
1163
1124
|
else
|
|
1164
1125
|
r2 = _nt_next
|
|
1165
1126
|
if r2
|
|
1166
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1167
1127
|
r0 = r2
|
|
1168
1128
|
else
|
|
1169
1129
|
@index = i0
|
|
@@ -1181,17 +1141,17 @@ module Timing
|
|
|
1181
1141
|
if node_cache[:last].has_key?(index)
|
|
1182
1142
|
cached = node_cache[:last][index]
|
|
1183
1143
|
if cached
|
|
1184
|
-
|
|
1144
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1185
1145
|
@index = cached.interval.end
|
|
1186
1146
|
end
|
|
1187
1147
|
return cached
|
|
1188
1148
|
end
|
|
1189
1149
|
|
|
1190
|
-
if
|
|
1191
|
-
r0 = instantiate_node(LastNext,input, index...(index +
|
|
1192
|
-
@index +=
|
|
1150
|
+
if has_terminal?('last', false, index)
|
|
1151
|
+
r0 = instantiate_node(LastNext,input, index...(index + 4))
|
|
1152
|
+
@index += 4
|
|
1193
1153
|
else
|
|
1194
|
-
terminal_parse_failure('
|
|
1154
|
+
terminal_parse_failure('last')
|
|
1195
1155
|
r0 = nil
|
|
1196
1156
|
end
|
|
1197
1157
|
|
|
@@ -1205,17 +1165,17 @@ module Timing
|
|
|
1205
1165
|
if node_cache[:next].has_key?(index)
|
|
1206
1166
|
cached = node_cache[:next][index]
|
|
1207
1167
|
if cached
|
|
1208
|
-
|
|
1168
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1209
1169
|
@index = cached.interval.end
|
|
1210
1170
|
end
|
|
1211
1171
|
return cached
|
|
1212
1172
|
end
|
|
1213
1173
|
|
|
1214
|
-
if
|
|
1215
|
-
r0 = instantiate_node(LastNext,input, index...(index +
|
|
1216
|
-
@index +=
|
|
1174
|
+
if has_terminal?('next', false, index)
|
|
1175
|
+
r0 = instantiate_node(LastNext,input, index...(index + 4))
|
|
1176
|
+
@index += 4
|
|
1217
1177
|
else
|
|
1218
|
-
terminal_parse_failure('
|
|
1178
|
+
terminal_parse_failure('next')
|
|
1219
1179
|
r0 = nil
|
|
1220
1180
|
end
|
|
1221
1181
|
|
|
@@ -1229,7 +1189,7 @@ module Timing
|
|
|
1229
1189
|
if node_cache[:beginning_end].has_key?(index)
|
|
1230
1190
|
cached = node_cache[:beginning_end][index]
|
|
1231
1191
|
if cached
|
|
1232
|
-
|
|
1192
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1233
1193
|
@index = cached.interval.end
|
|
1234
1194
|
end
|
|
1235
1195
|
return cached
|
|
@@ -1238,12 +1198,10 @@ module Timing
|
|
|
1238
1198
|
i0 = index
|
|
1239
1199
|
r1 = _nt_beginning_of
|
|
1240
1200
|
if r1
|
|
1241
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1242
1201
|
r0 = r1
|
|
1243
1202
|
else
|
|
1244
1203
|
r2 = _nt_end_of
|
|
1245
1204
|
if r2
|
|
1246
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1247
1205
|
r0 = r2
|
|
1248
1206
|
else
|
|
1249
1207
|
@index = i0
|
|
@@ -1268,18 +1226,18 @@ module Timing
|
|
|
1268
1226
|
if node_cache[:beginning_of].has_key?(index)
|
|
1269
1227
|
cached = node_cache[:beginning_of][index]
|
|
1270
1228
|
if cached
|
|
1271
|
-
|
|
1229
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1272
1230
|
@index = cached.interval.end
|
|
1273
1231
|
end
|
|
1274
1232
|
return cached
|
|
1275
1233
|
end
|
|
1276
1234
|
|
|
1277
1235
|
i0, s0 = index, []
|
|
1278
|
-
if
|
|
1279
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1280
|
-
@index +=
|
|
1236
|
+
if has_terminal?('beginning', false, index)
|
|
1237
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 9))
|
|
1238
|
+
@index += 9
|
|
1281
1239
|
else
|
|
1282
|
-
terminal_parse_failure('
|
|
1240
|
+
terminal_parse_failure('beginning')
|
|
1283
1241
|
r1 = nil
|
|
1284
1242
|
end
|
|
1285
1243
|
s0 << r1
|
|
@@ -1296,11 +1254,11 @@ module Timing
|
|
|
1296
1254
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
1297
1255
|
s0 << r2
|
|
1298
1256
|
if r2
|
|
1299
|
-
if
|
|
1300
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1301
|
-
@index +=
|
|
1257
|
+
if has_terminal?('of', false, index)
|
|
1258
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1259
|
+
@index += 2
|
|
1302
1260
|
else
|
|
1303
|
-
terminal_parse_failure('
|
|
1261
|
+
terminal_parse_failure('of')
|
|
1304
1262
|
r4 = nil
|
|
1305
1263
|
end
|
|
1306
1264
|
s0 << r4
|
|
@@ -1331,18 +1289,18 @@ module Timing
|
|
|
1331
1289
|
if node_cache[:end_of].has_key?(index)
|
|
1332
1290
|
cached = node_cache[:end_of][index]
|
|
1333
1291
|
if cached
|
|
1334
|
-
|
|
1292
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1335
1293
|
@index = cached.interval.end
|
|
1336
1294
|
end
|
|
1337
1295
|
return cached
|
|
1338
1296
|
end
|
|
1339
1297
|
|
|
1340
1298
|
i0, s0 = index, []
|
|
1341
|
-
if
|
|
1342
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1343
|
-
@index +=
|
|
1299
|
+
if has_terminal?('end', false, index)
|
|
1300
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1301
|
+
@index += 3
|
|
1344
1302
|
else
|
|
1345
|
-
terminal_parse_failure('
|
|
1303
|
+
terminal_parse_failure('end')
|
|
1346
1304
|
r1 = nil
|
|
1347
1305
|
end
|
|
1348
1306
|
s0 << r1
|
|
@@ -1359,11 +1317,11 @@ module Timing
|
|
|
1359
1317
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
1360
1318
|
s0 << r2
|
|
1361
1319
|
if r2
|
|
1362
|
-
if
|
|
1363
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1364
|
-
@index +=
|
|
1320
|
+
if has_terminal?('of', false, index)
|
|
1321
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1322
|
+
@index += 2
|
|
1365
1323
|
else
|
|
1366
|
-
terminal_parse_failure('
|
|
1324
|
+
terminal_parse_failure('of')
|
|
1367
1325
|
r4 = nil
|
|
1368
1326
|
end
|
|
1369
1327
|
s0 << r4
|
|
@@ -1387,7 +1345,7 @@ module Timing
|
|
|
1387
1345
|
if node_cache[:before_from].has_key?(index)
|
|
1388
1346
|
cached = node_cache[:before_from][index]
|
|
1389
1347
|
if cached
|
|
1390
|
-
|
|
1348
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1391
1349
|
@index = cached.interval.end
|
|
1392
1350
|
end
|
|
1393
1351
|
return cached
|
|
@@ -1396,12 +1354,10 @@ module Timing
|
|
|
1396
1354
|
i0 = index
|
|
1397
1355
|
r1 = _nt_before
|
|
1398
1356
|
if r1
|
|
1399
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1400
1357
|
r0 = r1
|
|
1401
1358
|
else
|
|
1402
1359
|
r2 = _nt_from
|
|
1403
1360
|
if r2
|
|
1404
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1405
1361
|
r0 = r2
|
|
1406
1362
|
else
|
|
1407
1363
|
@index = i0
|
|
@@ -1419,17 +1375,17 @@ module Timing
|
|
|
1419
1375
|
if node_cache[:before].has_key?(index)
|
|
1420
1376
|
cached = node_cache[:before][index]
|
|
1421
1377
|
if cached
|
|
1422
|
-
|
|
1378
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1423
1379
|
@index = cached.interval.end
|
|
1424
1380
|
end
|
|
1425
1381
|
return cached
|
|
1426
1382
|
end
|
|
1427
1383
|
|
|
1428
|
-
if
|
|
1429
|
-
r0 = instantiate_node(BeforeFrom,input, index...(index +
|
|
1430
|
-
@index +=
|
|
1384
|
+
if has_terminal?('before', false, index)
|
|
1385
|
+
r0 = instantiate_node(BeforeFrom,input, index...(index + 6))
|
|
1386
|
+
@index += 6
|
|
1431
1387
|
else
|
|
1432
|
-
terminal_parse_failure('
|
|
1388
|
+
terminal_parse_failure('before')
|
|
1433
1389
|
r0 = nil
|
|
1434
1390
|
end
|
|
1435
1391
|
|
|
@@ -1443,17 +1399,17 @@ module Timing
|
|
|
1443
1399
|
if node_cache[:from].has_key?(index)
|
|
1444
1400
|
cached = node_cache[:from][index]
|
|
1445
1401
|
if cached
|
|
1446
|
-
|
|
1402
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1447
1403
|
@index = cached.interval.end
|
|
1448
1404
|
end
|
|
1449
1405
|
return cached
|
|
1450
1406
|
end
|
|
1451
1407
|
|
|
1452
|
-
if
|
|
1453
|
-
r0 = instantiate_node(BeforeFrom,input, index...(index +
|
|
1454
|
-
@index +=
|
|
1408
|
+
if has_terminal?('from', false, index)
|
|
1409
|
+
r0 = instantiate_node(BeforeFrom,input, index...(index + 4))
|
|
1410
|
+
@index += 4
|
|
1455
1411
|
else
|
|
1456
|
-
terminal_parse_failure('
|
|
1412
|
+
terminal_parse_failure('from')
|
|
1457
1413
|
r0 = nil
|
|
1458
1414
|
end
|
|
1459
1415
|
|
|
@@ -1467,7 +1423,7 @@ module Timing
|
|
|
1467
1423
|
if node_cache[:interval].has_key?(index)
|
|
1468
1424
|
cached = node_cache[:interval][index]
|
|
1469
1425
|
if cached
|
|
1470
|
-
|
|
1426
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1471
1427
|
@index = cached.interval.end
|
|
1472
1428
|
end
|
|
1473
1429
|
return cached
|
|
@@ -1476,37 +1432,30 @@ module Timing
|
|
|
1476
1432
|
i0 = index
|
|
1477
1433
|
r1 = _nt_second_interval
|
|
1478
1434
|
if r1
|
|
1479
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1480
1435
|
r0 = r1
|
|
1481
1436
|
else
|
|
1482
1437
|
r2 = _nt_minute_interval
|
|
1483
1438
|
if r2
|
|
1484
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1485
1439
|
r0 = r2
|
|
1486
1440
|
else
|
|
1487
1441
|
r3 = _nt_hour_interval
|
|
1488
1442
|
if r3
|
|
1489
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
1490
1443
|
r0 = r3
|
|
1491
1444
|
else
|
|
1492
1445
|
r4 = _nt_day_interval
|
|
1493
1446
|
if r4
|
|
1494
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
1495
1447
|
r0 = r4
|
|
1496
1448
|
else
|
|
1497
1449
|
r5 = _nt_week_interval
|
|
1498
1450
|
if r5
|
|
1499
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
1500
1451
|
r0 = r5
|
|
1501
1452
|
else
|
|
1502
1453
|
r6 = _nt_month_interval
|
|
1503
1454
|
if r6
|
|
1504
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
1505
1455
|
r0 = r6
|
|
1506
1456
|
else
|
|
1507
1457
|
r7 = _nt_year_interval
|
|
1508
1458
|
if r7
|
|
1509
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
1510
1459
|
r0 = r7
|
|
1511
1460
|
else
|
|
1512
1461
|
@index = i0
|
|
@@ -1532,27 +1481,27 @@ module Timing
|
|
|
1532
1481
|
if node_cache[:second_interval].has_key?(index)
|
|
1533
1482
|
cached = node_cache[:second_interval][index]
|
|
1534
1483
|
if cached
|
|
1535
|
-
|
|
1484
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1536
1485
|
@index = cached.interval.end
|
|
1537
1486
|
end
|
|
1538
1487
|
return cached
|
|
1539
1488
|
end
|
|
1540
1489
|
|
|
1541
1490
|
i0, s0 = index, []
|
|
1542
|
-
if
|
|
1543
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1544
|
-
@index +=
|
|
1491
|
+
if has_terminal?('second', false, index)
|
|
1492
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
|
1493
|
+
@index += 6
|
|
1545
1494
|
else
|
|
1546
|
-
terminal_parse_failure('
|
|
1495
|
+
terminal_parse_failure('second')
|
|
1547
1496
|
r1 = nil
|
|
1548
1497
|
end
|
|
1549
1498
|
s0 << r1
|
|
1550
1499
|
if r1
|
|
1551
|
-
if
|
|
1552
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1553
|
-
@index +=
|
|
1500
|
+
if has_terminal?('s', false, index)
|
|
1501
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1502
|
+
@index += 1
|
|
1554
1503
|
else
|
|
1555
|
-
terminal_parse_failure('
|
|
1504
|
+
terminal_parse_failure('s')
|
|
1556
1505
|
r3 = nil
|
|
1557
1506
|
end
|
|
1558
1507
|
if r3
|
|
@@ -1583,27 +1532,27 @@ module Timing
|
|
|
1583
1532
|
if node_cache[:minute_interval].has_key?(index)
|
|
1584
1533
|
cached = node_cache[:minute_interval][index]
|
|
1585
1534
|
if cached
|
|
1586
|
-
|
|
1535
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1587
1536
|
@index = cached.interval.end
|
|
1588
1537
|
end
|
|
1589
1538
|
return cached
|
|
1590
1539
|
end
|
|
1591
1540
|
|
|
1592
1541
|
i0, s0 = index, []
|
|
1593
|
-
if
|
|
1594
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1595
|
-
@index +=
|
|
1542
|
+
if has_terminal?('minute', false, index)
|
|
1543
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
|
1544
|
+
@index += 6
|
|
1596
1545
|
else
|
|
1597
|
-
terminal_parse_failure('
|
|
1546
|
+
terminal_parse_failure('minute')
|
|
1598
1547
|
r1 = nil
|
|
1599
1548
|
end
|
|
1600
1549
|
s0 << r1
|
|
1601
1550
|
if r1
|
|
1602
|
-
if
|
|
1603
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1604
|
-
@index +=
|
|
1551
|
+
if has_terminal?('s', false, index)
|
|
1552
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1553
|
+
@index += 1
|
|
1605
1554
|
else
|
|
1606
|
-
terminal_parse_failure('
|
|
1555
|
+
terminal_parse_failure('s')
|
|
1607
1556
|
r3 = nil
|
|
1608
1557
|
end
|
|
1609
1558
|
if r3
|
|
@@ -1634,27 +1583,27 @@ module Timing
|
|
|
1634
1583
|
if node_cache[:hour_interval].has_key?(index)
|
|
1635
1584
|
cached = node_cache[:hour_interval][index]
|
|
1636
1585
|
if cached
|
|
1637
|
-
|
|
1586
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1638
1587
|
@index = cached.interval.end
|
|
1639
1588
|
end
|
|
1640
1589
|
return cached
|
|
1641
1590
|
end
|
|
1642
1591
|
|
|
1643
1592
|
i0, s0 = index, []
|
|
1644
|
-
if
|
|
1645
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1646
|
-
@index +=
|
|
1593
|
+
if has_terminal?('hour', false, index)
|
|
1594
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
1595
|
+
@index += 4
|
|
1647
1596
|
else
|
|
1648
|
-
terminal_parse_failure('
|
|
1597
|
+
terminal_parse_failure('hour')
|
|
1649
1598
|
r1 = nil
|
|
1650
1599
|
end
|
|
1651
1600
|
s0 << r1
|
|
1652
1601
|
if r1
|
|
1653
|
-
if
|
|
1654
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1655
|
-
@index +=
|
|
1602
|
+
if has_terminal?('s', false, index)
|
|
1603
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1604
|
+
@index += 1
|
|
1656
1605
|
else
|
|
1657
|
-
terminal_parse_failure('
|
|
1606
|
+
terminal_parse_failure('s')
|
|
1658
1607
|
r3 = nil
|
|
1659
1608
|
end
|
|
1660
1609
|
if r3
|
|
@@ -1685,27 +1634,27 @@ module Timing
|
|
|
1685
1634
|
if node_cache[:day_interval].has_key?(index)
|
|
1686
1635
|
cached = node_cache[:day_interval][index]
|
|
1687
1636
|
if cached
|
|
1688
|
-
|
|
1637
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1689
1638
|
@index = cached.interval.end
|
|
1690
1639
|
end
|
|
1691
1640
|
return cached
|
|
1692
1641
|
end
|
|
1693
1642
|
|
|
1694
1643
|
i0, s0 = index, []
|
|
1695
|
-
if
|
|
1696
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1697
|
-
@index +=
|
|
1644
|
+
if has_terminal?('day', false, index)
|
|
1645
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1646
|
+
@index += 3
|
|
1698
1647
|
else
|
|
1699
|
-
terminal_parse_failure('
|
|
1648
|
+
terminal_parse_failure('day')
|
|
1700
1649
|
r1 = nil
|
|
1701
1650
|
end
|
|
1702
1651
|
s0 << r1
|
|
1703
1652
|
if r1
|
|
1704
|
-
if
|
|
1705
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1706
|
-
@index +=
|
|
1653
|
+
if has_terminal?('s', false, index)
|
|
1654
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1655
|
+
@index += 1
|
|
1707
1656
|
else
|
|
1708
|
-
terminal_parse_failure('
|
|
1657
|
+
terminal_parse_failure('s')
|
|
1709
1658
|
r3 = nil
|
|
1710
1659
|
end
|
|
1711
1660
|
if r3
|
|
@@ -1736,27 +1685,27 @@ module Timing
|
|
|
1736
1685
|
if node_cache[:week_interval].has_key?(index)
|
|
1737
1686
|
cached = node_cache[:week_interval][index]
|
|
1738
1687
|
if cached
|
|
1739
|
-
|
|
1688
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1740
1689
|
@index = cached.interval.end
|
|
1741
1690
|
end
|
|
1742
1691
|
return cached
|
|
1743
1692
|
end
|
|
1744
1693
|
|
|
1745
1694
|
i0, s0 = index, []
|
|
1746
|
-
if
|
|
1747
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1748
|
-
@index +=
|
|
1695
|
+
if has_terminal?('week', false, index)
|
|
1696
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
1697
|
+
@index += 4
|
|
1749
1698
|
else
|
|
1750
|
-
terminal_parse_failure('
|
|
1699
|
+
terminal_parse_failure('week')
|
|
1751
1700
|
r1 = nil
|
|
1752
1701
|
end
|
|
1753
1702
|
s0 << r1
|
|
1754
1703
|
if r1
|
|
1755
|
-
if
|
|
1756
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1757
|
-
@index +=
|
|
1704
|
+
if has_terminal?('s', false, index)
|
|
1705
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1706
|
+
@index += 1
|
|
1758
1707
|
else
|
|
1759
|
-
terminal_parse_failure('
|
|
1708
|
+
terminal_parse_failure('s')
|
|
1760
1709
|
r3 = nil
|
|
1761
1710
|
end
|
|
1762
1711
|
if r3
|
|
@@ -1787,27 +1736,27 @@ module Timing
|
|
|
1787
1736
|
if node_cache[:month_interval].has_key?(index)
|
|
1788
1737
|
cached = node_cache[:month_interval][index]
|
|
1789
1738
|
if cached
|
|
1790
|
-
|
|
1739
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1791
1740
|
@index = cached.interval.end
|
|
1792
1741
|
end
|
|
1793
1742
|
return cached
|
|
1794
1743
|
end
|
|
1795
1744
|
|
|
1796
1745
|
i0, s0 = index, []
|
|
1797
|
-
if
|
|
1798
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1799
|
-
@index +=
|
|
1746
|
+
if has_terminal?('month', false, index)
|
|
1747
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
|
1748
|
+
@index += 5
|
|
1800
1749
|
else
|
|
1801
|
-
terminal_parse_failure('
|
|
1750
|
+
terminal_parse_failure('month')
|
|
1802
1751
|
r1 = nil
|
|
1803
1752
|
end
|
|
1804
1753
|
s0 << r1
|
|
1805
1754
|
if r1
|
|
1806
|
-
if
|
|
1807
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1808
|
-
@index +=
|
|
1755
|
+
if has_terminal?('s', false, index)
|
|
1756
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1757
|
+
@index += 1
|
|
1809
1758
|
else
|
|
1810
|
-
terminal_parse_failure('
|
|
1759
|
+
terminal_parse_failure('s')
|
|
1811
1760
|
r3 = nil
|
|
1812
1761
|
end
|
|
1813
1762
|
if r3
|
|
@@ -1838,27 +1787,27 @@ module Timing
|
|
|
1838
1787
|
if node_cache[:year_interval].has_key?(index)
|
|
1839
1788
|
cached = node_cache[:year_interval][index]
|
|
1840
1789
|
if cached
|
|
1841
|
-
|
|
1790
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1842
1791
|
@index = cached.interval.end
|
|
1843
1792
|
end
|
|
1844
1793
|
return cached
|
|
1845
1794
|
end
|
|
1846
1795
|
|
|
1847
1796
|
i0, s0 = index, []
|
|
1848
|
-
if
|
|
1849
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1850
|
-
@index +=
|
|
1797
|
+
if has_terminal?('year', false, index)
|
|
1798
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
1799
|
+
@index += 4
|
|
1851
1800
|
else
|
|
1852
|
-
terminal_parse_failure('
|
|
1801
|
+
terminal_parse_failure('year')
|
|
1853
1802
|
r1 = nil
|
|
1854
1803
|
end
|
|
1855
1804
|
s0 << r1
|
|
1856
1805
|
if r1
|
|
1857
|
-
if
|
|
1858
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1859
|
-
@index +=
|
|
1806
|
+
if has_terminal?('s', false, index)
|
|
1807
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1808
|
+
@index += 1
|
|
1860
1809
|
else
|
|
1861
|
-
terminal_parse_failure('
|
|
1810
|
+
terminal_parse_failure('s')
|
|
1862
1811
|
r3 = nil
|
|
1863
1812
|
end
|
|
1864
1813
|
if r3
|
|
@@ -1886,7 +1835,7 @@ module Timing
|
|
|
1886
1835
|
if node_cache[:day_name].has_key?(index)
|
|
1887
1836
|
cached = node_cache[:day_name][index]
|
|
1888
1837
|
if cached
|
|
1889
|
-
|
|
1838
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1890
1839
|
@index = cached.interval.end
|
|
1891
1840
|
end
|
|
1892
1841
|
return cached
|
|
@@ -1895,12 +1844,10 @@ module Timing
|
|
|
1895
1844
|
i0 = index
|
|
1896
1845
|
r1 = _nt_long_day_name
|
|
1897
1846
|
if r1
|
|
1898
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1899
1847
|
r0 = r1
|
|
1900
1848
|
else
|
|
1901
1849
|
r2 = _nt_short_day_name
|
|
1902
1850
|
if r2
|
|
1903
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1904
1851
|
r0 = r2
|
|
1905
1852
|
else
|
|
1906
1853
|
@index = i0
|
|
@@ -1918,88 +1865,81 @@ module Timing
|
|
|
1918
1865
|
if node_cache[:long_day_name].has_key?(index)
|
|
1919
1866
|
cached = node_cache[:long_day_name][index]
|
|
1920
1867
|
if cached
|
|
1921
|
-
|
|
1868
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1922
1869
|
@index = cached.interval.end
|
|
1923
1870
|
end
|
|
1924
1871
|
return cached
|
|
1925
1872
|
end
|
|
1926
1873
|
|
|
1927
1874
|
i0 = index
|
|
1928
|
-
if
|
|
1929
|
-
r1 = instantiate_node(DayName,input, index...(index +
|
|
1930
|
-
@index +=
|
|
1875
|
+
if has_terminal?('sunday', false, index)
|
|
1876
|
+
r1 = instantiate_node(DayName,input, index...(index + 6))
|
|
1877
|
+
@index += 6
|
|
1931
1878
|
else
|
|
1932
|
-
terminal_parse_failure('
|
|
1879
|
+
terminal_parse_failure('sunday')
|
|
1933
1880
|
r1 = nil
|
|
1934
1881
|
end
|
|
1935
1882
|
if r1
|
|
1936
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1937
1883
|
r0 = r1
|
|
1938
1884
|
else
|
|
1939
|
-
if
|
|
1940
|
-
r2 = instantiate_node(DayName,input, index...(index +
|
|
1941
|
-
@index +=
|
|
1885
|
+
if has_terminal?('monday', false, index)
|
|
1886
|
+
r2 = instantiate_node(DayName,input, index...(index + 6))
|
|
1887
|
+
@index += 6
|
|
1942
1888
|
else
|
|
1943
|
-
terminal_parse_failure('
|
|
1889
|
+
terminal_parse_failure('monday')
|
|
1944
1890
|
r2 = nil
|
|
1945
1891
|
end
|
|
1946
1892
|
if r2
|
|
1947
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1948
1893
|
r0 = r2
|
|
1949
1894
|
else
|
|
1950
|
-
if
|
|
1951
|
-
r3 = instantiate_node(DayName,input, index...(index +
|
|
1952
|
-
@index +=
|
|
1895
|
+
if has_terminal?('tuesday', false, index)
|
|
1896
|
+
r3 = instantiate_node(DayName,input, index...(index + 7))
|
|
1897
|
+
@index += 7
|
|
1953
1898
|
else
|
|
1954
|
-
terminal_parse_failure('
|
|
1899
|
+
terminal_parse_failure('tuesday')
|
|
1955
1900
|
r3 = nil
|
|
1956
1901
|
end
|
|
1957
1902
|
if r3
|
|
1958
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
1959
1903
|
r0 = r3
|
|
1960
1904
|
else
|
|
1961
|
-
if
|
|
1962
|
-
r4 = instantiate_node(DayName,input, index...(index +
|
|
1963
|
-
@index +=
|
|
1905
|
+
if has_terminal?('wednesday', false, index)
|
|
1906
|
+
r4 = instantiate_node(DayName,input, index...(index + 9))
|
|
1907
|
+
@index += 9
|
|
1964
1908
|
else
|
|
1965
|
-
terminal_parse_failure('
|
|
1909
|
+
terminal_parse_failure('wednesday')
|
|
1966
1910
|
r4 = nil
|
|
1967
1911
|
end
|
|
1968
1912
|
if r4
|
|
1969
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
1970
1913
|
r0 = r4
|
|
1971
1914
|
else
|
|
1972
|
-
if
|
|
1973
|
-
r5 = instantiate_node(DayName,input, index...(index +
|
|
1974
|
-
@index +=
|
|
1915
|
+
if has_terminal?('thursday', false, index)
|
|
1916
|
+
r5 = instantiate_node(DayName,input, index...(index + 8))
|
|
1917
|
+
@index += 8
|
|
1975
1918
|
else
|
|
1976
|
-
terminal_parse_failure('
|
|
1919
|
+
terminal_parse_failure('thursday')
|
|
1977
1920
|
r5 = nil
|
|
1978
1921
|
end
|
|
1979
1922
|
if r5
|
|
1980
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
1981
1923
|
r0 = r5
|
|
1982
1924
|
else
|
|
1983
|
-
if
|
|
1984
|
-
r6 = instantiate_node(DayName,input, index...(index +
|
|
1985
|
-
@index +=
|
|
1925
|
+
if has_terminal?('friday', false, index)
|
|
1926
|
+
r6 = instantiate_node(DayName,input, index...(index + 6))
|
|
1927
|
+
@index += 6
|
|
1986
1928
|
else
|
|
1987
|
-
terminal_parse_failure('
|
|
1929
|
+
terminal_parse_failure('friday')
|
|
1988
1930
|
r6 = nil
|
|
1989
1931
|
end
|
|
1990
1932
|
if r6
|
|
1991
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
1992
1933
|
r0 = r6
|
|
1993
1934
|
else
|
|
1994
|
-
if
|
|
1995
|
-
r7 = instantiate_node(DayName,input, index...(index +
|
|
1996
|
-
@index +=
|
|
1935
|
+
if has_terminal?('saturday', false, index)
|
|
1936
|
+
r7 = instantiate_node(DayName,input, index...(index + 8))
|
|
1937
|
+
@index += 8
|
|
1997
1938
|
else
|
|
1998
|
-
terminal_parse_failure('
|
|
1939
|
+
terminal_parse_failure('saturday')
|
|
1999
1940
|
r7 = nil
|
|
2000
1941
|
end
|
|
2001
1942
|
if r7
|
|
2002
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2003
1943
|
r0 = r7
|
|
2004
1944
|
else
|
|
2005
1945
|
@index = i0
|
|
@@ -2022,88 +1962,81 @@ module Timing
|
|
|
2022
1962
|
if node_cache[:short_day_name].has_key?(index)
|
|
2023
1963
|
cached = node_cache[:short_day_name][index]
|
|
2024
1964
|
if cached
|
|
2025
|
-
|
|
1965
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2026
1966
|
@index = cached.interval.end
|
|
2027
1967
|
end
|
|
2028
1968
|
return cached
|
|
2029
1969
|
end
|
|
2030
1970
|
|
|
2031
1971
|
i0 = index
|
|
2032
|
-
if
|
|
2033
|
-
r1 = instantiate_node(DayName,input, index...(index +
|
|
2034
|
-
@index +=
|
|
1972
|
+
if has_terminal?('sun', false, index)
|
|
1973
|
+
r1 = instantiate_node(DayName,input, index...(index + 3))
|
|
1974
|
+
@index += 3
|
|
2035
1975
|
else
|
|
2036
|
-
terminal_parse_failure('
|
|
1976
|
+
terminal_parse_failure('sun')
|
|
2037
1977
|
r1 = nil
|
|
2038
1978
|
end
|
|
2039
1979
|
if r1
|
|
2040
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2041
1980
|
r0 = r1
|
|
2042
1981
|
else
|
|
2043
|
-
if
|
|
2044
|
-
r2 = instantiate_node(DayName,input, index...(index +
|
|
2045
|
-
@index +=
|
|
1982
|
+
if has_terminal?('mon', false, index)
|
|
1983
|
+
r2 = instantiate_node(DayName,input, index...(index + 3))
|
|
1984
|
+
@index += 3
|
|
2046
1985
|
else
|
|
2047
|
-
terminal_parse_failure('
|
|
1986
|
+
terminal_parse_failure('mon')
|
|
2048
1987
|
r2 = nil
|
|
2049
1988
|
end
|
|
2050
1989
|
if r2
|
|
2051
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2052
1990
|
r0 = r2
|
|
2053
1991
|
else
|
|
2054
|
-
if
|
|
2055
|
-
r3 = instantiate_node(DayName,input, index...(index +
|
|
2056
|
-
@index +=
|
|
1992
|
+
if has_terminal?('tue', false, index)
|
|
1993
|
+
r3 = instantiate_node(DayName,input, index...(index + 3))
|
|
1994
|
+
@index += 3
|
|
2057
1995
|
else
|
|
2058
|
-
terminal_parse_failure('
|
|
1996
|
+
terminal_parse_failure('tue')
|
|
2059
1997
|
r3 = nil
|
|
2060
1998
|
end
|
|
2061
1999
|
if r3
|
|
2062
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2063
2000
|
r0 = r3
|
|
2064
2001
|
else
|
|
2065
|
-
if
|
|
2066
|
-
r4 = instantiate_node(DayName,input, index...(index +
|
|
2067
|
-
@index +=
|
|
2002
|
+
if has_terminal?('wed', false, index)
|
|
2003
|
+
r4 = instantiate_node(DayName,input, index...(index + 3))
|
|
2004
|
+
@index += 3
|
|
2068
2005
|
else
|
|
2069
|
-
terminal_parse_failure('
|
|
2006
|
+
terminal_parse_failure('wed')
|
|
2070
2007
|
r4 = nil
|
|
2071
2008
|
end
|
|
2072
2009
|
if r4
|
|
2073
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2074
2010
|
r0 = r4
|
|
2075
2011
|
else
|
|
2076
|
-
if
|
|
2077
|
-
r5 = instantiate_node(DayName,input, index...(index +
|
|
2078
|
-
@index +=
|
|
2012
|
+
if has_terminal?('thu', false, index)
|
|
2013
|
+
r5 = instantiate_node(DayName,input, index...(index + 3))
|
|
2014
|
+
@index += 3
|
|
2079
2015
|
else
|
|
2080
|
-
terminal_parse_failure('
|
|
2016
|
+
terminal_parse_failure('thu')
|
|
2081
2017
|
r5 = nil
|
|
2082
2018
|
end
|
|
2083
2019
|
if r5
|
|
2084
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2085
2020
|
r0 = r5
|
|
2086
2021
|
else
|
|
2087
|
-
if
|
|
2088
|
-
r6 = instantiate_node(DayName,input, index...(index +
|
|
2089
|
-
@index +=
|
|
2022
|
+
if has_terminal?('fri', false, index)
|
|
2023
|
+
r6 = instantiate_node(DayName,input, index...(index + 3))
|
|
2024
|
+
@index += 3
|
|
2090
2025
|
else
|
|
2091
|
-
terminal_parse_failure('
|
|
2026
|
+
terminal_parse_failure('fri')
|
|
2092
2027
|
r6 = nil
|
|
2093
2028
|
end
|
|
2094
2029
|
if r6
|
|
2095
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2096
2030
|
r0 = r6
|
|
2097
2031
|
else
|
|
2098
|
-
if
|
|
2099
|
-
r7 = instantiate_node(DayName,input, index...(index +
|
|
2100
|
-
@index +=
|
|
2032
|
+
if has_terminal?('sat', false, index)
|
|
2033
|
+
r7 = instantiate_node(DayName,input, index...(index + 3))
|
|
2034
|
+
@index += 3
|
|
2101
2035
|
else
|
|
2102
|
-
terminal_parse_failure('
|
|
2036
|
+
terminal_parse_failure('sat')
|
|
2103
2037
|
r7 = nil
|
|
2104
2038
|
end
|
|
2105
2039
|
if r7
|
|
2106
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2107
2040
|
r0 = r7
|
|
2108
2041
|
else
|
|
2109
2042
|
@index = i0
|
|
@@ -2126,7 +2059,7 @@ module Timing
|
|
|
2126
2059
|
if node_cache[:month_name].has_key?(index)
|
|
2127
2060
|
cached = node_cache[:month_name][index]
|
|
2128
2061
|
if cached
|
|
2129
|
-
|
|
2062
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2130
2063
|
@index = cached.interval.end
|
|
2131
2064
|
end
|
|
2132
2065
|
return cached
|
|
@@ -2135,12 +2068,10 @@ module Timing
|
|
|
2135
2068
|
i0 = index
|
|
2136
2069
|
r1 = _nt_long_month_name
|
|
2137
2070
|
if r1
|
|
2138
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2139
2071
|
r0 = r1
|
|
2140
2072
|
else
|
|
2141
2073
|
r2 = _nt_short_month_name
|
|
2142
2074
|
if r2
|
|
2143
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2144
2075
|
r0 = r2
|
|
2145
2076
|
else
|
|
2146
2077
|
@index = i0
|
|
@@ -2158,143 +2089,131 @@ module Timing
|
|
|
2158
2089
|
if node_cache[:long_month_name].has_key?(index)
|
|
2159
2090
|
cached = node_cache[:long_month_name][index]
|
|
2160
2091
|
if cached
|
|
2161
|
-
|
|
2092
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2162
2093
|
@index = cached.interval.end
|
|
2163
2094
|
end
|
|
2164
2095
|
return cached
|
|
2165
2096
|
end
|
|
2166
2097
|
|
|
2167
2098
|
i0 = index
|
|
2168
|
-
if
|
|
2169
|
-
r1 = instantiate_node(MonthName,input, index...(index +
|
|
2170
|
-
@index +=
|
|
2099
|
+
if has_terminal?('january', false, index)
|
|
2100
|
+
r1 = instantiate_node(MonthName,input, index...(index + 7))
|
|
2101
|
+
@index += 7
|
|
2171
2102
|
else
|
|
2172
|
-
terminal_parse_failure('
|
|
2103
|
+
terminal_parse_failure('january')
|
|
2173
2104
|
r1 = nil
|
|
2174
2105
|
end
|
|
2175
2106
|
if r1
|
|
2176
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2177
2107
|
r0 = r1
|
|
2178
2108
|
else
|
|
2179
|
-
if
|
|
2180
|
-
r2 = instantiate_node(MonthName,input, index...(index +
|
|
2181
|
-
@index +=
|
|
2109
|
+
if has_terminal?('february', false, index)
|
|
2110
|
+
r2 = instantiate_node(MonthName,input, index...(index + 8))
|
|
2111
|
+
@index += 8
|
|
2182
2112
|
else
|
|
2183
|
-
terminal_parse_failure('
|
|
2113
|
+
terminal_parse_failure('february')
|
|
2184
2114
|
r2 = nil
|
|
2185
2115
|
end
|
|
2186
2116
|
if r2
|
|
2187
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2188
2117
|
r0 = r2
|
|
2189
2118
|
else
|
|
2190
|
-
if
|
|
2191
|
-
r3 = instantiate_node(MonthName,input, index...(index +
|
|
2192
|
-
@index +=
|
|
2119
|
+
if has_terminal?('march', false, index)
|
|
2120
|
+
r3 = instantiate_node(MonthName,input, index...(index + 5))
|
|
2121
|
+
@index += 5
|
|
2193
2122
|
else
|
|
2194
|
-
terminal_parse_failure('
|
|
2123
|
+
terminal_parse_failure('march')
|
|
2195
2124
|
r3 = nil
|
|
2196
2125
|
end
|
|
2197
2126
|
if r3
|
|
2198
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2199
2127
|
r0 = r3
|
|
2200
2128
|
else
|
|
2201
|
-
if
|
|
2202
|
-
r4 = instantiate_node(MonthName,input, index...(index +
|
|
2203
|
-
@index +=
|
|
2129
|
+
if has_terminal?('april', false, index)
|
|
2130
|
+
r4 = instantiate_node(MonthName,input, index...(index + 5))
|
|
2131
|
+
@index += 5
|
|
2204
2132
|
else
|
|
2205
|
-
terminal_parse_failure('
|
|
2133
|
+
terminal_parse_failure('april')
|
|
2206
2134
|
r4 = nil
|
|
2207
2135
|
end
|
|
2208
2136
|
if r4
|
|
2209
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2210
2137
|
r0 = r4
|
|
2211
2138
|
else
|
|
2212
|
-
if
|
|
2213
|
-
r5 = instantiate_node(MonthName,input, index...(index +
|
|
2214
|
-
@index +=
|
|
2139
|
+
if has_terminal?('may', false, index)
|
|
2140
|
+
r5 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2141
|
+
@index += 3
|
|
2215
2142
|
else
|
|
2216
|
-
terminal_parse_failure('
|
|
2143
|
+
terminal_parse_failure('may')
|
|
2217
2144
|
r5 = nil
|
|
2218
2145
|
end
|
|
2219
2146
|
if r5
|
|
2220
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2221
2147
|
r0 = r5
|
|
2222
2148
|
else
|
|
2223
|
-
if
|
|
2224
|
-
r6 = instantiate_node(MonthName,input, index...(index +
|
|
2225
|
-
@index +=
|
|
2149
|
+
if has_terminal?('june', false, index)
|
|
2150
|
+
r6 = instantiate_node(MonthName,input, index...(index + 4))
|
|
2151
|
+
@index += 4
|
|
2226
2152
|
else
|
|
2227
|
-
terminal_parse_failure('
|
|
2153
|
+
terminal_parse_failure('june')
|
|
2228
2154
|
r6 = nil
|
|
2229
2155
|
end
|
|
2230
2156
|
if r6
|
|
2231
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2232
2157
|
r0 = r6
|
|
2233
2158
|
else
|
|
2234
|
-
if
|
|
2235
|
-
r7 = instantiate_node(MonthName,input, index...(index +
|
|
2236
|
-
@index +=
|
|
2159
|
+
if has_terminal?('july', false, index)
|
|
2160
|
+
r7 = instantiate_node(MonthName,input, index...(index + 4))
|
|
2161
|
+
@index += 4
|
|
2237
2162
|
else
|
|
2238
|
-
terminal_parse_failure('
|
|
2163
|
+
terminal_parse_failure('july')
|
|
2239
2164
|
r7 = nil
|
|
2240
2165
|
end
|
|
2241
2166
|
if r7
|
|
2242
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2243
2167
|
r0 = r7
|
|
2244
2168
|
else
|
|
2245
|
-
if
|
|
2246
|
-
r8 = instantiate_node(MonthName,input, index...(index +
|
|
2247
|
-
@index +=
|
|
2169
|
+
if has_terminal?('august', false, index)
|
|
2170
|
+
r8 = instantiate_node(MonthName,input, index...(index + 6))
|
|
2171
|
+
@index += 6
|
|
2248
2172
|
else
|
|
2249
|
-
terminal_parse_failure('
|
|
2173
|
+
terminal_parse_failure('august')
|
|
2250
2174
|
r8 = nil
|
|
2251
2175
|
end
|
|
2252
2176
|
if r8
|
|
2253
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2254
2177
|
r0 = r8
|
|
2255
2178
|
else
|
|
2256
|
-
if
|
|
2257
|
-
r9 = instantiate_node(MonthName,input, index...(index +
|
|
2258
|
-
@index +=
|
|
2179
|
+
if has_terminal?('september', false, index)
|
|
2180
|
+
r9 = instantiate_node(MonthName,input, index...(index + 9))
|
|
2181
|
+
@index += 9
|
|
2259
2182
|
else
|
|
2260
|
-
terminal_parse_failure('
|
|
2183
|
+
terminal_parse_failure('september')
|
|
2261
2184
|
r9 = nil
|
|
2262
2185
|
end
|
|
2263
2186
|
if r9
|
|
2264
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
2265
2187
|
r0 = r9
|
|
2266
2188
|
else
|
|
2267
|
-
if
|
|
2268
|
-
r10 = instantiate_node(MonthName,input, index...(index +
|
|
2269
|
-
@index +=
|
|
2189
|
+
if has_terminal?('october', false, index)
|
|
2190
|
+
r10 = instantiate_node(MonthName,input, index...(index + 7))
|
|
2191
|
+
@index += 7
|
|
2270
2192
|
else
|
|
2271
|
-
terminal_parse_failure('
|
|
2193
|
+
terminal_parse_failure('october')
|
|
2272
2194
|
r10 = nil
|
|
2273
2195
|
end
|
|
2274
2196
|
if r10
|
|
2275
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
2276
2197
|
r0 = r10
|
|
2277
2198
|
else
|
|
2278
|
-
if
|
|
2279
|
-
r11 = instantiate_node(MonthName,input, index...(index +
|
|
2280
|
-
@index +=
|
|
2199
|
+
if has_terminal?('november', false, index)
|
|
2200
|
+
r11 = instantiate_node(MonthName,input, index...(index + 8))
|
|
2201
|
+
@index += 8
|
|
2281
2202
|
else
|
|
2282
|
-
terminal_parse_failure('
|
|
2203
|
+
terminal_parse_failure('november')
|
|
2283
2204
|
r11 = nil
|
|
2284
2205
|
end
|
|
2285
2206
|
if r11
|
|
2286
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
2287
2207
|
r0 = r11
|
|
2288
2208
|
else
|
|
2289
|
-
if
|
|
2290
|
-
r12 = instantiate_node(MonthName,input, index...(index +
|
|
2291
|
-
@index +=
|
|
2209
|
+
if has_terminal?('december', false, index)
|
|
2210
|
+
r12 = instantiate_node(MonthName,input, index...(index + 8))
|
|
2211
|
+
@index += 8
|
|
2292
2212
|
else
|
|
2293
|
-
terminal_parse_failure('
|
|
2213
|
+
terminal_parse_failure('december')
|
|
2294
2214
|
r12 = nil
|
|
2295
2215
|
end
|
|
2296
2216
|
if r12
|
|
2297
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2298
2217
|
r0 = r12
|
|
2299
2218
|
else
|
|
2300
2219
|
@index = i0
|
|
@@ -2322,143 +2241,131 @@ module Timing
|
|
|
2322
2241
|
if node_cache[:short_month_name].has_key?(index)
|
|
2323
2242
|
cached = node_cache[:short_month_name][index]
|
|
2324
2243
|
if cached
|
|
2325
|
-
|
|
2244
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2326
2245
|
@index = cached.interval.end
|
|
2327
2246
|
end
|
|
2328
2247
|
return cached
|
|
2329
2248
|
end
|
|
2330
2249
|
|
|
2331
2250
|
i0 = index
|
|
2332
|
-
if
|
|
2333
|
-
r1 = instantiate_node(MonthName,input, index...(index +
|
|
2334
|
-
@index +=
|
|
2251
|
+
if has_terminal?('jan', false, index)
|
|
2252
|
+
r1 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2253
|
+
@index += 3
|
|
2335
2254
|
else
|
|
2336
|
-
terminal_parse_failure('
|
|
2255
|
+
terminal_parse_failure('jan')
|
|
2337
2256
|
r1 = nil
|
|
2338
2257
|
end
|
|
2339
2258
|
if r1
|
|
2340
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2341
2259
|
r0 = r1
|
|
2342
2260
|
else
|
|
2343
|
-
if
|
|
2344
|
-
r2 = instantiate_node(MonthName,input, index...(index +
|
|
2345
|
-
@index +=
|
|
2261
|
+
if has_terminal?('feb', false, index)
|
|
2262
|
+
r2 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2263
|
+
@index += 3
|
|
2346
2264
|
else
|
|
2347
|
-
terminal_parse_failure('
|
|
2265
|
+
terminal_parse_failure('feb')
|
|
2348
2266
|
r2 = nil
|
|
2349
2267
|
end
|
|
2350
2268
|
if r2
|
|
2351
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2352
2269
|
r0 = r2
|
|
2353
2270
|
else
|
|
2354
|
-
if
|
|
2355
|
-
r3 = instantiate_node(MonthName,input, index...(index +
|
|
2356
|
-
@index +=
|
|
2271
|
+
if has_terminal?('mar', false, index)
|
|
2272
|
+
r3 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2273
|
+
@index += 3
|
|
2357
2274
|
else
|
|
2358
|
-
terminal_parse_failure('
|
|
2275
|
+
terminal_parse_failure('mar')
|
|
2359
2276
|
r3 = nil
|
|
2360
2277
|
end
|
|
2361
2278
|
if r3
|
|
2362
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2363
2279
|
r0 = r3
|
|
2364
2280
|
else
|
|
2365
|
-
if
|
|
2366
|
-
r4 = instantiate_node(MonthName,input, index...(index +
|
|
2367
|
-
@index +=
|
|
2281
|
+
if has_terminal?('apr', false, index)
|
|
2282
|
+
r4 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2283
|
+
@index += 3
|
|
2368
2284
|
else
|
|
2369
|
-
terminal_parse_failure('
|
|
2285
|
+
terminal_parse_failure('apr')
|
|
2370
2286
|
r4 = nil
|
|
2371
2287
|
end
|
|
2372
2288
|
if r4
|
|
2373
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2374
2289
|
r0 = r4
|
|
2375
2290
|
else
|
|
2376
|
-
if
|
|
2377
|
-
r5 = instantiate_node(MonthName,input, index...(index +
|
|
2378
|
-
@index +=
|
|
2291
|
+
if has_terminal?('may', false, index)
|
|
2292
|
+
r5 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2293
|
+
@index += 3
|
|
2379
2294
|
else
|
|
2380
|
-
terminal_parse_failure('
|
|
2295
|
+
terminal_parse_failure('may')
|
|
2381
2296
|
r5 = nil
|
|
2382
2297
|
end
|
|
2383
2298
|
if r5
|
|
2384
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2385
2299
|
r0 = r5
|
|
2386
2300
|
else
|
|
2387
|
-
if
|
|
2388
|
-
r6 = instantiate_node(MonthName,input, index...(index +
|
|
2389
|
-
@index +=
|
|
2301
|
+
if has_terminal?('jun', false, index)
|
|
2302
|
+
r6 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2303
|
+
@index += 3
|
|
2390
2304
|
else
|
|
2391
|
-
terminal_parse_failure('
|
|
2305
|
+
terminal_parse_failure('jun')
|
|
2392
2306
|
r6 = nil
|
|
2393
2307
|
end
|
|
2394
2308
|
if r6
|
|
2395
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2396
2309
|
r0 = r6
|
|
2397
2310
|
else
|
|
2398
|
-
if
|
|
2399
|
-
r7 = instantiate_node(MonthName,input, index...(index +
|
|
2400
|
-
@index +=
|
|
2311
|
+
if has_terminal?('jul', false, index)
|
|
2312
|
+
r7 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2313
|
+
@index += 3
|
|
2401
2314
|
else
|
|
2402
|
-
terminal_parse_failure('
|
|
2315
|
+
terminal_parse_failure('jul')
|
|
2403
2316
|
r7 = nil
|
|
2404
2317
|
end
|
|
2405
2318
|
if r7
|
|
2406
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2407
2319
|
r0 = r7
|
|
2408
2320
|
else
|
|
2409
|
-
if
|
|
2410
|
-
r8 = instantiate_node(MonthName,input, index...(index +
|
|
2411
|
-
@index +=
|
|
2321
|
+
if has_terminal?('aug', false, index)
|
|
2322
|
+
r8 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2323
|
+
@index += 3
|
|
2412
2324
|
else
|
|
2413
|
-
terminal_parse_failure('
|
|
2325
|
+
terminal_parse_failure('aug')
|
|
2414
2326
|
r8 = nil
|
|
2415
2327
|
end
|
|
2416
2328
|
if r8
|
|
2417
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2418
2329
|
r0 = r8
|
|
2419
2330
|
else
|
|
2420
|
-
if
|
|
2421
|
-
r9 = instantiate_node(MonthName,input, index...(index +
|
|
2422
|
-
@index +=
|
|
2331
|
+
if has_terminal?('sep', false, index)
|
|
2332
|
+
r9 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2333
|
+
@index += 3
|
|
2423
2334
|
else
|
|
2424
|
-
terminal_parse_failure('
|
|
2335
|
+
terminal_parse_failure('sep')
|
|
2425
2336
|
r9 = nil
|
|
2426
2337
|
end
|
|
2427
2338
|
if r9
|
|
2428
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
2429
2339
|
r0 = r9
|
|
2430
2340
|
else
|
|
2431
|
-
if
|
|
2432
|
-
r10 = instantiate_node(MonthName,input, index...(index +
|
|
2433
|
-
@index +=
|
|
2341
|
+
if has_terminal?('oct', false, index)
|
|
2342
|
+
r10 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2343
|
+
@index += 3
|
|
2434
2344
|
else
|
|
2435
|
-
terminal_parse_failure('
|
|
2345
|
+
terminal_parse_failure('oct')
|
|
2436
2346
|
r10 = nil
|
|
2437
2347
|
end
|
|
2438
2348
|
if r10
|
|
2439
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
2440
2349
|
r0 = r10
|
|
2441
2350
|
else
|
|
2442
|
-
if
|
|
2443
|
-
r11 = instantiate_node(MonthName,input, index...(index +
|
|
2444
|
-
@index +=
|
|
2351
|
+
if has_terminal?('nov', false, index)
|
|
2352
|
+
r11 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2353
|
+
@index += 3
|
|
2445
2354
|
else
|
|
2446
|
-
terminal_parse_failure('
|
|
2355
|
+
terminal_parse_failure('nov')
|
|
2447
2356
|
r11 = nil
|
|
2448
2357
|
end
|
|
2449
2358
|
if r11
|
|
2450
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
2451
2359
|
r0 = r11
|
|
2452
2360
|
else
|
|
2453
|
-
if
|
|
2454
|
-
r12 = instantiate_node(MonthName,input, index...(index +
|
|
2455
|
-
@index +=
|
|
2361
|
+
if has_terminal?('dec', false, index)
|
|
2362
|
+
r12 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2363
|
+
@index += 3
|
|
2456
2364
|
else
|
|
2457
|
-
terminal_parse_failure('
|
|
2365
|
+
terminal_parse_failure('dec')
|
|
2458
2366
|
r12 = nil
|
|
2459
2367
|
end
|
|
2460
2368
|
if r12
|
|
2461
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2462
2369
|
r0 = r12
|
|
2463
2370
|
else
|
|
2464
2371
|
@index = i0
|
|
@@ -2489,29 +2396,27 @@ module Timing
|
|
|
2489
2396
|
if node_cache[:zone_offset].has_key?(index)
|
|
2490
2397
|
cached = node_cache[:zone_offset][index]
|
|
2491
2398
|
if cached
|
|
2492
|
-
|
|
2399
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2493
2400
|
@index = cached.interval.end
|
|
2494
2401
|
end
|
|
2495
2402
|
return cached
|
|
2496
2403
|
end
|
|
2497
2404
|
|
|
2498
2405
|
i0, s0 = index, []
|
|
2499
|
-
if has_terminal?(
|
|
2406
|
+
if has_terminal?('\G[+-]', true, index)
|
|
2500
2407
|
r1 = true
|
|
2501
2408
|
@index += 1
|
|
2502
2409
|
else
|
|
2503
|
-
terminal_parse_failure('[+-]')
|
|
2504
2410
|
r1 = nil
|
|
2505
2411
|
end
|
|
2506
2412
|
s0 << r1
|
|
2507
2413
|
if r1
|
|
2508
2414
|
s2, i2 = [], index
|
|
2509
2415
|
loop do
|
|
2510
|
-
if has_terminal?(
|
|
2416
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2511
2417
|
r3 = true
|
|
2512
2418
|
@index += 1
|
|
2513
2419
|
else
|
|
2514
|
-
terminal_parse_failure('[\\d]')
|
|
2515
2420
|
r3 = nil
|
|
2516
2421
|
end
|
|
2517
2422
|
if r3
|
|
@@ -2527,18 +2432,15 @@ module Timing
|
|
|
2527
2432
|
@index = i2
|
|
2528
2433
|
r2 = nil
|
|
2529
2434
|
else
|
|
2530
|
-
if s2.size < 2
|
|
2531
|
-
terminal_failures.pop
|
|
2532
|
-
end
|
|
2533
2435
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
2534
2436
|
end
|
|
2535
2437
|
s0 << r2
|
|
2536
2438
|
if r2
|
|
2537
|
-
if
|
|
2538
|
-
r5 =
|
|
2539
|
-
@index +=
|
|
2439
|
+
if has_terminal?(':', false, index)
|
|
2440
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2441
|
+
@index += 1
|
|
2540
2442
|
else
|
|
2541
|
-
terminal_parse_failure('
|
|
2443
|
+
terminal_parse_failure(':')
|
|
2542
2444
|
r5 = nil
|
|
2543
2445
|
end
|
|
2544
2446
|
if r5
|
|
@@ -2550,11 +2452,10 @@ module Timing
|
|
|
2550
2452
|
if r4
|
|
2551
2453
|
s6, i6 = [], index
|
|
2552
2454
|
loop do
|
|
2553
|
-
if has_terminal?(
|
|
2455
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2554
2456
|
r7 = true
|
|
2555
2457
|
@index += 1
|
|
2556
2458
|
else
|
|
2557
|
-
terminal_parse_failure('[\\d]')
|
|
2558
2459
|
r7 = nil
|
|
2559
2460
|
end
|
|
2560
2461
|
if r7
|
|
@@ -2570,9 +2471,6 @@ module Timing
|
|
|
2570
2471
|
@index = i6
|
|
2571
2472
|
r6 = nil
|
|
2572
2473
|
else
|
|
2573
|
-
if s6.size < 2
|
|
2574
|
-
terminal_failures.pop
|
|
2575
|
-
end
|
|
2576
2474
|
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
|
2577
2475
|
end
|
|
2578
2476
|
s0 << r6
|
|
@@ -2603,7 +2501,7 @@ module Timing
|
|
|
2603
2501
|
if node_cache[:hour_minute_second].has_key?(index)
|
|
2604
2502
|
cached = node_cache[:hour_minute_second][index]
|
|
2605
2503
|
if cached
|
|
2606
|
-
|
|
2504
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2607
2505
|
@index = cached.interval.end
|
|
2608
2506
|
end
|
|
2609
2507
|
return cached
|
|
@@ -2613,11 +2511,10 @@ module Timing
|
|
|
2613
2511
|
i1, s1 = index, []
|
|
2614
2512
|
s2, i2 = [], index
|
|
2615
2513
|
loop do
|
|
2616
|
-
if has_terminal?(
|
|
2514
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2617
2515
|
r3 = true
|
|
2618
2516
|
@index += 1
|
|
2619
2517
|
else
|
|
2620
|
-
terminal_parse_failure('[\\d]')
|
|
2621
2518
|
r3 = nil
|
|
2622
2519
|
end
|
|
2623
2520
|
if r3
|
|
@@ -2633,29 +2530,25 @@ module Timing
|
|
|
2633
2530
|
@index = i2
|
|
2634
2531
|
r2 = nil
|
|
2635
2532
|
else
|
|
2636
|
-
if s2.size < 2
|
|
2637
|
-
terminal_failures.pop
|
|
2638
|
-
end
|
|
2639
2533
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
2640
2534
|
end
|
|
2641
2535
|
s1 << r2
|
|
2642
2536
|
if r2
|
|
2643
|
-
if
|
|
2644
|
-
r4 =
|
|
2645
|
-
@index +=
|
|
2537
|
+
if has_terminal?(':', false, index)
|
|
2538
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2539
|
+
@index += 1
|
|
2646
2540
|
else
|
|
2647
|
-
terminal_parse_failure('
|
|
2541
|
+
terminal_parse_failure(':')
|
|
2648
2542
|
r4 = nil
|
|
2649
2543
|
end
|
|
2650
2544
|
s1 << r4
|
|
2651
2545
|
if r4
|
|
2652
2546
|
s5, i5 = [], index
|
|
2653
2547
|
loop do
|
|
2654
|
-
if has_terminal?(
|
|
2548
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2655
2549
|
r6 = true
|
|
2656
2550
|
@index += 1
|
|
2657
2551
|
else
|
|
2658
|
-
terminal_parse_failure('[\\d]')
|
|
2659
2552
|
r6 = nil
|
|
2660
2553
|
end
|
|
2661
2554
|
if r6
|
|
@@ -2671,30 +2564,26 @@ module Timing
|
|
|
2671
2564
|
@index = i5
|
|
2672
2565
|
r5 = nil
|
|
2673
2566
|
else
|
|
2674
|
-
if s5.size < 2
|
|
2675
|
-
terminal_failures.pop
|
|
2676
|
-
end
|
|
2677
2567
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
2678
2568
|
end
|
|
2679
2569
|
s1 << r5
|
|
2680
2570
|
if r5
|
|
2681
2571
|
i8, s8 = index, []
|
|
2682
|
-
if
|
|
2683
|
-
r9 =
|
|
2684
|
-
@index +=
|
|
2572
|
+
if has_terminal?(':', false, index)
|
|
2573
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2574
|
+
@index += 1
|
|
2685
2575
|
else
|
|
2686
|
-
terminal_parse_failure('
|
|
2576
|
+
terminal_parse_failure(':')
|
|
2687
2577
|
r9 = nil
|
|
2688
2578
|
end
|
|
2689
2579
|
s8 << r9
|
|
2690
2580
|
if r9
|
|
2691
2581
|
s10, i10 = [], index
|
|
2692
2582
|
loop do
|
|
2693
|
-
if has_terminal?(
|
|
2583
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2694
2584
|
r11 = true
|
|
2695
2585
|
@index += 1
|
|
2696
2586
|
else
|
|
2697
|
-
terminal_parse_failure('[\\d]')
|
|
2698
2587
|
r11 = nil
|
|
2699
2588
|
end
|
|
2700
2589
|
if r11
|
|
@@ -2710,9 +2599,6 @@ module Timing
|
|
|
2710
2599
|
@index = i10
|
|
2711
2600
|
r10 = nil
|
|
2712
2601
|
else
|
|
2713
|
-
if s10.size < 2
|
|
2714
|
-
terminal_failures.pop
|
|
2715
|
-
end
|
|
2716
2602
|
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
|
2717
2603
|
end
|
|
2718
2604
|
s8 << r10
|
|
@@ -2741,29 +2627,26 @@ module Timing
|
|
|
2741
2627
|
r1 = nil
|
|
2742
2628
|
end
|
|
2743
2629
|
if r1
|
|
2744
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2745
2630
|
r0 = r1
|
|
2746
2631
|
else
|
|
2747
|
-
if
|
|
2748
|
-
r12 = instantiate_node(HourMinuteSecond,input, index...(index +
|
|
2749
|
-
@index +=
|
|
2632
|
+
if has_terminal?('beginning', false, index)
|
|
2633
|
+
r12 = instantiate_node(HourMinuteSecond,input, index...(index + 9))
|
|
2634
|
+
@index += 9
|
|
2750
2635
|
else
|
|
2751
|
-
terminal_parse_failure('
|
|
2636
|
+
terminal_parse_failure('beginning')
|
|
2752
2637
|
r12 = nil
|
|
2753
2638
|
end
|
|
2754
2639
|
if r12
|
|
2755
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2756
2640
|
r0 = r12
|
|
2757
2641
|
else
|
|
2758
|
-
if
|
|
2759
|
-
r13 = instantiate_node(HourMinuteSecond,input, index...(index +
|
|
2760
|
-
@index +=
|
|
2642
|
+
if has_terminal?('end', false, index)
|
|
2643
|
+
r13 = instantiate_node(HourMinuteSecond,input, index...(index + 3))
|
|
2644
|
+
@index += 3
|
|
2761
2645
|
else
|
|
2762
|
-
terminal_parse_failure('
|
|
2646
|
+
terminal_parse_failure('end')
|
|
2763
2647
|
r13 = nil
|
|
2764
2648
|
end
|
|
2765
2649
|
if r13
|
|
2766
|
-
r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true
|
|
2767
2650
|
r0 = r13
|
|
2768
2651
|
else
|
|
2769
2652
|
@index = i0
|
|
@@ -2782,7 +2665,7 @@ module Timing
|
|
|
2782
2665
|
if node_cache[:integer].has_key?(index)
|
|
2783
2666
|
cached = node_cache[:integer][index]
|
|
2784
2667
|
if cached
|
|
2785
|
-
|
|
2668
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2786
2669
|
@index = cached.interval.end
|
|
2787
2670
|
end
|
|
2788
2671
|
return cached
|
|
@@ -2790,11 +2673,10 @@ module Timing
|
|
|
2790
2673
|
|
|
2791
2674
|
s0, i0 = [], index
|
|
2792
2675
|
loop do
|
|
2793
|
-
if has_terminal?(
|
|
2676
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2794
2677
|
r1 = true
|
|
2795
2678
|
@index += 1
|
|
2796
2679
|
else
|
|
2797
|
-
terminal_parse_failure('[\\d]')
|
|
2798
2680
|
r1 = nil
|
|
2799
2681
|
end
|
|
2800
2682
|
if r1
|
|
@@ -2820,17 +2702,16 @@ module Timing
|
|
|
2820
2702
|
if node_cache[:space].has_key?(index)
|
|
2821
2703
|
cached = node_cache[:space][index]
|
|
2822
2704
|
if cached
|
|
2823
|
-
|
|
2705
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2824
2706
|
@index = cached.interval.end
|
|
2825
2707
|
end
|
|
2826
2708
|
return cached
|
|
2827
2709
|
end
|
|
2828
2710
|
|
|
2829
|
-
if has_terminal?(
|
|
2711
|
+
if has_terminal?('\G[\\s\\t\\n]', true, index)
|
|
2830
2712
|
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2831
2713
|
@index += 1
|
|
2832
2714
|
else
|
|
2833
|
-
terminal_parse_failure('[\\s\\t\\n]')
|
|
2834
2715
|
r0 = nil
|
|
2835
2716
|
end
|
|
2836
2717
|
|