fig 1.22.0 → 1.22.1.beta.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/Changes +13 -0
- data/lib/fig.rb +1 -1
- data/lib/fig/command/options.rb +21 -7
- data/lib/fig/grammar/base.rb +19 -14
- data/lib/fig/grammar/v0.rb +100 -78
- data/lib/fig/grammar/v1.rb +7 -2
- data/lib/fig/grammar/v1_base.rb +147 -113
- data/lib/fig/grammar/v2.rb +49 -33
- data/lib/fig/grammar/version.rb +9 -8
- data/lib/fig/grammar/version_identification.rb +2 -2
- data/lib/fig/protocol/netrc_enabled.rb +18 -5
- metadata +4 -4
data/lib/fig/grammar/v1.rb
CHANGED
@@ -56,7 +56,7 @@ module Fig
|
|
56
56
|
if node_cache[:package].has_key?(index)
|
57
57
|
cached = node_cache[:package][index]
|
58
58
|
if cached
|
59
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
59
|
+
node_cache[:package][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
60
60
|
@index = cached.interval.end
|
61
61
|
end
|
62
62
|
return cached
|
@@ -110,7 +110,7 @@ module Fig
|
|
110
110
|
if node_cache[:config_statement].has_key?(index)
|
111
111
|
cached = node_cache[:config_statement][index]
|
112
112
|
if cached
|
113
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
113
|
+
node_cache[:config_statement][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
114
114
|
@index = cached.interval.end
|
115
115
|
end
|
116
116
|
return cached
|
@@ -119,22 +119,27 @@ module Fig
|
|
119
119
|
i0 = index
|
120
120
|
r1 = _nt_override
|
121
121
|
if r1
|
122
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
122
123
|
r0 = r1
|
123
124
|
else
|
124
125
|
r2 = _nt_include
|
125
126
|
if r2
|
127
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
126
128
|
r0 = r2
|
127
129
|
else
|
128
130
|
r3 = _nt_command
|
129
131
|
if r3
|
132
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
130
133
|
r0 = r3
|
131
134
|
else
|
132
135
|
r4 = _nt_path
|
133
136
|
if r4
|
137
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
134
138
|
r0 = r4
|
135
139
|
else
|
136
140
|
r5 = _nt_set
|
137
141
|
if r5
|
142
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
138
143
|
r0 = r5
|
139
144
|
else
|
140
145
|
@index = i0
|
data/lib/fig/grammar/v1_base.rb
CHANGED
@@ -45,7 +45,7 @@ module Fig
|
|
45
45
|
if node_cache[:package_statement_with_ws].has_key?(index)
|
46
46
|
cached = node_cache[:package_statement_with_ws][index]
|
47
47
|
if cached
|
48
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
48
|
+
node_cache[:package_statement_with_ws][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
49
49
|
@index = cached.interval.end
|
50
50
|
end
|
51
51
|
return cached
|
@@ -91,7 +91,7 @@ module Fig
|
|
91
91
|
if node_cache[:package_statement].has_key?(index)
|
92
92
|
cached = node_cache[:package_statement][index]
|
93
93
|
if cached
|
94
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
94
|
+
node_cache[:package_statement][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
95
95
|
@index = cached.interval.end
|
96
96
|
end
|
97
97
|
return cached
|
@@ -100,18 +100,22 @@ module Fig
|
|
100
100
|
i0 = index
|
101
101
|
r1 = _nt_archive
|
102
102
|
if r1
|
103
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
103
104
|
r0 = r1
|
104
105
|
else
|
105
106
|
r2 = _nt_resource
|
106
107
|
if r2
|
108
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
107
109
|
r0 = r2
|
108
110
|
else
|
109
111
|
r3 = _nt_retrieve
|
110
112
|
if r3
|
113
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
111
114
|
r0 = r3
|
112
115
|
else
|
113
116
|
r4 = _nt_config
|
114
117
|
if r4
|
118
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
115
119
|
r0 = r4
|
116
120
|
else
|
117
121
|
@index = i0
|
@@ -149,16 +153,16 @@ module Fig
|
|
149
153
|
if node_cache[:archive].has_key?(index)
|
150
154
|
cached = node_cache[:archive][index]
|
151
155
|
if cached
|
152
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
156
|
+
node_cache[:archive][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
153
157
|
@index = cached.interval.end
|
154
158
|
end
|
155
159
|
return cached
|
156
160
|
end
|
157
161
|
|
158
162
|
i0, s0 = index, []
|
159
|
-
if has_terminal?('archive', false, index)
|
160
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
161
|
-
@index +=
|
163
|
+
if (match_len = has_terminal?('archive', false, index))
|
164
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
165
|
+
@index += match_len
|
162
166
|
else
|
163
167
|
terminal_parse_failure('archive')
|
164
168
|
r1 = nil
|
@@ -223,16 +227,16 @@ module Fig
|
|
223
227
|
if node_cache[:resource].has_key?(index)
|
224
228
|
cached = node_cache[:resource][index]
|
225
229
|
if cached
|
226
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
230
|
+
node_cache[:resource][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
227
231
|
@index = cached.interval.end
|
228
232
|
end
|
229
233
|
return cached
|
230
234
|
end
|
231
235
|
|
232
236
|
i0, s0 = index, []
|
233
|
-
if has_terminal?('resource', false, index)
|
234
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
235
|
-
@index +=
|
237
|
+
if (match_len = has_terminal?('resource', false, index))
|
238
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
239
|
+
@index += match_len
|
236
240
|
else
|
237
241
|
terminal_parse_failure('resource')
|
238
242
|
r1 = nil
|
@@ -301,16 +305,16 @@ module Fig
|
|
301
305
|
if node_cache[:retrieve].has_key?(index)
|
302
306
|
cached = node_cache[:retrieve][index]
|
303
307
|
if cached
|
304
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
308
|
+
node_cache[:retrieve][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
305
309
|
@index = cached.interval.end
|
306
310
|
end
|
307
311
|
return cached
|
308
312
|
end
|
309
313
|
|
310
314
|
i0, s0 = index, []
|
311
|
-
if has_terminal?('retrieve', false, index)
|
312
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
313
|
-
@index +=
|
315
|
+
if (match_len = has_terminal?('retrieve', false, index))
|
316
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
317
|
+
@index += match_len
|
314
318
|
else
|
315
319
|
terminal_parse_failure('retrieve')
|
316
320
|
r1 = nil
|
@@ -337,9 +341,9 @@ module Fig
|
|
337
341
|
r4 = _nt_environment_variable_name
|
338
342
|
s0 << r4
|
339
343
|
if r4
|
340
|
-
if has_terminal?('->', false, index)
|
341
|
-
r5 = instantiate_node(SyntaxNode,input, index...(index +
|
342
|
-
@index +=
|
344
|
+
if (match_len = has_terminal?('->', false, index))
|
345
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
346
|
+
@index += match_len
|
343
347
|
else
|
344
348
|
terminal_parse_failure('->')
|
345
349
|
r5 = nil
|
@@ -394,16 +398,16 @@ module Fig
|
|
394
398
|
if node_cache[:config].has_key?(index)
|
395
399
|
cached = node_cache[:config][index]
|
396
400
|
if cached
|
397
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
401
|
+
node_cache[:config][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
398
402
|
@index = cached.interval.end
|
399
403
|
end
|
400
404
|
return cached
|
401
405
|
end
|
402
406
|
|
403
407
|
i0, s0 = index, []
|
404
|
-
if has_terminal?('config', false, index)
|
405
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
406
|
-
@index +=
|
408
|
+
if (match_len = has_terminal?('config', false, index))
|
409
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
410
|
+
@index += match_len
|
407
411
|
else
|
408
412
|
terminal_parse_failure('config')
|
409
413
|
r1 = nil
|
@@ -459,9 +463,9 @@ module Fig
|
|
459
463
|
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
460
464
|
s0 << r7
|
461
465
|
if r7
|
462
|
-
if has_terminal?('end', false, index)
|
463
|
-
r9 = instantiate_node(SyntaxNode,input, index...(index +
|
464
|
-
@index +=
|
466
|
+
if (match_len = has_terminal?('end', false, index))
|
467
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
468
|
+
@index += match_len
|
465
469
|
else
|
466
470
|
terminal_parse_failure('end')
|
467
471
|
r9 = nil
|
@@ -504,7 +508,7 @@ module Fig
|
|
504
508
|
if node_cache[:config_statement_with_ws].has_key?(index)
|
505
509
|
cached = node_cache[:config_statement_with_ws][index]
|
506
510
|
if cached
|
507
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
511
|
+
node_cache[:config_statement_with_ws][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
508
512
|
@index = cached.interval.end
|
509
513
|
end
|
510
514
|
return cached
|
@@ -568,16 +572,16 @@ module Fig
|
|
568
572
|
if node_cache[:include].has_key?(index)
|
569
573
|
cached = node_cache[:include][index]
|
570
574
|
if cached
|
571
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
575
|
+
node_cache[:include][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
572
576
|
@index = cached.interval.end
|
573
577
|
end
|
574
578
|
return cached
|
575
579
|
end
|
576
580
|
|
577
581
|
i0, s0 = index, []
|
578
|
-
if has_terminal?('include', false, index)
|
579
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
580
|
-
@index +=
|
582
|
+
if (match_len = has_terminal?('include', false, index))
|
583
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
584
|
+
@index += match_len
|
581
585
|
else
|
582
586
|
terminal_parse_failure('include')
|
583
587
|
r1 = nil
|
@@ -642,16 +646,16 @@ module Fig
|
|
642
646
|
if node_cache[:override].has_key?(index)
|
643
647
|
cached = node_cache[:override][index]
|
644
648
|
if cached
|
645
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
649
|
+
node_cache[:override][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
646
650
|
@index = cached.interval.end
|
647
651
|
end
|
648
652
|
return cached
|
649
653
|
end
|
650
654
|
|
651
655
|
i0, s0 = index, []
|
652
|
-
if has_terminal?('override', false, index)
|
653
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
654
|
-
@index +=
|
656
|
+
if (match_len = has_terminal?('override', false, index))
|
657
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
658
|
+
@index += match_len
|
655
659
|
else
|
656
660
|
terminal_parse_failure('override')
|
657
661
|
r1 = nil
|
@@ -716,16 +720,16 @@ module Fig
|
|
716
720
|
if node_cache[:set].has_key?(index)
|
717
721
|
cached = node_cache[:set][index]
|
718
722
|
if cached
|
719
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
723
|
+
node_cache[:set][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
720
724
|
@index = cached.interval.end
|
721
725
|
end
|
722
726
|
return cached
|
723
727
|
end
|
724
728
|
|
725
729
|
i0, s0 = index, []
|
726
|
-
if has_terminal?('set', false, index)
|
727
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
728
|
-
@index +=
|
730
|
+
if (match_len = has_terminal?('set', false, index))
|
731
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
732
|
+
@index += match_len
|
729
733
|
else
|
730
734
|
terminal_parse_failure('set')
|
731
735
|
r1 = nil
|
@@ -790,7 +794,7 @@ module Fig
|
|
790
794
|
if node_cache[:path].has_key?(index)
|
791
795
|
cached = node_cache[:path][index]
|
792
796
|
if cached
|
793
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
797
|
+
node_cache[:path][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
794
798
|
@index = cached.interval.end
|
795
799
|
end
|
796
800
|
return cached
|
@@ -798,34 +802,37 @@ module Fig
|
|
798
802
|
|
799
803
|
i0, s0 = index, []
|
800
804
|
i1 = index
|
801
|
-
if has_terminal?('add', false, index)
|
802
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index +
|
803
|
-
@index +=
|
805
|
+
if (match_len = has_terminal?('add', false, index))
|
806
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
807
|
+
@index += match_len
|
804
808
|
else
|
805
809
|
terminal_parse_failure('add')
|
806
810
|
r2 = nil
|
807
811
|
end
|
808
812
|
if r2
|
813
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
809
814
|
r1 = r2
|
810
815
|
else
|
811
|
-
if has_terminal?('append', false, index)
|
812
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index +
|
813
|
-
@index +=
|
816
|
+
if (match_len = has_terminal?('append', false, index))
|
817
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
818
|
+
@index += match_len
|
814
819
|
else
|
815
820
|
terminal_parse_failure('append')
|
816
821
|
r3 = nil
|
817
822
|
end
|
818
823
|
if r3
|
824
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
819
825
|
r1 = r3
|
820
826
|
else
|
821
|
-
if has_terminal?('path', false, index)
|
822
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index +
|
823
|
-
@index +=
|
827
|
+
if (match_len = has_terminal?('path', false, index))
|
828
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
829
|
+
@index += match_len
|
824
830
|
else
|
825
831
|
terminal_parse_failure('path')
|
826
832
|
r4 = nil
|
827
833
|
end
|
828
834
|
if r4
|
835
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
829
836
|
r1 = r4
|
830
837
|
else
|
831
838
|
@index = i1
|
@@ -910,16 +917,16 @@ module Fig
|
|
910
917
|
if node_cache[:command].has_key?(index)
|
911
918
|
cached = node_cache[:command][index]
|
912
919
|
if cached
|
913
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
920
|
+
node_cache[:command][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
914
921
|
@index = cached.interval.end
|
915
922
|
end
|
916
923
|
return cached
|
917
924
|
end
|
918
925
|
|
919
926
|
i0, s0 = index, []
|
920
|
-
if has_terminal?('command', false, index)
|
921
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index +
|
922
|
-
@index +=
|
927
|
+
if (match_len = has_terminal?('command', false, index))
|
928
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
929
|
+
@index += match_len
|
923
930
|
else
|
924
931
|
terminal_parse_failure('command')
|
925
932
|
r1 = nil
|
@@ -963,9 +970,9 @@ module Fig
|
|
963
970
|
end
|
964
971
|
s0 << r5
|
965
972
|
if r5
|
966
|
-
if has_terminal?('end', false, index)
|
967
|
-
r7 = instantiate_node(SyntaxNode,input, index...(index +
|
968
|
-
@index +=
|
973
|
+
if (match_len = has_terminal?('end', false, index))
|
974
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
975
|
+
@index += match_len
|
969
976
|
else
|
970
977
|
terminal_parse_failure('end')
|
971
978
|
r7 = nil
|
@@ -1008,7 +1015,7 @@ module Fig
|
|
1008
1015
|
if node_cache[:command_line].has_key?(index)
|
1009
1016
|
cached = node_cache[:command_line][index]
|
1010
1017
|
if cached
|
1011
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1018
|
+
node_cache[:command_line][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1012
1019
|
@index = cached.interval.end
|
1013
1020
|
end
|
1014
1021
|
return cached
|
@@ -1097,7 +1104,7 @@ module Fig
|
|
1097
1104
|
if node_cache[:descriptor_string].has_key?(index)
|
1098
1105
|
cached = node_cache[:descriptor_string][index]
|
1099
1106
|
if cached
|
1100
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1107
|
+
node_cache[:descriptor_string][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1101
1108
|
@index = cached.interval.end
|
1102
1109
|
end
|
1103
1110
|
return cached
|
@@ -1105,10 +1112,11 @@ module Fig
|
|
1105
1112
|
|
1106
1113
|
s0, i0 = [], index
|
1107
1114
|
loop do
|
1108
|
-
if has_terminal?('\
|
1115
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#]'] ||= Regexp.new(gr), :regexp, index)
|
1109
1116
|
r1 = true
|
1110
1117
|
@index += 1
|
1111
1118
|
else
|
1119
|
+
terminal_parse_failure('[^\\s#]')
|
1112
1120
|
r1 = nil
|
1113
1121
|
end
|
1114
1122
|
if r1
|
@@ -1134,7 +1142,7 @@ module Fig
|
|
1134
1142
|
if node_cache[:config_name].has_key?(index)
|
1135
1143
|
cached = node_cache[:config_name][index]
|
1136
1144
|
if cached
|
1137
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1145
|
+
node_cache[:config_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1138
1146
|
@index = cached.interval.end
|
1139
1147
|
end
|
1140
1148
|
return cached
|
@@ -1142,10 +1150,11 @@ module Fig
|
|
1142
1150
|
|
1143
1151
|
s0, i0 = [], index
|
1144
1152
|
loop do
|
1145
|
-
if has_terminal?('\
|
1153
|
+
if has_terminal?(@regexps[gr = '\A[a-zA-Z0-9_.-]'] ||= Regexp.new(gr), :regexp, index)
|
1146
1154
|
r1 = true
|
1147
1155
|
@index += 1
|
1148
1156
|
else
|
1157
|
+
terminal_parse_failure('[a-zA-Z0-9_.-]')
|
1149
1158
|
r1 = nil
|
1150
1159
|
end
|
1151
1160
|
if r1
|
@@ -1195,7 +1204,7 @@ module Fig
|
|
1195
1204
|
if node_cache[:quoted_or_bare_string].has_key?(index)
|
1196
1205
|
cached = node_cache[:quoted_or_bare_string][index]
|
1197
1206
|
if cached
|
1198
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1207
|
+
node_cache[:quoted_or_bare_string][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1199
1208
|
@index = cached.interval.end
|
1200
1209
|
end
|
1201
1210
|
return cached
|
@@ -1205,10 +1214,11 @@ module Fig
|
|
1205
1214
|
i1, s1 = index, []
|
1206
1215
|
s2, i2 = [], index
|
1207
1216
|
loop do
|
1208
|
-
if has_terminal?('\
|
1217
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#\\\\"]'] ||= Regexp.new(gr), :regexp, index)
|
1209
1218
|
r3 = true
|
1210
1219
|
@index += 1
|
1211
1220
|
else
|
1221
|
+
terminal_parse_failure('[^\\s#\\\\"]')
|
1212
1222
|
r3 = nil
|
1213
1223
|
end
|
1214
1224
|
if r3
|
@@ -1220,9 +1230,9 @@ module Fig
|
|
1220
1230
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1221
1231
|
s1 << r2
|
1222
1232
|
if r2
|
1223
|
-
if has_terminal?('"', false, index)
|
1224
|
-
r4 =
|
1225
|
-
@index +=
|
1233
|
+
if (match_len = has_terminal?('"', false, index))
|
1234
|
+
r4 = true
|
1235
|
+
@index += match_len
|
1226
1236
|
else
|
1227
1237
|
terminal_parse_failure('"')
|
1228
1238
|
r4 = nil
|
@@ -1232,19 +1242,21 @@ module Fig
|
|
1232
1242
|
s5, i5 = [], index
|
1233
1243
|
loop do
|
1234
1244
|
i6 = index
|
1235
|
-
if has_terminal?('\
|
1245
|
+
if has_terminal?(@regexps[gr = '\A[^"\\\\]'] ||= Regexp.new(gr), :regexp, index)
|
1236
1246
|
r7 = true
|
1237
1247
|
@index += 1
|
1238
1248
|
else
|
1249
|
+
terminal_parse_failure('[^"\\\\]')
|
1239
1250
|
r7 = nil
|
1240
1251
|
end
|
1241
1252
|
if r7
|
1253
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
1242
1254
|
r6 = r7
|
1243
1255
|
else
|
1244
1256
|
i8, s8 = index, []
|
1245
|
-
if has_terminal?('\\', false, index)
|
1246
|
-
r9 =
|
1247
|
-
@index +=
|
1257
|
+
if (match_len = has_terminal?('\\', false, index))
|
1258
|
+
r9 = true
|
1259
|
+
@index += match_len
|
1248
1260
|
else
|
1249
1261
|
terminal_parse_failure('\\')
|
1250
1262
|
r9 = nil
|
@@ -1252,7 +1264,7 @@ module Fig
|
|
1252
1264
|
s8 << r9
|
1253
1265
|
if r9
|
1254
1266
|
if index < input_length
|
1255
|
-
r10 =
|
1267
|
+
r10 = true
|
1256
1268
|
@index += 1
|
1257
1269
|
else
|
1258
1270
|
terminal_parse_failure("any character")
|
@@ -1268,6 +1280,7 @@ module Fig
|
|
1268
1280
|
r8 = nil
|
1269
1281
|
end
|
1270
1282
|
if r8
|
1283
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
1271
1284
|
r6 = r8
|
1272
1285
|
else
|
1273
1286
|
@index = i6
|
@@ -1283,9 +1296,9 @@ module Fig
|
|
1283
1296
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1284
1297
|
s1 << r5
|
1285
1298
|
if r5
|
1286
|
-
if has_terminal?('"', false, index)
|
1287
|
-
r11 =
|
1288
|
-
@index +=
|
1299
|
+
if (match_len = has_terminal?('"', false, index))
|
1300
|
+
r11 = true
|
1301
|
+
@index += match_len
|
1289
1302
|
else
|
1290
1303
|
terminal_parse_failure('"')
|
1291
1304
|
r11 = nil
|
@@ -1303,15 +1316,17 @@ module Fig
|
|
1303
1316
|
r1 = nil
|
1304
1317
|
end
|
1305
1318
|
if r1
|
1319
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
1306
1320
|
r0 = r1
|
1307
1321
|
else
|
1308
1322
|
i12, s12 = index, []
|
1309
1323
|
s13, i13 = [], index
|
1310
1324
|
loop do
|
1311
|
-
if has_terminal?('\
|
1325
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#\\\\\']'] ||= Regexp.new(gr), :regexp, index)
|
1312
1326
|
r14 = true
|
1313
1327
|
@index += 1
|
1314
1328
|
else
|
1329
|
+
terminal_parse_failure('[^\\s#\\\\\']')
|
1315
1330
|
r14 = nil
|
1316
1331
|
end
|
1317
1332
|
if r14
|
@@ -1323,9 +1338,9 @@ module Fig
|
|
1323
1338
|
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
1324
1339
|
s12 << r13
|
1325
1340
|
if r13
|
1326
|
-
if has_terminal?("'", false, index)
|
1327
|
-
r15 =
|
1328
|
-
@index +=
|
1341
|
+
if (match_len = has_terminal?("'", false, index))
|
1342
|
+
r15 = true
|
1343
|
+
@index += match_len
|
1329
1344
|
else
|
1330
1345
|
terminal_parse_failure("'")
|
1331
1346
|
r15 = nil
|
@@ -1335,19 +1350,21 @@ module Fig
|
|
1335
1350
|
s16, i16 = [], index
|
1336
1351
|
loop do
|
1337
1352
|
i17 = index
|
1338
|
-
if has_terminal?('\
|
1353
|
+
if has_terminal?(@regexps[gr = '\A[^\'\\\\]'] ||= Regexp.new(gr), :regexp, index)
|
1339
1354
|
r18 = true
|
1340
1355
|
@index += 1
|
1341
1356
|
else
|
1357
|
+
terminal_parse_failure('[^\'\\\\]')
|
1342
1358
|
r18 = nil
|
1343
1359
|
end
|
1344
1360
|
if r18
|
1361
|
+
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
1345
1362
|
r17 = r18
|
1346
1363
|
else
|
1347
1364
|
i19, s19 = index, []
|
1348
|
-
if has_terminal?('\\', false, index)
|
1349
|
-
r20 =
|
1350
|
-
@index +=
|
1365
|
+
if (match_len = has_terminal?('\\', false, index))
|
1366
|
+
r20 = true
|
1367
|
+
@index += match_len
|
1351
1368
|
else
|
1352
1369
|
terminal_parse_failure('\\')
|
1353
1370
|
r20 = nil
|
@@ -1355,7 +1372,7 @@ module Fig
|
|
1355
1372
|
s19 << r20
|
1356
1373
|
if r20
|
1357
1374
|
if index < input_length
|
1358
|
-
r21 =
|
1375
|
+
r21 = true
|
1359
1376
|
@index += 1
|
1360
1377
|
else
|
1361
1378
|
terminal_parse_failure("any character")
|
@@ -1371,6 +1388,7 @@ module Fig
|
|
1371
1388
|
r19 = nil
|
1372
1389
|
end
|
1373
1390
|
if r19
|
1391
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
1374
1392
|
r17 = r19
|
1375
1393
|
else
|
1376
1394
|
@index = i17
|
@@ -1386,9 +1404,9 @@ module Fig
|
|
1386
1404
|
r16 = instantiate_node(SyntaxNode,input, i16...index, s16)
|
1387
1405
|
s12 << r16
|
1388
1406
|
if r16
|
1389
|
-
if has_terminal?("'", false, index)
|
1390
|
-
r22 =
|
1391
|
-
@index +=
|
1407
|
+
if (match_len = has_terminal?("'", false, index))
|
1408
|
+
r22 = true
|
1409
|
+
@index += match_len
|
1392
1410
|
else
|
1393
1411
|
terminal_parse_failure("'")
|
1394
1412
|
r22 = nil
|
@@ -1406,14 +1424,16 @@ module Fig
|
|
1406
1424
|
r12 = nil
|
1407
1425
|
end
|
1408
1426
|
if r12
|
1427
|
+
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
1409
1428
|
r0 = r12
|
1410
1429
|
else
|
1411
1430
|
s23, i23 = [], index
|
1412
1431
|
loop do
|
1413
|
-
if has_terminal?('\
|
1432
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#]'] ||= Regexp.new(gr), :regexp, index)
|
1414
1433
|
r24 = true
|
1415
1434
|
@index += 1
|
1416
1435
|
else
|
1436
|
+
terminal_parse_failure('[^\\s#]')
|
1417
1437
|
r24 = nil
|
1418
1438
|
end
|
1419
1439
|
if r24
|
@@ -1430,6 +1450,7 @@ module Fig
|
|
1430
1450
|
r23.extend(QuotedOrBareString6)
|
1431
1451
|
end
|
1432
1452
|
if r23
|
1453
|
+
r23 = SyntaxNode.new(input, (index-1)...index) if r23 == true
|
1433
1454
|
r0 = r23
|
1434
1455
|
else
|
1435
1456
|
@index = i0
|
@@ -1448,7 +1469,7 @@ module Fig
|
|
1448
1469
|
if node_cache[:environment_variable_name].has_key?(index)
|
1449
1470
|
cached = node_cache[:environment_variable_name][index]
|
1450
1471
|
if cached
|
1451
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1472
|
+
node_cache[:environment_variable_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1452
1473
|
@index = cached.interval.end
|
1453
1474
|
end
|
1454
1475
|
return cached
|
@@ -1456,10 +1477,11 @@ module Fig
|
|
1456
1477
|
|
1457
1478
|
s0, i0 = [], index
|
1458
1479
|
loop do
|
1459
|
-
if has_terminal?('\
|
1480
|
+
if has_terminal?(@regexps[gr = '\A[a-zA-Z0-9_]'] ||= Regexp.new(gr), :regexp, index)
|
1460
1481
|
r1 = true
|
1461
1482
|
@index += 1
|
1462
1483
|
else
|
1484
|
+
terminal_parse_failure('[a-zA-Z0-9_]')
|
1463
1485
|
r1 = nil
|
1464
1486
|
end
|
1465
1487
|
if r1
|
@@ -1497,7 +1519,7 @@ module Fig
|
|
1497
1519
|
if node_cache[:environment_variable_name_value].has_key?(index)
|
1498
1520
|
cached = node_cache[:environment_variable_name_value][index]
|
1499
1521
|
if cached
|
1500
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1522
|
+
node_cache[:environment_variable_name_value][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1501
1523
|
@index = cached.interval.end
|
1502
1524
|
end
|
1503
1525
|
return cached
|
@@ -1507,10 +1529,11 @@ module Fig
|
|
1507
1529
|
i1, s1 = index, []
|
1508
1530
|
s2, i2 = [], index
|
1509
1531
|
loop do
|
1510
|
-
if has_terminal?('\
|
1532
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#\\\\\'"]'] ||= Regexp.new(gr), :regexp, index)
|
1511
1533
|
r3 = true
|
1512
1534
|
@index += 1
|
1513
1535
|
else
|
1536
|
+
terminal_parse_failure('[^\\s#\\\\\'"]')
|
1514
1537
|
r3 = nil
|
1515
1538
|
end
|
1516
1539
|
if r3
|
@@ -1522,9 +1545,9 @@ module Fig
|
|
1522
1545
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1523
1546
|
s1 << r2
|
1524
1547
|
if r2
|
1525
|
-
if has_terminal?('"', false, index)
|
1526
|
-
r4 =
|
1527
|
-
@index +=
|
1548
|
+
if (match_len = has_terminal?('"', false, index))
|
1549
|
+
r4 = true
|
1550
|
+
@index += match_len
|
1528
1551
|
else
|
1529
1552
|
terminal_parse_failure('"')
|
1530
1553
|
r4 = nil
|
@@ -1534,19 +1557,21 @@ module Fig
|
|
1534
1557
|
s5, i5 = [], index
|
1535
1558
|
loop do
|
1536
1559
|
i6 = index
|
1537
|
-
if has_terminal?('\
|
1560
|
+
if has_terminal?(@regexps[gr = '\A[^"\\\\]'] ||= Regexp.new(gr), :regexp, index)
|
1538
1561
|
r7 = true
|
1539
1562
|
@index += 1
|
1540
1563
|
else
|
1564
|
+
terminal_parse_failure('[^"\\\\]')
|
1541
1565
|
r7 = nil
|
1542
1566
|
end
|
1543
1567
|
if r7
|
1568
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
1544
1569
|
r6 = r7
|
1545
1570
|
else
|
1546
1571
|
i8, s8 = index, []
|
1547
|
-
if has_terminal?('\\', false, index)
|
1548
|
-
r9 =
|
1549
|
-
@index +=
|
1572
|
+
if (match_len = has_terminal?('\\', false, index))
|
1573
|
+
r9 = true
|
1574
|
+
@index += match_len
|
1550
1575
|
else
|
1551
1576
|
terminal_parse_failure('\\')
|
1552
1577
|
r9 = nil
|
@@ -1554,7 +1579,7 @@ module Fig
|
|
1554
1579
|
s8 << r9
|
1555
1580
|
if r9
|
1556
1581
|
if index < input_length
|
1557
|
-
r10 =
|
1582
|
+
r10 = true
|
1558
1583
|
@index += 1
|
1559
1584
|
else
|
1560
1585
|
terminal_parse_failure("any character")
|
@@ -1570,6 +1595,7 @@ module Fig
|
|
1570
1595
|
r8 = nil
|
1571
1596
|
end
|
1572
1597
|
if r8
|
1598
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
1573
1599
|
r6 = r8
|
1574
1600
|
else
|
1575
1601
|
@index = i6
|
@@ -1585,9 +1611,9 @@ module Fig
|
|
1585
1611
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1586
1612
|
s1 << r5
|
1587
1613
|
if r5
|
1588
|
-
if has_terminal?('"', false, index)
|
1589
|
-
r11 =
|
1590
|
-
@index +=
|
1614
|
+
if (match_len = has_terminal?('"', false, index))
|
1615
|
+
r11 = true
|
1616
|
+
@index += match_len
|
1591
1617
|
else
|
1592
1618
|
terminal_parse_failure('"')
|
1593
1619
|
r11 = nil
|
@@ -1604,15 +1630,17 @@ module Fig
|
|
1604
1630
|
r1 = nil
|
1605
1631
|
end
|
1606
1632
|
if r1
|
1633
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
1607
1634
|
r0 = r1
|
1608
1635
|
else
|
1609
1636
|
i12, s12 = index, []
|
1610
1637
|
s13, i13 = [], index
|
1611
1638
|
loop do
|
1612
|
-
if has_terminal?('\
|
1639
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#\\\\\'"]'] ||= Regexp.new(gr), :regexp, index)
|
1613
1640
|
r14 = true
|
1614
1641
|
@index += 1
|
1615
1642
|
else
|
1643
|
+
terminal_parse_failure('[^\\s#\\\\\'"]')
|
1616
1644
|
r14 = nil
|
1617
1645
|
end
|
1618
1646
|
if r14
|
@@ -1624,9 +1652,9 @@ module Fig
|
|
1624
1652
|
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
1625
1653
|
s12 << r13
|
1626
1654
|
if r13
|
1627
|
-
if has_terminal?("'", false, index)
|
1628
|
-
r15 =
|
1629
|
-
@index +=
|
1655
|
+
if (match_len = has_terminal?("'", false, index))
|
1656
|
+
r15 = true
|
1657
|
+
@index += match_len
|
1630
1658
|
else
|
1631
1659
|
terminal_parse_failure("'")
|
1632
1660
|
r15 = nil
|
@@ -1636,19 +1664,21 @@ module Fig
|
|
1636
1664
|
s16, i16 = [], index
|
1637
1665
|
loop do
|
1638
1666
|
i17 = index
|
1639
|
-
if has_terminal?('\
|
1667
|
+
if has_terminal?(@regexps[gr = '\A[^\'\\\\]'] ||= Regexp.new(gr), :regexp, index)
|
1640
1668
|
r18 = true
|
1641
1669
|
@index += 1
|
1642
1670
|
else
|
1671
|
+
terminal_parse_failure('[^\'\\\\]')
|
1643
1672
|
r18 = nil
|
1644
1673
|
end
|
1645
1674
|
if r18
|
1675
|
+
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
1646
1676
|
r17 = r18
|
1647
1677
|
else
|
1648
1678
|
i19, s19 = index, []
|
1649
|
-
if has_terminal?('\\', false, index)
|
1650
|
-
r20 =
|
1651
|
-
@index +=
|
1679
|
+
if (match_len = has_terminal?('\\', false, index))
|
1680
|
+
r20 = true
|
1681
|
+
@index += match_len
|
1652
1682
|
else
|
1653
1683
|
terminal_parse_failure('\\')
|
1654
1684
|
r20 = nil
|
@@ -1656,7 +1686,7 @@ module Fig
|
|
1656
1686
|
s19 << r20
|
1657
1687
|
if r20
|
1658
1688
|
if index < input_length
|
1659
|
-
r21 =
|
1689
|
+
r21 = true
|
1660
1690
|
@index += 1
|
1661
1691
|
else
|
1662
1692
|
terminal_parse_failure("any character")
|
@@ -1672,6 +1702,7 @@ module Fig
|
|
1672
1702
|
r19 = nil
|
1673
1703
|
end
|
1674
1704
|
if r19
|
1705
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
1675
1706
|
r17 = r19
|
1676
1707
|
else
|
1677
1708
|
@index = i17
|
@@ -1687,9 +1718,9 @@ module Fig
|
|
1687
1718
|
r16 = instantiate_node(SyntaxNode,input, i16...index, s16)
|
1688
1719
|
s12 << r16
|
1689
1720
|
if r16
|
1690
|
-
if has_terminal?("'", false, index)
|
1691
|
-
r22 =
|
1692
|
-
@index +=
|
1721
|
+
if (match_len = has_terminal?("'", false, index))
|
1722
|
+
r22 = true
|
1723
|
+
@index += match_len
|
1693
1724
|
else
|
1694
1725
|
terminal_parse_failure("'")
|
1695
1726
|
r22 = nil
|
@@ -1706,14 +1737,16 @@ module Fig
|
|
1706
1737
|
r12 = nil
|
1707
1738
|
end
|
1708
1739
|
if r12
|
1740
|
+
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
1709
1741
|
r0 = r12
|
1710
1742
|
else
|
1711
1743
|
s23, i23 = [], index
|
1712
1744
|
loop do
|
1713
|
-
if has_terminal?('\
|
1745
|
+
if has_terminal?(@regexps[gr = '\A[^\\s#]'] ||= Regexp.new(gr), :regexp, index)
|
1714
1746
|
r24 = true
|
1715
1747
|
@index += 1
|
1716
1748
|
else
|
1749
|
+
terminal_parse_failure('[^\\s#]')
|
1717
1750
|
r24 = nil
|
1718
1751
|
end
|
1719
1752
|
if r24
|
@@ -1729,6 +1762,7 @@ module Fig
|
|
1729
1762
|
r23 = instantiate_node(SyntaxNode,input, i23...index, s23)
|
1730
1763
|
end
|
1731
1764
|
if r23
|
1765
|
+
r23 = SyntaxNode.new(input, (index-1)...index) if r23 == true
|
1732
1766
|
r0 = r23
|
1733
1767
|
else
|
1734
1768
|
@index = i0
|