timing 0.1.0 → 0.1.1
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 +373 -492
- data/lib/timing/version.rb +1 -1
- metadata +2 -2
|
@@ -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
|
|
@@ -258,7 +244,7 @@ module Timing
|
|
|
258
244
|
if node_cache[:last_next_day_name].has_key?(index)
|
|
259
245
|
cached = node_cache[:last_next_day_name][index]
|
|
260
246
|
if cached
|
|
261
|
-
|
|
247
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
262
248
|
@index = cached.interval.end
|
|
263
249
|
end
|
|
264
250
|
return cached
|
|
@@ -295,11 +281,11 @@ module Timing
|
|
|
295
281
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
296
282
|
s0 << r5
|
|
297
283
|
if r5
|
|
298
|
-
if
|
|
299
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index +
|
|
300
|
-
@index +=
|
|
284
|
+
if has_terminal?('including today', false, index)
|
|
285
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 15))
|
|
286
|
+
@index += 15
|
|
301
287
|
else
|
|
302
|
-
terminal_parse_failure('
|
|
288
|
+
terminal_parse_failure('including today')
|
|
303
289
|
r8 = nil
|
|
304
290
|
end
|
|
305
291
|
if r8
|
|
@@ -345,7 +331,7 @@ module Timing
|
|
|
345
331
|
if node_cache[:day_month_name_year].has_key?(index)
|
|
346
332
|
cached = node_cache[:day_month_name_year][index]
|
|
347
333
|
if cached
|
|
348
|
-
|
|
334
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
349
335
|
@index = cached.interval.end
|
|
350
336
|
end
|
|
351
337
|
return cached
|
|
@@ -438,7 +424,7 @@ module Timing
|
|
|
438
424
|
if node_cache[:year_month_day].has_key?(index)
|
|
439
425
|
cached = node_cache[:year_month_day][index]
|
|
440
426
|
if cached
|
|
441
|
-
|
|
427
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
442
428
|
@index = cached.interval.end
|
|
443
429
|
end
|
|
444
430
|
return cached
|
|
@@ -448,11 +434,11 @@ module Timing
|
|
|
448
434
|
r1 = _nt_integer
|
|
449
435
|
s0 << r1
|
|
450
436
|
if r1
|
|
451
|
-
if
|
|
452
|
-
r2 =
|
|
453
|
-
@index +=
|
|
437
|
+
if has_terminal?('-', false, index)
|
|
438
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
439
|
+
@index += 1
|
|
454
440
|
else
|
|
455
|
-
terminal_parse_failure('
|
|
441
|
+
terminal_parse_failure('-')
|
|
456
442
|
r2 = nil
|
|
457
443
|
end
|
|
458
444
|
s0 << r2
|
|
@@ -460,11 +446,11 @@ module Timing
|
|
|
460
446
|
r3 = _nt_integer
|
|
461
447
|
s0 << r3
|
|
462
448
|
if r3
|
|
463
|
-
if
|
|
464
|
-
r4 =
|
|
465
|
-
@index +=
|
|
449
|
+
if has_terminal?('-', false, index)
|
|
450
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
451
|
+
@index += 1
|
|
466
452
|
else
|
|
467
|
-
terminal_parse_failure('
|
|
453
|
+
terminal_parse_failure('-')
|
|
468
454
|
r4 = nil
|
|
469
455
|
end
|
|
470
456
|
s0 << r4
|
|
@@ -503,7 +489,7 @@ module Timing
|
|
|
503
489
|
if node_cache[:beginning_end_interval].has_key?(index)
|
|
504
490
|
cached = node_cache[:beginning_end_interval][index]
|
|
505
491
|
if cached
|
|
506
|
-
|
|
492
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
507
493
|
@index = cached.interval.end
|
|
508
494
|
end
|
|
509
495
|
return cached
|
|
@@ -558,7 +544,7 @@ module Timing
|
|
|
558
544
|
if node_cache[:time_ago].has_key?(index)
|
|
559
545
|
cached = node_cache[:time_ago][index]
|
|
560
546
|
if cached
|
|
561
|
-
|
|
547
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
562
548
|
@index = cached.interval.end
|
|
563
549
|
end
|
|
564
550
|
return cached
|
|
@@ -595,11 +581,11 @@ module Timing
|
|
|
595
581
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
596
582
|
s0 << r5
|
|
597
583
|
if r5
|
|
598
|
-
if
|
|
599
|
-
r7 = instantiate_node(SyntaxNode,input, index...(index +
|
|
600
|
-
@index +=
|
|
584
|
+
if has_terminal?('ago', false, index)
|
|
585
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
586
|
+
@index += 3
|
|
601
587
|
else
|
|
602
|
-
terminal_parse_failure('
|
|
588
|
+
terminal_parse_failure('ago')
|
|
603
589
|
r7 = nil
|
|
604
590
|
end
|
|
605
591
|
s0 << r7
|
|
@@ -635,7 +621,7 @@ module Timing
|
|
|
635
621
|
if node_cache[:moment_at_time].has_key?(index)
|
|
636
622
|
cached = node_cache[:moment_at_time][index]
|
|
637
623
|
if cached
|
|
638
|
-
|
|
624
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
639
625
|
@index = cached.interval.end
|
|
640
626
|
end
|
|
641
627
|
return cached
|
|
@@ -657,11 +643,11 @@ module Timing
|
|
|
657
643
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
658
644
|
s0 << r2
|
|
659
645
|
if r2
|
|
660
|
-
if
|
|
661
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
662
|
-
@index +=
|
|
646
|
+
if has_terminal?('at', false, index)
|
|
647
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
648
|
+
@index += 2
|
|
663
649
|
else
|
|
664
|
-
terminal_parse_failure('
|
|
650
|
+
terminal_parse_failure('at')
|
|
665
651
|
r4 = nil
|
|
666
652
|
end
|
|
667
653
|
s0 << r4
|
|
@@ -720,7 +706,7 @@ module Timing
|
|
|
720
706
|
if node_cache[:before_from_moment].has_key?(index)
|
|
721
707
|
cached = node_cache[:before_from_moment][index]
|
|
722
708
|
if cached
|
|
723
|
-
|
|
709
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
724
710
|
@index = cached.interval.end
|
|
725
711
|
end
|
|
726
712
|
return cached
|
|
@@ -801,7 +787,7 @@ module Timing
|
|
|
801
787
|
if node_cache[:timestamp].has_key?(index)
|
|
802
788
|
cached = node_cache[:timestamp][index]
|
|
803
789
|
if cached
|
|
804
|
-
|
|
790
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
805
791
|
@index = cached.interval.end
|
|
806
792
|
end
|
|
807
793
|
return cached
|
|
@@ -810,11 +796,10 @@ module Timing
|
|
|
810
796
|
i0, s0 = index, []
|
|
811
797
|
s1, i1 = [], index
|
|
812
798
|
loop do
|
|
813
|
-
if has_terminal?(
|
|
799
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
814
800
|
r2 = true
|
|
815
801
|
@index += 1
|
|
816
802
|
else
|
|
817
|
-
terminal_parse_failure('[\\d]')
|
|
818
803
|
r2 = nil
|
|
819
804
|
end
|
|
820
805
|
if r2
|
|
@@ -830,29 +815,25 @@ module Timing
|
|
|
830
815
|
@index = i1
|
|
831
816
|
r1 = nil
|
|
832
817
|
else
|
|
833
|
-
if s1.size < 4
|
|
834
|
-
@terminal_failures.pop
|
|
835
|
-
end
|
|
836
818
|
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
837
819
|
end
|
|
838
820
|
s0 << r1
|
|
839
821
|
if r1
|
|
840
|
-
if
|
|
841
|
-
r3 =
|
|
842
|
-
@index +=
|
|
822
|
+
if has_terminal?('-', false, index)
|
|
823
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
824
|
+
@index += 1
|
|
843
825
|
else
|
|
844
|
-
terminal_parse_failure('
|
|
826
|
+
terminal_parse_failure('-')
|
|
845
827
|
r3 = nil
|
|
846
828
|
end
|
|
847
829
|
s0 << r3
|
|
848
830
|
if r3
|
|
849
831
|
s4, i4 = [], index
|
|
850
832
|
loop do
|
|
851
|
-
if has_terminal?(
|
|
833
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
852
834
|
r5 = true
|
|
853
835
|
@index += 1
|
|
854
836
|
else
|
|
855
|
-
terminal_parse_failure('[\\d]')
|
|
856
837
|
r5 = nil
|
|
857
838
|
end
|
|
858
839
|
if r5
|
|
@@ -868,29 +849,25 @@ module Timing
|
|
|
868
849
|
@index = i4
|
|
869
850
|
r4 = nil
|
|
870
851
|
else
|
|
871
|
-
if s4.size < 2
|
|
872
|
-
@terminal_failures.pop
|
|
873
|
-
end
|
|
874
852
|
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
|
875
853
|
end
|
|
876
854
|
s0 << r4
|
|
877
855
|
if r4
|
|
878
|
-
if
|
|
879
|
-
r6 =
|
|
880
|
-
@index +=
|
|
856
|
+
if has_terminal?('-', false, index)
|
|
857
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
858
|
+
@index += 1
|
|
881
859
|
else
|
|
882
|
-
terminal_parse_failure('
|
|
860
|
+
terminal_parse_failure('-')
|
|
883
861
|
r6 = nil
|
|
884
862
|
end
|
|
885
863
|
s0 << r6
|
|
886
864
|
if r6
|
|
887
865
|
s7, i7 = [], index
|
|
888
866
|
loop do
|
|
889
|
-
if has_terminal?(
|
|
867
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
890
868
|
r8 = true
|
|
891
869
|
@index += 1
|
|
892
870
|
else
|
|
893
|
-
terminal_parse_failure('[\\d]')
|
|
894
871
|
r8 = nil
|
|
895
872
|
end
|
|
896
873
|
if r8
|
|
@@ -906,9 +883,6 @@ module Timing
|
|
|
906
883
|
@index = i7
|
|
907
884
|
r7 = nil
|
|
908
885
|
else
|
|
909
|
-
if s7.size < 2
|
|
910
|
-
@terminal_failures.pop
|
|
911
|
-
end
|
|
912
886
|
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
|
913
887
|
end
|
|
914
888
|
s0 << r7
|
|
@@ -925,11 +899,11 @@ module Timing
|
|
|
925
899
|
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
|
926
900
|
s0 << r9
|
|
927
901
|
if r9
|
|
928
|
-
if
|
|
929
|
-
r12 =
|
|
930
|
-
@index +=
|
|
902
|
+
if has_terminal?('t', false, index)
|
|
903
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
904
|
+
@index += 1
|
|
931
905
|
else
|
|
932
|
-
terminal_parse_failure('
|
|
906
|
+
terminal_parse_failure('t')
|
|
933
907
|
r12 = nil
|
|
934
908
|
end
|
|
935
909
|
if r12
|
|
@@ -953,11 +927,10 @@ module Timing
|
|
|
953
927
|
if r13
|
|
954
928
|
s15, i15 = [], index
|
|
955
929
|
loop do
|
|
956
|
-
if has_terminal?(
|
|
930
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
957
931
|
r16 = true
|
|
958
932
|
@index += 1
|
|
959
933
|
else
|
|
960
|
-
terminal_parse_failure('[\\d]')
|
|
961
934
|
r16 = nil
|
|
962
935
|
end
|
|
963
936
|
if r16
|
|
@@ -973,29 +946,25 @@ module Timing
|
|
|
973
946
|
@index = i15
|
|
974
947
|
r15 = nil
|
|
975
948
|
else
|
|
976
|
-
if s15.size < 2
|
|
977
|
-
@terminal_failures.pop
|
|
978
|
-
end
|
|
979
949
|
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
|
980
950
|
end
|
|
981
951
|
s0 << r15
|
|
982
952
|
if r15
|
|
983
|
-
if
|
|
984
|
-
r17 =
|
|
985
|
-
@index +=
|
|
953
|
+
if has_terminal?(':', false, index)
|
|
954
|
+
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
955
|
+
@index += 1
|
|
986
956
|
else
|
|
987
|
-
terminal_parse_failure('
|
|
957
|
+
terminal_parse_failure(':')
|
|
988
958
|
r17 = nil
|
|
989
959
|
end
|
|
990
960
|
s0 << r17
|
|
991
961
|
if r17
|
|
992
962
|
s18, i18 = [], index
|
|
993
963
|
loop do
|
|
994
|
-
if has_terminal?(
|
|
964
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
995
965
|
r19 = true
|
|
996
966
|
@index += 1
|
|
997
967
|
else
|
|
998
|
-
terminal_parse_failure('[\\d]')
|
|
999
968
|
r19 = nil
|
|
1000
969
|
end
|
|
1001
970
|
if r19
|
|
@@ -1011,29 +980,25 @@ module Timing
|
|
|
1011
980
|
@index = i18
|
|
1012
981
|
r18 = nil
|
|
1013
982
|
else
|
|
1014
|
-
if s18.size < 2
|
|
1015
|
-
@terminal_failures.pop
|
|
1016
|
-
end
|
|
1017
983
|
r18 = instantiate_node(SyntaxNode,input, i18...index, s18)
|
|
1018
984
|
end
|
|
1019
985
|
s0 << r18
|
|
1020
986
|
if r18
|
|
1021
|
-
if
|
|
1022
|
-
r20 =
|
|
1023
|
-
@index +=
|
|
987
|
+
if has_terminal?(':', false, index)
|
|
988
|
+
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
989
|
+
@index += 1
|
|
1024
990
|
else
|
|
1025
|
-
terminal_parse_failure('
|
|
991
|
+
terminal_parse_failure(':')
|
|
1026
992
|
r20 = nil
|
|
1027
993
|
end
|
|
1028
994
|
s0 << r20
|
|
1029
995
|
if r20
|
|
1030
996
|
s21, i21 = [], index
|
|
1031
997
|
loop do
|
|
1032
|
-
if has_terminal?(
|
|
998
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
1033
999
|
r22 = true
|
|
1034
1000
|
@index += 1
|
|
1035
1001
|
else
|
|
1036
|
-
terminal_parse_failure('[\\d]')
|
|
1037
1002
|
r22 = nil
|
|
1038
1003
|
end
|
|
1039
1004
|
if r22
|
|
@@ -1049,9 +1014,6 @@ module Timing
|
|
|
1049
1014
|
@index = i21
|
|
1050
1015
|
r21 = nil
|
|
1051
1016
|
else
|
|
1052
|
-
if s21.size < 2
|
|
1053
|
-
@terminal_failures.pop
|
|
1054
|
-
end
|
|
1055
1017
|
r21 = instantiate_node(SyntaxNode,input, i21...index, s21)
|
|
1056
1018
|
end
|
|
1057
1019
|
s0 << r21
|
|
@@ -1085,17 +1047,17 @@ module Timing
|
|
|
1085
1047
|
if node_cache[:now].has_key?(index)
|
|
1086
1048
|
cached = node_cache[:now][index]
|
|
1087
1049
|
if cached
|
|
1088
|
-
|
|
1050
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1089
1051
|
@index = cached.interval.end
|
|
1090
1052
|
end
|
|
1091
1053
|
return cached
|
|
1092
1054
|
end
|
|
1093
1055
|
|
|
1094
|
-
if
|
|
1095
|
-
r0 = instantiate_node(Now,input, index...(index +
|
|
1096
|
-
@index +=
|
|
1056
|
+
if has_terminal?('now', false, index)
|
|
1057
|
+
r0 = instantiate_node(Now,input, index...(index + 3))
|
|
1058
|
+
@index += 3
|
|
1097
1059
|
else
|
|
1098
|
-
terminal_parse_failure('
|
|
1060
|
+
terminal_parse_failure('now')
|
|
1099
1061
|
r0 = nil
|
|
1100
1062
|
end
|
|
1101
1063
|
|
|
@@ -1109,17 +1071,17 @@ module Timing
|
|
|
1109
1071
|
if node_cache[:today].has_key?(index)
|
|
1110
1072
|
cached = node_cache[:today][index]
|
|
1111
1073
|
if cached
|
|
1112
|
-
|
|
1074
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1113
1075
|
@index = cached.interval.end
|
|
1114
1076
|
end
|
|
1115
1077
|
return cached
|
|
1116
1078
|
end
|
|
1117
1079
|
|
|
1118
|
-
if
|
|
1119
|
-
r0 = instantiate_node(Today,input, index...(index +
|
|
1120
|
-
@index +=
|
|
1080
|
+
if has_terminal?('today', false, index)
|
|
1081
|
+
r0 = instantiate_node(Today,input, index...(index + 5))
|
|
1082
|
+
@index += 5
|
|
1121
1083
|
else
|
|
1122
|
-
terminal_parse_failure('
|
|
1084
|
+
terminal_parse_failure('today')
|
|
1123
1085
|
r0 = nil
|
|
1124
1086
|
end
|
|
1125
1087
|
|
|
@@ -1133,17 +1095,17 @@ module Timing
|
|
|
1133
1095
|
if node_cache[:tomorrow].has_key?(index)
|
|
1134
1096
|
cached = node_cache[:tomorrow][index]
|
|
1135
1097
|
if cached
|
|
1136
|
-
|
|
1098
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1137
1099
|
@index = cached.interval.end
|
|
1138
1100
|
end
|
|
1139
1101
|
return cached
|
|
1140
1102
|
end
|
|
1141
1103
|
|
|
1142
|
-
if
|
|
1143
|
-
r0 = instantiate_node(Tomorrow,input, index...(index +
|
|
1144
|
-
@index +=
|
|
1104
|
+
if has_terminal?('tomorrow', false, index)
|
|
1105
|
+
r0 = instantiate_node(Tomorrow,input, index...(index + 8))
|
|
1106
|
+
@index += 8
|
|
1145
1107
|
else
|
|
1146
|
-
terminal_parse_failure('
|
|
1108
|
+
terminal_parse_failure('tomorrow')
|
|
1147
1109
|
r0 = nil
|
|
1148
1110
|
end
|
|
1149
1111
|
|
|
@@ -1157,17 +1119,17 @@ module Timing
|
|
|
1157
1119
|
if node_cache[:yesterday].has_key?(index)
|
|
1158
1120
|
cached = node_cache[:yesterday][index]
|
|
1159
1121
|
if cached
|
|
1160
|
-
|
|
1122
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1161
1123
|
@index = cached.interval.end
|
|
1162
1124
|
end
|
|
1163
1125
|
return cached
|
|
1164
1126
|
end
|
|
1165
1127
|
|
|
1166
|
-
if
|
|
1167
|
-
r0 = instantiate_node(Yesterday,input, index...(index +
|
|
1168
|
-
@index +=
|
|
1128
|
+
if has_terminal?('yesterday', false, index)
|
|
1129
|
+
r0 = instantiate_node(Yesterday,input, index...(index + 9))
|
|
1130
|
+
@index += 9
|
|
1169
1131
|
else
|
|
1170
|
-
terminal_parse_failure('
|
|
1132
|
+
terminal_parse_failure('yesterday')
|
|
1171
1133
|
r0 = nil
|
|
1172
1134
|
end
|
|
1173
1135
|
|
|
@@ -1181,7 +1143,7 @@ module Timing
|
|
|
1181
1143
|
if node_cache[:last_next].has_key?(index)
|
|
1182
1144
|
cached = node_cache[:last_next][index]
|
|
1183
1145
|
if cached
|
|
1184
|
-
|
|
1146
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1185
1147
|
@index = cached.interval.end
|
|
1186
1148
|
end
|
|
1187
1149
|
return cached
|
|
@@ -1190,12 +1152,10 @@ module Timing
|
|
|
1190
1152
|
i0 = index
|
|
1191
1153
|
r1 = _nt_last
|
|
1192
1154
|
if r1
|
|
1193
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1194
1155
|
r0 = r1
|
|
1195
1156
|
else
|
|
1196
1157
|
r2 = _nt_next
|
|
1197
1158
|
if r2
|
|
1198
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1199
1159
|
r0 = r2
|
|
1200
1160
|
else
|
|
1201
1161
|
@index = i0
|
|
@@ -1213,17 +1173,17 @@ module Timing
|
|
|
1213
1173
|
if node_cache[:last].has_key?(index)
|
|
1214
1174
|
cached = node_cache[:last][index]
|
|
1215
1175
|
if cached
|
|
1216
|
-
|
|
1176
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1217
1177
|
@index = cached.interval.end
|
|
1218
1178
|
end
|
|
1219
1179
|
return cached
|
|
1220
1180
|
end
|
|
1221
1181
|
|
|
1222
|
-
if
|
|
1223
|
-
r0 = instantiate_node(LastNext,input, index...(index +
|
|
1224
|
-
@index +=
|
|
1182
|
+
if has_terminal?('last', false, index)
|
|
1183
|
+
r0 = instantiate_node(LastNext,input, index...(index + 4))
|
|
1184
|
+
@index += 4
|
|
1225
1185
|
else
|
|
1226
|
-
terminal_parse_failure('
|
|
1186
|
+
terminal_parse_failure('last')
|
|
1227
1187
|
r0 = nil
|
|
1228
1188
|
end
|
|
1229
1189
|
|
|
@@ -1237,17 +1197,17 @@ module Timing
|
|
|
1237
1197
|
if node_cache[:next].has_key?(index)
|
|
1238
1198
|
cached = node_cache[:next][index]
|
|
1239
1199
|
if cached
|
|
1240
|
-
|
|
1200
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1241
1201
|
@index = cached.interval.end
|
|
1242
1202
|
end
|
|
1243
1203
|
return cached
|
|
1244
1204
|
end
|
|
1245
1205
|
|
|
1246
|
-
if
|
|
1247
|
-
r0 = instantiate_node(LastNext,input, index...(index +
|
|
1248
|
-
@index +=
|
|
1206
|
+
if has_terminal?('next', false, index)
|
|
1207
|
+
r0 = instantiate_node(LastNext,input, index...(index + 4))
|
|
1208
|
+
@index += 4
|
|
1249
1209
|
else
|
|
1250
|
-
terminal_parse_failure('
|
|
1210
|
+
terminal_parse_failure('next')
|
|
1251
1211
|
r0 = nil
|
|
1252
1212
|
end
|
|
1253
1213
|
|
|
@@ -1261,7 +1221,7 @@ module Timing
|
|
|
1261
1221
|
if node_cache[:beginning_end].has_key?(index)
|
|
1262
1222
|
cached = node_cache[:beginning_end][index]
|
|
1263
1223
|
if cached
|
|
1264
|
-
|
|
1224
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1265
1225
|
@index = cached.interval.end
|
|
1266
1226
|
end
|
|
1267
1227
|
return cached
|
|
@@ -1270,12 +1230,10 @@ module Timing
|
|
|
1270
1230
|
i0 = index
|
|
1271
1231
|
r1 = _nt_beginning_of
|
|
1272
1232
|
if r1
|
|
1273
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1274
1233
|
r0 = r1
|
|
1275
1234
|
else
|
|
1276
1235
|
r2 = _nt_end_of
|
|
1277
1236
|
if r2
|
|
1278
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1279
1237
|
r0 = r2
|
|
1280
1238
|
else
|
|
1281
1239
|
@index = i0
|
|
@@ -1300,18 +1258,18 @@ module Timing
|
|
|
1300
1258
|
if node_cache[:beginning_of].has_key?(index)
|
|
1301
1259
|
cached = node_cache[:beginning_of][index]
|
|
1302
1260
|
if cached
|
|
1303
|
-
|
|
1261
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1304
1262
|
@index = cached.interval.end
|
|
1305
1263
|
end
|
|
1306
1264
|
return cached
|
|
1307
1265
|
end
|
|
1308
1266
|
|
|
1309
1267
|
i0, s0 = index, []
|
|
1310
|
-
if
|
|
1311
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1312
|
-
@index +=
|
|
1268
|
+
if has_terminal?('beginning', false, index)
|
|
1269
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 9))
|
|
1270
|
+
@index += 9
|
|
1313
1271
|
else
|
|
1314
|
-
terminal_parse_failure('
|
|
1272
|
+
terminal_parse_failure('beginning')
|
|
1315
1273
|
r1 = nil
|
|
1316
1274
|
end
|
|
1317
1275
|
s0 << r1
|
|
@@ -1328,11 +1286,11 @@ module Timing
|
|
|
1328
1286
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
1329
1287
|
s0 << r2
|
|
1330
1288
|
if r2
|
|
1331
|
-
if
|
|
1332
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1333
|
-
@index +=
|
|
1289
|
+
if has_terminal?('of', false, index)
|
|
1290
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1291
|
+
@index += 2
|
|
1334
1292
|
else
|
|
1335
|
-
terminal_parse_failure('
|
|
1293
|
+
terminal_parse_failure('of')
|
|
1336
1294
|
r4 = nil
|
|
1337
1295
|
end
|
|
1338
1296
|
s0 << r4
|
|
@@ -1363,18 +1321,18 @@ module Timing
|
|
|
1363
1321
|
if node_cache[:end_of].has_key?(index)
|
|
1364
1322
|
cached = node_cache[:end_of][index]
|
|
1365
1323
|
if cached
|
|
1366
|
-
|
|
1324
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1367
1325
|
@index = cached.interval.end
|
|
1368
1326
|
end
|
|
1369
1327
|
return cached
|
|
1370
1328
|
end
|
|
1371
1329
|
|
|
1372
1330
|
i0, s0 = index, []
|
|
1373
|
-
if
|
|
1374
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1375
|
-
@index +=
|
|
1331
|
+
if has_terminal?('end', false, index)
|
|
1332
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1333
|
+
@index += 3
|
|
1376
1334
|
else
|
|
1377
|
-
terminal_parse_failure('
|
|
1335
|
+
terminal_parse_failure('end')
|
|
1378
1336
|
r1 = nil
|
|
1379
1337
|
end
|
|
1380
1338
|
s0 << r1
|
|
@@ -1391,11 +1349,11 @@ module Timing
|
|
|
1391
1349
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
1392
1350
|
s0 << r2
|
|
1393
1351
|
if r2
|
|
1394
|
-
if
|
|
1395
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1396
|
-
@index +=
|
|
1352
|
+
if has_terminal?('of', false, index)
|
|
1353
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
|
1354
|
+
@index += 2
|
|
1397
1355
|
else
|
|
1398
|
-
terminal_parse_failure('
|
|
1356
|
+
terminal_parse_failure('of')
|
|
1399
1357
|
r4 = nil
|
|
1400
1358
|
end
|
|
1401
1359
|
s0 << r4
|
|
@@ -1419,7 +1377,7 @@ module Timing
|
|
|
1419
1377
|
if node_cache[:before_from].has_key?(index)
|
|
1420
1378
|
cached = node_cache[:before_from][index]
|
|
1421
1379
|
if cached
|
|
1422
|
-
|
|
1380
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1423
1381
|
@index = cached.interval.end
|
|
1424
1382
|
end
|
|
1425
1383
|
return cached
|
|
@@ -1428,12 +1386,10 @@ module Timing
|
|
|
1428
1386
|
i0 = index
|
|
1429
1387
|
r1 = _nt_before
|
|
1430
1388
|
if r1
|
|
1431
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1432
1389
|
r0 = r1
|
|
1433
1390
|
else
|
|
1434
1391
|
r2 = _nt_from
|
|
1435
1392
|
if r2
|
|
1436
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1437
1393
|
r0 = r2
|
|
1438
1394
|
else
|
|
1439
1395
|
@index = i0
|
|
@@ -1451,17 +1407,17 @@ module Timing
|
|
|
1451
1407
|
if node_cache[:before].has_key?(index)
|
|
1452
1408
|
cached = node_cache[:before][index]
|
|
1453
1409
|
if cached
|
|
1454
|
-
|
|
1410
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1455
1411
|
@index = cached.interval.end
|
|
1456
1412
|
end
|
|
1457
1413
|
return cached
|
|
1458
1414
|
end
|
|
1459
1415
|
|
|
1460
|
-
if
|
|
1461
|
-
r0 = instantiate_node(BeforeFrom,input, index...(index +
|
|
1462
|
-
@index +=
|
|
1416
|
+
if has_terminal?('before', false, index)
|
|
1417
|
+
r0 = instantiate_node(BeforeFrom,input, index...(index + 6))
|
|
1418
|
+
@index += 6
|
|
1463
1419
|
else
|
|
1464
|
-
terminal_parse_failure('
|
|
1420
|
+
terminal_parse_failure('before')
|
|
1465
1421
|
r0 = nil
|
|
1466
1422
|
end
|
|
1467
1423
|
|
|
@@ -1475,17 +1431,17 @@ module Timing
|
|
|
1475
1431
|
if node_cache[:from].has_key?(index)
|
|
1476
1432
|
cached = node_cache[:from][index]
|
|
1477
1433
|
if cached
|
|
1478
|
-
|
|
1434
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1479
1435
|
@index = cached.interval.end
|
|
1480
1436
|
end
|
|
1481
1437
|
return cached
|
|
1482
1438
|
end
|
|
1483
1439
|
|
|
1484
|
-
if
|
|
1485
|
-
r0 = instantiate_node(BeforeFrom,input, index...(index +
|
|
1486
|
-
@index +=
|
|
1440
|
+
if has_terminal?('from', false, index)
|
|
1441
|
+
r0 = instantiate_node(BeforeFrom,input, index...(index + 4))
|
|
1442
|
+
@index += 4
|
|
1487
1443
|
else
|
|
1488
|
-
terminal_parse_failure('
|
|
1444
|
+
terminal_parse_failure('from')
|
|
1489
1445
|
r0 = nil
|
|
1490
1446
|
end
|
|
1491
1447
|
|
|
@@ -1499,7 +1455,7 @@ module Timing
|
|
|
1499
1455
|
if node_cache[:interval].has_key?(index)
|
|
1500
1456
|
cached = node_cache[:interval][index]
|
|
1501
1457
|
if cached
|
|
1502
|
-
|
|
1458
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1503
1459
|
@index = cached.interval.end
|
|
1504
1460
|
end
|
|
1505
1461
|
return cached
|
|
@@ -1508,37 +1464,30 @@ module Timing
|
|
|
1508
1464
|
i0 = index
|
|
1509
1465
|
r1 = _nt_second_interval
|
|
1510
1466
|
if r1
|
|
1511
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1512
1467
|
r0 = r1
|
|
1513
1468
|
else
|
|
1514
1469
|
r2 = _nt_minute_interval
|
|
1515
1470
|
if r2
|
|
1516
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1517
1471
|
r0 = r2
|
|
1518
1472
|
else
|
|
1519
1473
|
r3 = _nt_hour_interval
|
|
1520
1474
|
if r3
|
|
1521
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
1522
1475
|
r0 = r3
|
|
1523
1476
|
else
|
|
1524
1477
|
r4 = _nt_day_interval
|
|
1525
1478
|
if r4
|
|
1526
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
1527
1479
|
r0 = r4
|
|
1528
1480
|
else
|
|
1529
1481
|
r5 = _nt_week_interval
|
|
1530
1482
|
if r5
|
|
1531
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
1532
1483
|
r0 = r5
|
|
1533
1484
|
else
|
|
1534
1485
|
r6 = _nt_month_interval
|
|
1535
1486
|
if r6
|
|
1536
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
1537
1487
|
r0 = r6
|
|
1538
1488
|
else
|
|
1539
1489
|
r7 = _nt_year_interval
|
|
1540
1490
|
if r7
|
|
1541
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
1542
1491
|
r0 = r7
|
|
1543
1492
|
else
|
|
1544
1493
|
@index = i0
|
|
@@ -1564,27 +1513,27 @@ module Timing
|
|
|
1564
1513
|
if node_cache[:second_interval].has_key?(index)
|
|
1565
1514
|
cached = node_cache[:second_interval][index]
|
|
1566
1515
|
if cached
|
|
1567
|
-
|
|
1516
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1568
1517
|
@index = cached.interval.end
|
|
1569
1518
|
end
|
|
1570
1519
|
return cached
|
|
1571
1520
|
end
|
|
1572
1521
|
|
|
1573
1522
|
i0, s0 = index, []
|
|
1574
|
-
if
|
|
1575
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1576
|
-
@index +=
|
|
1523
|
+
if has_terminal?('second', false, index)
|
|
1524
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
|
1525
|
+
@index += 6
|
|
1577
1526
|
else
|
|
1578
|
-
terminal_parse_failure('
|
|
1527
|
+
terminal_parse_failure('second')
|
|
1579
1528
|
r1 = nil
|
|
1580
1529
|
end
|
|
1581
1530
|
s0 << r1
|
|
1582
1531
|
if r1
|
|
1583
|
-
if
|
|
1584
|
-
r3 =
|
|
1585
|
-
@index +=
|
|
1532
|
+
if has_terminal?('s', false, index)
|
|
1533
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1534
|
+
@index += 1
|
|
1586
1535
|
else
|
|
1587
|
-
terminal_parse_failure('
|
|
1536
|
+
terminal_parse_failure('s')
|
|
1588
1537
|
r3 = nil
|
|
1589
1538
|
end
|
|
1590
1539
|
if r3
|
|
@@ -1615,27 +1564,27 @@ module Timing
|
|
|
1615
1564
|
if node_cache[:minute_interval].has_key?(index)
|
|
1616
1565
|
cached = node_cache[:minute_interval][index]
|
|
1617
1566
|
if cached
|
|
1618
|
-
|
|
1567
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1619
1568
|
@index = cached.interval.end
|
|
1620
1569
|
end
|
|
1621
1570
|
return cached
|
|
1622
1571
|
end
|
|
1623
1572
|
|
|
1624
1573
|
i0, s0 = index, []
|
|
1625
|
-
if
|
|
1626
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1627
|
-
@index +=
|
|
1574
|
+
if has_terminal?('minute', false, index)
|
|
1575
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
|
1576
|
+
@index += 6
|
|
1628
1577
|
else
|
|
1629
|
-
terminal_parse_failure('
|
|
1578
|
+
terminal_parse_failure('minute')
|
|
1630
1579
|
r1 = nil
|
|
1631
1580
|
end
|
|
1632
1581
|
s0 << r1
|
|
1633
1582
|
if r1
|
|
1634
|
-
if
|
|
1635
|
-
r3 =
|
|
1636
|
-
@index +=
|
|
1583
|
+
if has_terminal?('s', false, index)
|
|
1584
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1585
|
+
@index += 1
|
|
1637
1586
|
else
|
|
1638
|
-
terminal_parse_failure('
|
|
1587
|
+
terminal_parse_failure('s')
|
|
1639
1588
|
r3 = nil
|
|
1640
1589
|
end
|
|
1641
1590
|
if r3
|
|
@@ -1666,27 +1615,27 @@ module Timing
|
|
|
1666
1615
|
if node_cache[:hour_interval].has_key?(index)
|
|
1667
1616
|
cached = node_cache[:hour_interval][index]
|
|
1668
1617
|
if cached
|
|
1669
|
-
|
|
1618
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1670
1619
|
@index = cached.interval.end
|
|
1671
1620
|
end
|
|
1672
1621
|
return cached
|
|
1673
1622
|
end
|
|
1674
1623
|
|
|
1675
1624
|
i0, s0 = index, []
|
|
1676
|
-
if
|
|
1677
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1678
|
-
@index +=
|
|
1625
|
+
if has_terminal?('hour', false, index)
|
|
1626
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
1627
|
+
@index += 4
|
|
1679
1628
|
else
|
|
1680
|
-
terminal_parse_failure('
|
|
1629
|
+
terminal_parse_failure('hour')
|
|
1681
1630
|
r1 = nil
|
|
1682
1631
|
end
|
|
1683
1632
|
s0 << r1
|
|
1684
1633
|
if r1
|
|
1685
|
-
if
|
|
1686
|
-
r3 =
|
|
1687
|
-
@index +=
|
|
1634
|
+
if has_terminal?('s', false, index)
|
|
1635
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1636
|
+
@index += 1
|
|
1688
1637
|
else
|
|
1689
|
-
terminal_parse_failure('
|
|
1638
|
+
terminal_parse_failure('s')
|
|
1690
1639
|
r3 = nil
|
|
1691
1640
|
end
|
|
1692
1641
|
if r3
|
|
@@ -1717,27 +1666,27 @@ module Timing
|
|
|
1717
1666
|
if node_cache[:day_interval].has_key?(index)
|
|
1718
1667
|
cached = node_cache[:day_interval][index]
|
|
1719
1668
|
if cached
|
|
1720
|
-
|
|
1669
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1721
1670
|
@index = cached.interval.end
|
|
1722
1671
|
end
|
|
1723
1672
|
return cached
|
|
1724
1673
|
end
|
|
1725
1674
|
|
|
1726
1675
|
i0, s0 = index, []
|
|
1727
|
-
if
|
|
1728
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1729
|
-
@index +=
|
|
1676
|
+
if has_terminal?('day', false, index)
|
|
1677
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
|
1678
|
+
@index += 3
|
|
1730
1679
|
else
|
|
1731
|
-
terminal_parse_failure('
|
|
1680
|
+
terminal_parse_failure('day')
|
|
1732
1681
|
r1 = nil
|
|
1733
1682
|
end
|
|
1734
1683
|
s0 << r1
|
|
1735
1684
|
if r1
|
|
1736
|
-
if
|
|
1737
|
-
r3 =
|
|
1738
|
-
@index +=
|
|
1685
|
+
if has_terminal?('s', false, index)
|
|
1686
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1687
|
+
@index += 1
|
|
1739
1688
|
else
|
|
1740
|
-
terminal_parse_failure('
|
|
1689
|
+
terminal_parse_failure('s')
|
|
1741
1690
|
r3 = nil
|
|
1742
1691
|
end
|
|
1743
1692
|
if r3
|
|
@@ -1768,27 +1717,27 @@ module Timing
|
|
|
1768
1717
|
if node_cache[:week_interval].has_key?(index)
|
|
1769
1718
|
cached = node_cache[:week_interval][index]
|
|
1770
1719
|
if cached
|
|
1771
|
-
|
|
1720
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1772
1721
|
@index = cached.interval.end
|
|
1773
1722
|
end
|
|
1774
1723
|
return cached
|
|
1775
1724
|
end
|
|
1776
1725
|
|
|
1777
1726
|
i0, s0 = index, []
|
|
1778
|
-
if
|
|
1779
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1780
|
-
@index +=
|
|
1727
|
+
if has_terminal?('week', false, index)
|
|
1728
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
1729
|
+
@index += 4
|
|
1781
1730
|
else
|
|
1782
|
-
terminal_parse_failure('
|
|
1731
|
+
terminal_parse_failure('week')
|
|
1783
1732
|
r1 = nil
|
|
1784
1733
|
end
|
|
1785
1734
|
s0 << r1
|
|
1786
1735
|
if r1
|
|
1787
|
-
if
|
|
1788
|
-
r3 =
|
|
1789
|
-
@index +=
|
|
1736
|
+
if has_terminal?('s', false, index)
|
|
1737
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1738
|
+
@index += 1
|
|
1790
1739
|
else
|
|
1791
|
-
terminal_parse_failure('
|
|
1740
|
+
terminal_parse_failure('s')
|
|
1792
1741
|
r3 = nil
|
|
1793
1742
|
end
|
|
1794
1743
|
if r3
|
|
@@ -1819,27 +1768,27 @@ module Timing
|
|
|
1819
1768
|
if node_cache[:month_interval].has_key?(index)
|
|
1820
1769
|
cached = node_cache[:month_interval][index]
|
|
1821
1770
|
if cached
|
|
1822
|
-
|
|
1771
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1823
1772
|
@index = cached.interval.end
|
|
1824
1773
|
end
|
|
1825
1774
|
return cached
|
|
1826
1775
|
end
|
|
1827
1776
|
|
|
1828
1777
|
i0, s0 = index, []
|
|
1829
|
-
if
|
|
1830
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1831
|
-
@index +=
|
|
1778
|
+
if has_terminal?('month', false, index)
|
|
1779
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
|
1780
|
+
@index += 5
|
|
1832
1781
|
else
|
|
1833
|
-
terminal_parse_failure('
|
|
1782
|
+
terminal_parse_failure('month')
|
|
1834
1783
|
r1 = nil
|
|
1835
1784
|
end
|
|
1836
1785
|
s0 << r1
|
|
1837
1786
|
if r1
|
|
1838
|
-
if
|
|
1839
|
-
r3 =
|
|
1840
|
-
@index +=
|
|
1787
|
+
if has_terminal?('s', false, index)
|
|
1788
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1789
|
+
@index += 1
|
|
1841
1790
|
else
|
|
1842
|
-
terminal_parse_failure('
|
|
1791
|
+
terminal_parse_failure('s')
|
|
1843
1792
|
r3 = nil
|
|
1844
1793
|
end
|
|
1845
1794
|
if r3
|
|
@@ -1870,27 +1819,27 @@ module Timing
|
|
|
1870
1819
|
if node_cache[:year_interval].has_key?(index)
|
|
1871
1820
|
cached = node_cache[:year_interval][index]
|
|
1872
1821
|
if cached
|
|
1873
|
-
|
|
1822
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1874
1823
|
@index = cached.interval.end
|
|
1875
1824
|
end
|
|
1876
1825
|
return cached
|
|
1877
1826
|
end
|
|
1878
1827
|
|
|
1879
1828
|
i0, s0 = index, []
|
|
1880
|
-
if
|
|
1881
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
|
1882
|
-
@index +=
|
|
1829
|
+
if has_terminal?('year', false, index)
|
|
1830
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
|
1831
|
+
@index += 4
|
|
1883
1832
|
else
|
|
1884
|
-
terminal_parse_failure('
|
|
1833
|
+
terminal_parse_failure('year')
|
|
1885
1834
|
r1 = nil
|
|
1886
1835
|
end
|
|
1887
1836
|
s0 << r1
|
|
1888
1837
|
if r1
|
|
1889
|
-
if
|
|
1890
|
-
r3 =
|
|
1891
|
-
@index +=
|
|
1838
|
+
if has_terminal?('s', false, index)
|
|
1839
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
1840
|
+
@index += 1
|
|
1892
1841
|
else
|
|
1893
|
-
terminal_parse_failure('
|
|
1842
|
+
terminal_parse_failure('s')
|
|
1894
1843
|
r3 = nil
|
|
1895
1844
|
end
|
|
1896
1845
|
if r3
|
|
@@ -1918,7 +1867,7 @@ module Timing
|
|
|
1918
1867
|
if node_cache[:day_name].has_key?(index)
|
|
1919
1868
|
cached = node_cache[:day_name][index]
|
|
1920
1869
|
if cached
|
|
1921
|
-
|
|
1870
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1922
1871
|
@index = cached.interval.end
|
|
1923
1872
|
end
|
|
1924
1873
|
return cached
|
|
@@ -1927,12 +1876,10 @@ module Timing
|
|
|
1927
1876
|
i0 = index
|
|
1928
1877
|
r1 = _nt_long_day_name
|
|
1929
1878
|
if r1
|
|
1930
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1931
1879
|
r0 = r1
|
|
1932
1880
|
else
|
|
1933
1881
|
r2 = _nt_short_day_name
|
|
1934
1882
|
if r2
|
|
1935
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1936
1883
|
r0 = r2
|
|
1937
1884
|
else
|
|
1938
1885
|
@index = i0
|
|
@@ -1950,88 +1897,81 @@ module Timing
|
|
|
1950
1897
|
if node_cache[:long_day_name].has_key?(index)
|
|
1951
1898
|
cached = node_cache[:long_day_name][index]
|
|
1952
1899
|
if cached
|
|
1953
|
-
|
|
1900
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
1954
1901
|
@index = cached.interval.end
|
|
1955
1902
|
end
|
|
1956
1903
|
return cached
|
|
1957
1904
|
end
|
|
1958
1905
|
|
|
1959
1906
|
i0 = index
|
|
1960
|
-
if
|
|
1961
|
-
r1 = instantiate_node(DayName,input, index...(index +
|
|
1962
|
-
@index +=
|
|
1907
|
+
if has_terminal?('sunday', false, index)
|
|
1908
|
+
r1 = instantiate_node(DayName,input, index...(index + 6))
|
|
1909
|
+
@index += 6
|
|
1963
1910
|
else
|
|
1964
|
-
terminal_parse_failure('
|
|
1911
|
+
terminal_parse_failure('sunday')
|
|
1965
1912
|
r1 = nil
|
|
1966
1913
|
end
|
|
1967
1914
|
if r1
|
|
1968
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
1969
1915
|
r0 = r1
|
|
1970
1916
|
else
|
|
1971
|
-
if
|
|
1972
|
-
r2 = instantiate_node(DayName,input, index...(index +
|
|
1973
|
-
@index +=
|
|
1917
|
+
if has_terminal?('monday', false, index)
|
|
1918
|
+
r2 = instantiate_node(DayName,input, index...(index + 6))
|
|
1919
|
+
@index += 6
|
|
1974
1920
|
else
|
|
1975
|
-
terminal_parse_failure('
|
|
1921
|
+
terminal_parse_failure('monday')
|
|
1976
1922
|
r2 = nil
|
|
1977
1923
|
end
|
|
1978
1924
|
if r2
|
|
1979
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
1980
1925
|
r0 = r2
|
|
1981
1926
|
else
|
|
1982
|
-
if
|
|
1983
|
-
r3 = instantiate_node(DayName,input, index...(index +
|
|
1984
|
-
@index +=
|
|
1927
|
+
if has_terminal?('tuesday', false, index)
|
|
1928
|
+
r3 = instantiate_node(DayName,input, index...(index + 7))
|
|
1929
|
+
@index += 7
|
|
1985
1930
|
else
|
|
1986
|
-
terminal_parse_failure('
|
|
1931
|
+
terminal_parse_failure('tuesday')
|
|
1987
1932
|
r3 = nil
|
|
1988
1933
|
end
|
|
1989
1934
|
if r3
|
|
1990
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
1991
1935
|
r0 = r3
|
|
1992
1936
|
else
|
|
1993
|
-
if
|
|
1994
|
-
r4 = instantiate_node(DayName,input, index...(index +
|
|
1995
|
-
@index +=
|
|
1937
|
+
if has_terminal?('wednesday', false, index)
|
|
1938
|
+
r4 = instantiate_node(DayName,input, index...(index + 9))
|
|
1939
|
+
@index += 9
|
|
1996
1940
|
else
|
|
1997
|
-
terminal_parse_failure('
|
|
1941
|
+
terminal_parse_failure('wednesday')
|
|
1998
1942
|
r4 = nil
|
|
1999
1943
|
end
|
|
2000
1944
|
if r4
|
|
2001
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2002
1945
|
r0 = r4
|
|
2003
1946
|
else
|
|
2004
|
-
if
|
|
2005
|
-
r5 = instantiate_node(DayName,input, index...(index +
|
|
2006
|
-
@index +=
|
|
1947
|
+
if has_terminal?('thursday', false, index)
|
|
1948
|
+
r5 = instantiate_node(DayName,input, index...(index + 8))
|
|
1949
|
+
@index += 8
|
|
2007
1950
|
else
|
|
2008
|
-
terminal_parse_failure('
|
|
1951
|
+
terminal_parse_failure('thursday')
|
|
2009
1952
|
r5 = nil
|
|
2010
1953
|
end
|
|
2011
1954
|
if r5
|
|
2012
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2013
1955
|
r0 = r5
|
|
2014
1956
|
else
|
|
2015
|
-
if
|
|
2016
|
-
r6 = instantiate_node(DayName,input, index...(index +
|
|
2017
|
-
@index +=
|
|
1957
|
+
if has_terminal?('friday', false, index)
|
|
1958
|
+
r6 = instantiate_node(DayName,input, index...(index + 6))
|
|
1959
|
+
@index += 6
|
|
2018
1960
|
else
|
|
2019
|
-
terminal_parse_failure('
|
|
1961
|
+
terminal_parse_failure('friday')
|
|
2020
1962
|
r6 = nil
|
|
2021
1963
|
end
|
|
2022
1964
|
if r6
|
|
2023
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2024
1965
|
r0 = r6
|
|
2025
1966
|
else
|
|
2026
|
-
if
|
|
2027
|
-
r7 = instantiate_node(DayName,input, index...(index +
|
|
2028
|
-
@index +=
|
|
1967
|
+
if has_terminal?('saturday', false, index)
|
|
1968
|
+
r7 = instantiate_node(DayName,input, index...(index + 8))
|
|
1969
|
+
@index += 8
|
|
2029
1970
|
else
|
|
2030
|
-
terminal_parse_failure('
|
|
1971
|
+
terminal_parse_failure('saturday')
|
|
2031
1972
|
r7 = nil
|
|
2032
1973
|
end
|
|
2033
1974
|
if r7
|
|
2034
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2035
1975
|
r0 = r7
|
|
2036
1976
|
else
|
|
2037
1977
|
@index = i0
|
|
@@ -2054,88 +1994,81 @@ module Timing
|
|
|
2054
1994
|
if node_cache[:short_day_name].has_key?(index)
|
|
2055
1995
|
cached = node_cache[:short_day_name][index]
|
|
2056
1996
|
if cached
|
|
2057
|
-
|
|
1997
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2058
1998
|
@index = cached.interval.end
|
|
2059
1999
|
end
|
|
2060
2000
|
return cached
|
|
2061
2001
|
end
|
|
2062
2002
|
|
|
2063
2003
|
i0 = index
|
|
2064
|
-
if
|
|
2065
|
-
r1 = instantiate_node(DayName,input, index...(index +
|
|
2066
|
-
@index +=
|
|
2004
|
+
if has_terminal?('sun', false, index)
|
|
2005
|
+
r1 = instantiate_node(DayName,input, index...(index + 3))
|
|
2006
|
+
@index += 3
|
|
2067
2007
|
else
|
|
2068
|
-
terminal_parse_failure('
|
|
2008
|
+
terminal_parse_failure('sun')
|
|
2069
2009
|
r1 = nil
|
|
2070
2010
|
end
|
|
2071
2011
|
if r1
|
|
2072
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2073
2012
|
r0 = r1
|
|
2074
2013
|
else
|
|
2075
|
-
if
|
|
2076
|
-
r2 = instantiate_node(DayName,input, index...(index +
|
|
2077
|
-
@index +=
|
|
2014
|
+
if has_terminal?('mon', false, index)
|
|
2015
|
+
r2 = instantiate_node(DayName,input, index...(index + 3))
|
|
2016
|
+
@index += 3
|
|
2078
2017
|
else
|
|
2079
|
-
terminal_parse_failure('
|
|
2018
|
+
terminal_parse_failure('mon')
|
|
2080
2019
|
r2 = nil
|
|
2081
2020
|
end
|
|
2082
2021
|
if r2
|
|
2083
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2084
2022
|
r0 = r2
|
|
2085
2023
|
else
|
|
2086
|
-
if
|
|
2087
|
-
r3 = instantiate_node(DayName,input, index...(index +
|
|
2088
|
-
@index +=
|
|
2024
|
+
if has_terminal?('tue', false, index)
|
|
2025
|
+
r3 = instantiate_node(DayName,input, index...(index + 3))
|
|
2026
|
+
@index += 3
|
|
2089
2027
|
else
|
|
2090
|
-
terminal_parse_failure('
|
|
2028
|
+
terminal_parse_failure('tue')
|
|
2091
2029
|
r3 = nil
|
|
2092
2030
|
end
|
|
2093
2031
|
if r3
|
|
2094
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2095
2032
|
r0 = r3
|
|
2096
2033
|
else
|
|
2097
|
-
if
|
|
2098
|
-
r4 = instantiate_node(DayName,input, index...(index +
|
|
2099
|
-
@index +=
|
|
2034
|
+
if has_terminal?('wed', false, index)
|
|
2035
|
+
r4 = instantiate_node(DayName,input, index...(index + 3))
|
|
2036
|
+
@index += 3
|
|
2100
2037
|
else
|
|
2101
|
-
terminal_parse_failure('
|
|
2038
|
+
terminal_parse_failure('wed')
|
|
2102
2039
|
r4 = nil
|
|
2103
2040
|
end
|
|
2104
2041
|
if r4
|
|
2105
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2106
2042
|
r0 = r4
|
|
2107
2043
|
else
|
|
2108
|
-
if
|
|
2109
|
-
r5 = instantiate_node(DayName,input, index...(index +
|
|
2110
|
-
@index +=
|
|
2044
|
+
if has_terminal?('thu', false, index)
|
|
2045
|
+
r5 = instantiate_node(DayName,input, index...(index + 3))
|
|
2046
|
+
@index += 3
|
|
2111
2047
|
else
|
|
2112
|
-
terminal_parse_failure('
|
|
2048
|
+
terminal_parse_failure('thu')
|
|
2113
2049
|
r5 = nil
|
|
2114
2050
|
end
|
|
2115
2051
|
if r5
|
|
2116
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2117
2052
|
r0 = r5
|
|
2118
2053
|
else
|
|
2119
|
-
if
|
|
2120
|
-
r6 = instantiate_node(DayName,input, index...(index +
|
|
2121
|
-
@index +=
|
|
2054
|
+
if has_terminal?('fri', false, index)
|
|
2055
|
+
r6 = instantiate_node(DayName,input, index...(index + 3))
|
|
2056
|
+
@index += 3
|
|
2122
2057
|
else
|
|
2123
|
-
terminal_parse_failure('
|
|
2058
|
+
terminal_parse_failure('fri')
|
|
2124
2059
|
r6 = nil
|
|
2125
2060
|
end
|
|
2126
2061
|
if r6
|
|
2127
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2128
2062
|
r0 = r6
|
|
2129
2063
|
else
|
|
2130
|
-
if
|
|
2131
|
-
r7 = instantiate_node(DayName,input, index...(index +
|
|
2132
|
-
@index +=
|
|
2064
|
+
if has_terminal?('sat', false, index)
|
|
2065
|
+
r7 = instantiate_node(DayName,input, index...(index + 3))
|
|
2066
|
+
@index += 3
|
|
2133
2067
|
else
|
|
2134
|
-
terminal_parse_failure('
|
|
2068
|
+
terminal_parse_failure('sat')
|
|
2135
2069
|
r7 = nil
|
|
2136
2070
|
end
|
|
2137
2071
|
if r7
|
|
2138
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2139
2072
|
r0 = r7
|
|
2140
2073
|
else
|
|
2141
2074
|
@index = i0
|
|
@@ -2158,7 +2091,7 @@ module Timing
|
|
|
2158
2091
|
if node_cache[:month_name].has_key?(index)
|
|
2159
2092
|
cached = node_cache[:month_name][index]
|
|
2160
2093
|
if cached
|
|
2161
|
-
|
|
2094
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2162
2095
|
@index = cached.interval.end
|
|
2163
2096
|
end
|
|
2164
2097
|
return cached
|
|
@@ -2167,12 +2100,10 @@ module Timing
|
|
|
2167
2100
|
i0 = index
|
|
2168
2101
|
r1 = _nt_long_month_name
|
|
2169
2102
|
if r1
|
|
2170
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2171
2103
|
r0 = r1
|
|
2172
2104
|
else
|
|
2173
2105
|
r2 = _nt_short_month_name
|
|
2174
2106
|
if r2
|
|
2175
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2176
2107
|
r0 = r2
|
|
2177
2108
|
else
|
|
2178
2109
|
@index = i0
|
|
@@ -2190,143 +2121,131 @@ module Timing
|
|
|
2190
2121
|
if node_cache[:long_month_name].has_key?(index)
|
|
2191
2122
|
cached = node_cache[:long_month_name][index]
|
|
2192
2123
|
if cached
|
|
2193
|
-
|
|
2124
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2194
2125
|
@index = cached.interval.end
|
|
2195
2126
|
end
|
|
2196
2127
|
return cached
|
|
2197
2128
|
end
|
|
2198
2129
|
|
|
2199
2130
|
i0 = index
|
|
2200
|
-
if
|
|
2201
|
-
r1 = instantiate_node(MonthName,input, index...(index +
|
|
2202
|
-
@index +=
|
|
2131
|
+
if has_terminal?('january', false, index)
|
|
2132
|
+
r1 = instantiate_node(MonthName,input, index...(index + 7))
|
|
2133
|
+
@index += 7
|
|
2203
2134
|
else
|
|
2204
|
-
terminal_parse_failure('
|
|
2135
|
+
terminal_parse_failure('january')
|
|
2205
2136
|
r1 = nil
|
|
2206
2137
|
end
|
|
2207
2138
|
if r1
|
|
2208
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2209
2139
|
r0 = r1
|
|
2210
2140
|
else
|
|
2211
|
-
if
|
|
2212
|
-
r2 = instantiate_node(MonthName,input, index...(index +
|
|
2213
|
-
@index +=
|
|
2141
|
+
if has_terminal?('february', false, index)
|
|
2142
|
+
r2 = instantiate_node(MonthName,input, index...(index + 8))
|
|
2143
|
+
@index += 8
|
|
2214
2144
|
else
|
|
2215
|
-
terminal_parse_failure('
|
|
2145
|
+
terminal_parse_failure('february')
|
|
2216
2146
|
r2 = nil
|
|
2217
2147
|
end
|
|
2218
2148
|
if r2
|
|
2219
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2220
2149
|
r0 = r2
|
|
2221
2150
|
else
|
|
2222
|
-
if
|
|
2223
|
-
r3 = instantiate_node(MonthName,input, index...(index +
|
|
2224
|
-
@index +=
|
|
2151
|
+
if has_terminal?('march', false, index)
|
|
2152
|
+
r3 = instantiate_node(MonthName,input, index...(index + 5))
|
|
2153
|
+
@index += 5
|
|
2225
2154
|
else
|
|
2226
|
-
terminal_parse_failure('
|
|
2155
|
+
terminal_parse_failure('march')
|
|
2227
2156
|
r3 = nil
|
|
2228
2157
|
end
|
|
2229
2158
|
if r3
|
|
2230
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2231
2159
|
r0 = r3
|
|
2232
2160
|
else
|
|
2233
|
-
if
|
|
2234
|
-
r4 = instantiate_node(MonthName,input, index...(index +
|
|
2235
|
-
@index +=
|
|
2161
|
+
if has_terminal?('april', false, index)
|
|
2162
|
+
r4 = instantiate_node(MonthName,input, index...(index + 5))
|
|
2163
|
+
@index += 5
|
|
2236
2164
|
else
|
|
2237
|
-
terminal_parse_failure('
|
|
2165
|
+
terminal_parse_failure('april')
|
|
2238
2166
|
r4 = nil
|
|
2239
2167
|
end
|
|
2240
2168
|
if r4
|
|
2241
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2242
2169
|
r0 = r4
|
|
2243
2170
|
else
|
|
2244
|
-
if
|
|
2245
|
-
r5 = instantiate_node(MonthName,input, index...(index +
|
|
2246
|
-
@index +=
|
|
2171
|
+
if has_terminal?('may', false, index)
|
|
2172
|
+
r5 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2173
|
+
@index += 3
|
|
2247
2174
|
else
|
|
2248
|
-
terminal_parse_failure('
|
|
2175
|
+
terminal_parse_failure('may')
|
|
2249
2176
|
r5 = nil
|
|
2250
2177
|
end
|
|
2251
2178
|
if r5
|
|
2252
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2253
2179
|
r0 = r5
|
|
2254
2180
|
else
|
|
2255
|
-
if
|
|
2256
|
-
r6 = instantiate_node(MonthName,input, index...(index +
|
|
2257
|
-
@index +=
|
|
2181
|
+
if has_terminal?('june', false, index)
|
|
2182
|
+
r6 = instantiate_node(MonthName,input, index...(index + 4))
|
|
2183
|
+
@index += 4
|
|
2258
2184
|
else
|
|
2259
|
-
terminal_parse_failure('
|
|
2185
|
+
terminal_parse_failure('june')
|
|
2260
2186
|
r6 = nil
|
|
2261
2187
|
end
|
|
2262
2188
|
if r6
|
|
2263
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2264
2189
|
r0 = r6
|
|
2265
2190
|
else
|
|
2266
|
-
if
|
|
2267
|
-
r7 = instantiate_node(MonthName,input, index...(index +
|
|
2268
|
-
@index +=
|
|
2191
|
+
if has_terminal?('july', false, index)
|
|
2192
|
+
r7 = instantiate_node(MonthName,input, index...(index + 4))
|
|
2193
|
+
@index += 4
|
|
2269
2194
|
else
|
|
2270
|
-
terminal_parse_failure('
|
|
2195
|
+
terminal_parse_failure('july')
|
|
2271
2196
|
r7 = nil
|
|
2272
2197
|
end
|
|
2273
2198
|
if r7
|
|
2274
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2275
2199
|
r0 = r7
|
|
2276
2200
|
else
|
|
2277
|
-
if
|
|
2278
|
-
r8 = instantiate_node(MonthName,input, index...(index +
|
|
2279
|
-
@index +=
|
|
2201
|
+
if has_terminal?('august', false, index)
|
|
2202
|
+
r8 = instantiate_node(MonthName,input, index...(index + 6))
|
|
2203
|
+
@index += 6
|
|
2280
2204
|
else
|
|
2281
|
-
terminal_parse_failure('
|
|
2205
|
+
terminal_parse_failure('august')
|
|
2282
2206
|
r8 = nil
|
|
2283
2207
|
end
|
|
2284
2208
|
if r8
|
|
2285
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2286
2209
|
r0 = r8
|
|
2287
2210
|
else
|
|
2288
|
-
if
|
|
2289
|
-
r9 = instantiate_node(MonthName,input, index...(index +
|
|
2290
|
-
@index +=
|
|
2211
|
+
if has_terminal?('september', false, index)
|
|
2212
|
+
r9 = instantiate_node(MonthName,input, index...(index + 9))
|
|
2213
|
+
@index += 9
|
|
2291
2214
|
else
|
|
2292
|
-
terminal_parse_failure('
|
|
2215
|
+
terminal_parse_failure('september')
|
|
2293
2216
|
r9 = nil
|
|
2294
2217
|
end
|
|
2295
2218
|
if r9
|
|
2296
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
2297
2219
|
r0 = r9
|
|
2298
2220
|
else
|
|
2299
|
-
if
|
|
2300
|
-
r10 = instantiate_node(MonthName,input, index...(index +
|
|
2301
|
-
@index +=
|
|
2221
|
+
if has_terminal?('october', false, index)
|
|
2222
|
+
r10 = instantiate_node(MonthName,input, index...(index + 7))
|
|
2223
|
+
@index += 7
|
|
2302
2224
|
else
|
|
2303
|
-
terminal_parse_failure('
|
|
2225
|
+
terminal_parse_failure('october')
|
|
2304
2226
|
r10 = nil
|
|
2305
2227
|
end
|
|
2306
2228
|
if r10
|
|
2307
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
2308
2229
|
r0 = r10
|
|
2309
2230
|
else
|
|
2310
|
-
if
|
|
2311
|
-
r11 = instantiate_node(MonthName,input, index...(index +
|
|
2312
|
-
@index +=
|
|
2231
|
+
if has_terminal?('november', false, index)
|
|
2232
|
+
r11 = instantiate_node(MonthName,input, index...(index + 8))
|
|
2233
|
+
@index += 8
|
|
2313
2234
|
else
|
|
2314
|
-
terminal_parse_failure('
|
|
2235
|
+
terminal_parse_failure('november')
|
|
2315
2236
|
r11 = nil
|
|
2316
2237
|
end
|
|
2317
2238
|
if r11
|
|
2318
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
2319
2239
|
r0 = r11
|
|
2320
2240
|
else
|
|
2321
|
-
if
|
|
2322
|
-
r12 = instantiate_node(MonthName,input, index...(index +
|
|
2323
|
-
@index +=
|
|
2241
|
+
if has_terminal?('december', false, index)
|
|
2242
|
+
r12 = instantiate_node(MonthName,input, index...(index + 8))
|
|
2243
|
+
@index += 8
|
|
2324
2244
|
else
|
|
2325
|
-
terminal_parse_failure('
|
|
2245
|
+
terminal_parse_failure('december')
|
|
2326
2246
|
r12 = nil
|
|
2327
2247
|
end
|
|
2328
2248
|
if r12
|
|
2329
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2330
2249
|
r0 = r12
|
|
2331
2250
|
else
|
|
2332
2251
|
@index = i0
|
|
@@ -2354,143 +2273,131 @@ module Timing
|
|
|
2354
2273
|
if node_cache[:short_month_name].has_key?(index)
|
|
2355
2274
|
cached = node_cache[:short_month_name][index]
|
|
2356
2275
|
if cached
|
|
2357
|
-
|
|
2276
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2358
2277
|
@index = cached.interval.end
|
|
2359
2278
|
end
|
|
2360
2279
|
return cached
|
|
2361
2280
|
end
|
|
2362
2281
|
|
|
2363
2282
|
i0 = index
|
|
2364
|
-
if
|
|
2365
|
-
r1 = instantiate_node(MonthName,input, index...(index +
|
|
2366
|
-
@index +=
|
|
2283
|
+
if has_terminal?('jan', false, index)
|
|
2284
|
+
r1 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2285
|
+
@index += 3
|
|
2367
2286
|
else
|
|
2368
|
-
terminal_parse_failure('
|
|
2287
|
+
terminal_parse_failure('jan')
|
|
2369
2288
|
r1 = nil
|
|
2370
2289
|
end
|
|
2371
2290
|
if r1
|
|
2372
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2373
2291
|
r0 = r1
|
|
2374
2292
|
else
|
|
2375
|
-
if
|
|
2376
|
-
r2 = instantiate_node(MonthName,input, index...(index +
|
|
2377
|
-
@index +=
|
|
2293
|
+
if has_terminal?('feb', false, index)
|
|
2294
|
+
r2 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2295
|
+
@index += 3
|
|
2378
2296
|
else
|
|
2379
|
-
terminal_parse_failure('
|
|
2297
|
+
terminal_parse_failure('feb')
|
|
2380
2298
|
r2 = nil
|
|
2381
2299
|
end
|
|
2382
2300
|
if r2
|
|
2383
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
|
2384
2301
|
r0 = r2
|
|
2385
2302
|
else
|
|
2386
|
-
if
|
|
2387
|
-
r3 = instantiate_node(MonthName,input, index...(index +
|
|
2388
|
-
@index +=
|
|
2303
|
+
if has_terminal?('mar', false, index)
|
|
2304
|
+
r3 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2305
|
+
@index += 3
|
|
2389
2306
|
else
|
|
2390
|
-
terminal_parse_failure('
|
|
2307
|
+
terminal_parse_failure('mar')
|
|
2391
2308
|
r3 = nil
|
|
2392
2309
|
end
|
|
2393
2310
|
if r3
|
|
2394
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
2395
2311
|
r0 = r3
|
|
2396
2312
|
else
|
|
2397
|
-
if
|
|
2398
|
-
r4 = instantiate_node(MonthName,input, index...(index +
|
|
2399
|
-
@index +=
|
|
2313
|
+
if has_terminal?('apr', false, index)
|
|
2314
|
+
r4 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2315
|
+
@index += 3
|
|
2400
2316
|
else
|
|
2401
|
-
terminal_parse_failure('
|
|
2317
|
+
terminal_parse_failure('apr')
|
|
2402
2318
|
r4 = nil
|
|
2403
2319
|
end
|
|
2404
2320
|
if r4
|
|
2405
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
2406
2321
|
r0 = r4
|
|
2407
2322
|
else
|
|
2408
|
-
if
|
|
2409
|
-
r5 = instantiate_node(MonthName,input, index...(index +
|
|
2410
|
-
@index +=
|
|
2323
|
+
if has_terminal?('may', false, index)
|
|
2324
|
+
r5 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2325
|
+
@index += 3
|
|
2411
2326
|
else
|
|
2412
|
-
terminal_parse_failure('
|
|
2327
|
+
terminal_parse_failure('may')
|
|
2413
2328
|
r5 = nil
|
|
2414
2329
|
end
|
|
2415
2330
|
if r5
|
|
2416
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2417
2331
|
r0 = r5
|
|
2418
2332
|
else
|
|
2419
|
-
if
|
|
2420
|
-
r6 = instantiate_node(MonthName,input, index...(index +
|
|
2421
|
-
@index +=
|
|
2333
|
+
if has_terminal?('jun', false, index)
|
|
2334
|
+
r6 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2335
|
+
@index += 3
|
|
2422
2336
|
else
|
|
2423
|
-
terminal_parse_failure('
|
|
2337
|
+
terminal_parse_failure('jun')
|
|
2424
2338
|
r6 = nil
|
|
2425
2339
|
end
|
|
2426
2340
|
if r6
|
|
2427
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
2428
2341
|
r0 = r6
|
|
2429
2342
|
else
|
|
2430
|
-
if
|
|
2431
|
-
r7 = instantiate_node(MonthName,input, index...(index +
|
|
2432
|
-
@index +=
|
|
2343
|
+
if has_terminal?('jul', false, index)
|
|
2344
|
+
r7 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2345
|
+
@index += 3
|
|
2433
2346
|
else
|
|
2434
|
-
terminal_parse_failure('
|
|
2347
|
+
terminal_parse_failure('jul')
|
|
2435
2348
|
r7 = nil
|
|
2436
2349
|
end
|
|
2437
2350
|
if r7
|
|
2438
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
2439
2351
|
r0 = r7
|
|
2440
2352
|
else
|
|
2441
|
-
if
|
|
2442
|
-
r8 = instantiate_node(MonthName,input, index...(index +
|
|
2443
|
-
@index +=
|
|
2353
|
+
if has_terminal?('aug', false, index)
|
|
2354
|
+
r8 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2355
|
+
@index += 3
|
|
2444
2356
|
else
|
|
2445
|
-
terminal_parse_failure('
|
|
2357
|
+
terminal_parse_failure('aug')
|
|
2446
2358
|
r8 = nil
|
|
2447
2359
|
end
|
|
2448
2360
|
if r8
|
|
2449
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2450
2361
|
r0 = r8
|
|
2451
2362
|
else
|
|
2452
|
-
if
|
|
2453
|
-
r9 = instantiate_node(MonthName,input, index...(index +
|
|
2454
|
-
@index +=
|
|
2363
|
+
if has_terminal?('sep', false, index)
|
|
2364
|
+
r9 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2365
|
+
@index += 3
|
|
2455
2366
|
else
|
|
2456
|
-
terminal_parse_failure('
|
|
2367
|
+
terminal_parse_failure('sep')
|
|
2457
2368
|
r9 = nil
|
|
2458
2369
|
end
|
|
2459
2370
|
if r9
|
|
2460
|
-
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
|
2461
2371
|
r0 = r9
|
|
2462
2372
|
else
|
|
2463
|
-
if
|
|
2464
|
-
r10 = instantiate_node(MonthName,input, index...(index +
|
|
2465
|
-
@index +=
|
|
2373
|
+
if has_terminal?('oct', false, index)
|
|
2374
|
+
r10 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2375
|
+
@index += 3
|
|
2466
2376
|
else
|
|
2467
|
-
terminal_parse_failure('
|
|
2377
|
+
terminal_parse_failure('oct')
|
|
2468
2378
|
r10 = nil
|
|
2469
2379
|
end
|
|
2470
2380
|
if r10
|
|
2471
|
-
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
|
2472
2381
|
r0 = r10
|
|
2473
2382
|
else
|
|
2474
|
-
if
|
|
2475
|
-
r11 = instantiate_node(MonthName,input, index...(index +
|
|
2476
|
-
@index +=
|
|
2383
|
+
if has_terminal?('nov', false, index)
|
|
2384
|
+
r11 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2385
|
+
@index += 3
|
|
2477
2386
|
else
|
|
2478
|
-
terminal_parse_failure('
|
|
2387
|
+
terminal_parse_failure('nov')
|
|
2479
2388
|
r11 = nil
|
|
2480
2389
|
end
|
|
2481
2390
|
if r11
|
|
2482
|
-
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
|
2483
2391
|
r0 = r11
|
|
2484
2392
|
else
|
|
2485
|
-
if
|
|
2486
|
-
r12 = instantiate_node(MonthName,input, index...(index +
|
|
2487
|
-
@index +=
|
|
2393
|
+
if has_terminal?('dec', false, index)
|
|
2394
|
+
r12 = instantiate_node(MonthName,input, index...(index + 3))
|
|
2395
|
+
@index += 3
|
|
2488
2396
|
else
|
|
2489
|
-
terminal_parse_failure('
|
|
2397
|
+
terminal_parse_failure('dec')
|
|
2490
2398
|
r12 = nil
|
|
2491
2399
|
end
|
|
2492
2400
|
if r12
|
|
2493
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2494
2401
|
r0 = r12
|
|
2495
2402
|
else
|
|
2496
2403
|
@index = i0
|
|
@@ -2521,29 +2428,27 @@ module Timing
|
|
|
2521
2428
|
if node_cache[:zone_offset].has_key?(index)
|
|
2522
2429
|
cached = node_cache[:zone_offset][index]
|
|
2523
2430
|
if cached
|
|
2524
|
-
|
|
2431
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2525
2432
|
@index = cached.interval.end
|
|
2526
2433
|
end
|
|
2527
2434
|
return cached
|
|
2528
2435
|
end
|
|
2529
2436
|
|
|
2530
2437
|
i0, s0 = index, []
|
|
2531
|
-
if has_terminal?(
|
|
2438
|
+
if has_terminal?('\G[+-]', true, index)
|
|
2532
2439
|
r1 = true
|
|
2533
2440
|
@index += 1
|
|
2534
2441
|
else
|
|
2535
|
-
terminal_parse_failure('[+-]')
|
|
2536
2442
|
r1 = nil
|
|
2537
2443
|
end
|
|
2538
2444
|
s0 << r1
|
|
2539
2445
|
if r1
|
|
2540
2446
|
s2, i2 = [], index
|
|
2541
2447
|
loop do
|
|
2542
|
-
if has_terminal?(
|
|
2448
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2543
2449
|
r3 = true
|
|
2544
2450
|
@index += 1
|
|
2545
2451
|
else
|
|
2546
|
-
terminal_parse_failure('[\\d]')
|
|
2547
2452
|
r3 = nil
|
|
2548
2453
|
end
|
|
2549
2454
|
if r3
|
|
@@ -2559,18 +2464,15 @@ module Timing
|
|
|
2559
2464
|
@index = i2
|
|
2560
2465
|
r2 = nil
|
|
2561
2466
|
else
|
|
2562
|
-
if s2.size < 2
|
|
2563
|
-
@terminal_failures.pop
|
|
2564
|
-
end
|
|
2565
2467
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
2566
2468
|
end
|
|
2567
2469
|
s0 << r2
|
|
2568
2470
|
if r2
|
|
2569
|
-
if
|
|
2570
|
-
r5 =
|
|
2571
|
-
@index +=
|
|
2471
|
+
if has_terminal?(':', false, index)
|
|
2472
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2473
|
+
@index += 1
|
|
2572
2474
|
else
|
|
2573
|
-
terminal_parse_failure('
|
|
2475
|
+
terminal_parse_failure(':')
|
|
2574
2476
|
r5 = nil
|
|
2575
2477
|
end
|
|
2576
2478
|
if r5
|
|
@@ -2582,11 +2484,10 @@ module Timing
|
|
|
2582
2484
|
if r4
|
|
2583
2485
|
s6, i6 = [], index
|
|
2584
2486
|
loop do
|
|
2585
|
-
if has_terminal?(
|
|
2487
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2586
2488
|
r7 = true
|
|
2587
2489
|
@index += 1
|
|
2588
2490
|
else
|
|
2589
|
-
terminal_parse_failure('[\\d]')
|
|
2590
2491
|
r7 = nil
|
|
2591
2492
|
end
|
|
2592
2493
|
if r7
|
|
@@ -2602,9 +2503,6 @@ module Timing
|
|
|
2602
2503
|
@index = i6
|
|
2603
2504
|
r6 = nil
|
|
2604
2505
|
else
|
|
2605
|
-
if s6.size < 2
|
|
2606
|
-
@terminal_failures.pop
|
|
2607
|
-
end
|
|
2608
2506
|
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
|
2609
2507
|
end
|
|
2610
2508
|
s0 << r6
|
|
@@ -2635,7 +2533,7 @@ module Timing
|
|
|
2635
2533
|
if node_cache[:hour_minute_second].has_key?(index)
|
|
2636
2534
|
cached = node_cache[:hour_minute_second][index]
|
|
2637
2535
|
if cached
|
|
2638
|
-
|
|
2536
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2639
2537
|
@index = cached.interval.end
|
|
2640
2538
|
end
|
|
2641
2539
|
return cached
|
|
@@ -2645,11 +2543,10 @@ module Timing
|
|
|
2645
2543
|
i1, s1 = index, []
|
|
2646
2544
|
s2, i2 = [], index
|
|
2647
2545
|
loop do
|
|
2648
|
-
if has_terminal?(
|
|
2546
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2649
2547
|
r3 = true
|
|
2650
2548
|
@index += 1
|
|
2651
2549
|
else
|
|
2652
|
-
terminal_parse_failure('[\\d]')
|
|
2653
2550
|
r3 = nil
|
|
2654
2551
|
end
|
|
2655
2552
|
if r3
|
|
@@ -2665,29 +2562,25 @@ module Timing
|
|
|
2665
2562
|
@index = i2
|
|
2666
2563
|
r2 = nil
|
|
2667
2564
|
else
|
|
2668
|
-
if s2.size < 2
|
|
2669
|
-
@terminal_failures.pop
|
|
2670
|
-
end
|
|
2671
2565
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
|
2672
2566
|
end
|
|
2673
2567
|
s1 << r2
|
|
2674
2568
|
if r2
|
|
2675
|
-
if
|
|
2676
|
-
r4 =
|
|
2677
|
-
@index +=
|
|
2569
|
+
if has_terminal?(':', false, index)
|
|
2570
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2571
|
+
@index += 1
|
|
2678
2572
|
else
|
|
2679
|
-
terminal_parse_failure('
|
|
2573
|
+
terminal_parse_failure(':')
|
|
2680
2574
|
r4 = nil
|
|
2681
2575
|
end
|
|
2682
2576
|
s1 << r4
|
|
2683
2577
|
if r4
|
|
2684
2578
|
s5, i5 = [], index
|
|
2685
2579
|
loop do
|
|
2686
|
-
if has_terminal?(
|
|
2580
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2687
2581
|
r6 = true
|
|
2688
2582
|
@index += 1
|
|
2689
2583
|
else
|
|
2690
|
-
terminal_parse_failure('[\\d]')
|
|
2691
2584
|
r6 = nil
|
|
2692
2585
|
end
|
|
2693
2586
|
if r6
|
|
@@ -2703,30 +2596,26 @@ module Timing
|
|
|
2703
2596
|
@index = i5
|
|
2704
2597
|
r5 = nil
|
|
2705
2598
|
else
|
|
2706
|
-
if s5.size < 2
|
|
2707
|
-
@terminal_failures.pop
|
|
2708
|
-
end
|
|
2709
2599
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
2710
2600
|
end
|
|
2711
2601
|
s1 << r5
|
|
2712
2602
|
if r5
|
|
2713
2603
|
i8, s8 = index, []
|
|
2714
|
-
if
|
|
2715
|
-
r9 =
|
|
2716
|
-
@index +=
|
|
2604
|
+
if has_terminal?(':', false, index)
|
|
2605
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2606
|
+
@index += 1
|
|
2717
2607
|
else
|
|
2718
|
-
terminal_parse_failure('
|
|
2608
|
+
terminal_parse_failure(':')
|
|
2719
2609
|
r9 = nil
|
|
2720
2610
|
end
|
|
2721
2611
|
s8 << r9
|
|
2722
2612
|
if r9
|
|
2723
2613
|
s10, i10 = [], index
|
|
2724
2614
|
loop do
|
|
2725
|
-
if has_terminal?(
|
|
2615
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2726
2616
|
r11 = true
|
|
2727
2617
|
@index += 1
|
|
2728
2618
|
else
|
|
2729
|
-
terminal_parse_failure('[\\d]')
|
|
2730
2619
|
r11 = nil
|
|
2731
2620
|
end
|
|
2732
2621
|
if r11
|
|
@@ -2742,9 +2631,6 @@ module Timing
|
|
|
2742
2631
|
@index = i10
|
|
2743
2632
|
r10 = nil
|
|
2744
2633
|
else
|
|
2745
|
-
if s10.size < 2
|
|
2746
|
-
@terminal_failures.pop
|
|
2747
|
-
end
|
|
2748
2634
|
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
|
2749
2635
|
end
|
|
2750
2636
|
s8 << r10
|
|
@@ -2773,29 +2659,26 @@ module Timing
|
|
|
2773
2659
|
r1 = nil
|
|
2774
2660
|
end
|
|
2775
2661
|
if r1
|
|
2776
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2777
2662
|
r0 = r1
|
|
2778
2663
|
else
|
|
2779
|
-
if
|
|
2780
|
-
r12 = instantiate_node(HourMinuteSecond,input, index...(index +
|
|
2781
|
-
@index +=
|
|
2664
|
+
if has_terminal?('beginning', false, index)
|
|
2665
|
+
r12 = instantiate_node(HourMinuteSecond,input, index...(index + 9))
|
|
2666
|
+
@index += 9
|
|
2782
2667
|
else
|
|
2783
|
-
terminal_parse_failure('
|
|
2668
|
+
terminal_parse_failure('beginning')
|
|
2784
2669
|
r12 = nil
|
|
2785
2670
|
end
|
|
2786
2671
|
if r12
|
|
2787
|
-
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
|
2788
2672
|
r0 = r12
|
|
2789
2673
|
else
|
|
2790
|
-
if
|
|
2791
|
-
r13 = instantiate_node(HourMinuteSecond,input, index...(index +
|
|
2792
|
-
@index +=
|
|
2674
|
+
if has_terminal?('end', false, index)
|
|
2675
|
+
r13 = instantiate_node(HourMinuteSecond,input, index...(index + 3))
|
|
2676
|
+
@index += 3
|
|
2793
2677
|
else
|
|
2794
|
-
terminal_parse_failure('
|
|
2678
|
+
terminal_parse_failure('end')
|
|
2795
2679
|
r13 = nil
|
|
2796
2680
|
end
|
|
2797
2681
|
if r13
|
|
2798
|
-
r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true
|
|
2799
2682
|
r0 = r13
|
|
2800
2683
|
else
|
|
2801
2684
|
@index = i0
|
|
@@ -2814,7 +2697,7 @@ module Timing
|
|
|
2814
2697
|
if node_cache[:integer].has_key?(index)
|
|
2815
2698
|
cached = node_cache[:integer][index]
|
|
2816
2699
|
if cached
|
|
2817
|
-
|
|
2700
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2818
2701
|
@index = cached.interval.end
|
|
2819
2702
|
end
|
|
2820
2703
|
return cached
|
|
@@ -2822,11 +2705,10 @@ module Timing
|
|
|
2822
2705
|
|
|
2823
2706
|
s0, i0 = [], index
|
|
2824
2707
|
loop do
|
|
2825
|
-
if has_terminal?(
|
|
2708
|
+
if has_terminal?('\G[\\d]', true, index)
|
|
2826
2709
|
r1 = true
|
|
2827
2710
|
@index += 1
|
|
2828
2711
|
else
|
|
2829
|
-
terminal_parse_failure('[\\d]')
|
|
2830
2712
|
r1 = nil
|
|
2831
2713
|
end
|
|
2832
2714
|
if r1
|
|
@@ -2852,17 +2734,16 @@ module Timing
|
|
|
2852
2734
|
if node_cache[:space].has_key?(index)
|
|
2853
2735
|
cached = node_cache[:space][index]
|
|
2854
2736
|
if cached
|
|
2855
|
-
|
|
2737
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
|
2856
2738
|
@index = cached.interval.end
|
|
2857
2739
|
end
|
|
2858
2740
|
return cached
|
|
2859
2741
|
end
|
|
2860
2742
|
|
|
2861
|
-
if has_terminal?(
|
|
2743
|
+
if has_terminal?('\G[\\s\\t\\n]', true, index)
|
|
2862
2744
|
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
|
2863
2745
|
@index += 1
|
|
2864
2746
|
else
|
|
2865
|
-
terminal_parse_failure('[\\s\\t\\n]')
|
|
2866
2747
|
r0 = nil
|
|
2867
2748
|
end
|
|
2868
2749
|
|