fig 0.1.81 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +87 -0
- data/lib/fig.rb +1 -1
- data/lib/fig/command.rb +5 -0
- data/lib/fig/command/action/dump_package_definition_for_command_line.rb +62 -0
- data/lib/fig/command/action/dump_package_definition_parsed.rb +19 -2
- data/lib/fig/command/action/list_local.rb +9 -1
- data/lib/fig/command/action/list_remote.rb +9 -1
- data/lib/fig/command/action/role/list_variables_in_a_tree.rb +1 -1
- data/lib/fig/command/action/run_command_line.rb +1 -1
- data/lib/fig/command/action/run_command_statement.rb +4 -2
- data/lib/fig/command/options.rb +50 -18
- data/lib/fig/command/options/parser.rb +16 -15
- data/lib/fig/command/package_applier.rb +5 -3
- data/lib/fig/grammar/v0.rb +287 -289
- data/lib/fig/grammar/v0.treetop +66 -42
- data/lib/fig/grammar/v1.rb +629 -533
- data/lib/fig/grammar/v1.treetop +102 -39
- data/lib/fig/grammar_monkey_patches.rb +21 -0
- data/lib/fig/operating_system.rb +53 -36
- data/lib/fig/package_descriptor.rb +1 -12
- data/lib/fig/parser.rb +8 -33
- data/lib/fig/parser_package_build_state.rb +92 -31
- data/lib/fig/repository_package_publisher.rb +2 -2
- data/lib/fig/runtime_environment.rb +54 -120
- data/lib/fig/statement.rb +6 -6
- data/lib/fig/statement/asset.rb +1 -13
- data/lib/fig/statement/command.rb +47 -0
- data/lib/fig/statement/environment_variable.rb +64 -3
- data/lib/fig/statement/grammar_version.rb +4 -0
- data/lib/fig/statement/include.rb +4 -0
- data/lib/fig/statement/override.rb +4 -0
- data/lib/fig/statement/path.rb +40 -16
- data/lib/fig/statement/retrieve.rb +61 -5
- data/lib/fig/statement/set.rb +16 -19
- data/lib/fig/string_tokenizer.rb +63 -25
- data/lib/fig/tokenized_string.rb +31 -5
- data/lib/fig/tokenized_string/plain_segment.rb +32 -2
- data/lib/fig/tokenized_string/token.rb +12 -0
- data/lib/fig/unparser.rb +27 -12
- data/lib/fig/unparser/v0.rb +4 -5
- data/lib/fig/unparser/v1.rb +43 -6
- data/lib/fig/url.rb +13 -0
- metadata +44 -42
@@ -5,6 +5,8 @@ module Fig; end
|
|
5
5
|
class Fig::Command; end
|
6
6
|
|
7
7
|
class Fig::Command::PackageApplier
|
8
|
+
attr_reader :synthetic_package_for_command_line
|
9
|
+
|
8
10
|
def initialize(
|
9
11
|
base_package,
|
10
12
|
environment,
|
@@ -37,10 +39,10 @@ class Fig::Command::PackageApplier
|
|
37
39
|
|
38
40
|
def apply_config_to_environment(ignore_base_config)
|
39
41
|
begin
|
42
|
+
@synthetic_package_for_command_line =
|
43
|
+
synthesize_package_for_command_line_options(ignore_base_config)
|
40
44
|
@environment.apply_config(
|
41
|
-
|
42
|
-
Fig::Package::DEFAULT_CONFIG,
|
43
|
-
nil
|
45
|
+
@synthetic_package_for_command_line, Fig::Package::DEFAULT_CONFIG, nil
|
44
46
|
)
|
45
47
|
rescue Fig::NoSuchPackageConfigError => exception
|
46
48
|
make_no_such_package_exception_descriptive(exception)
|
data/lib/fig/grammar/v0.rb
CHANGED
@@ -311,146 +311,12 @@ module Fig
|
|
311
311
|
r0
|
312
312
|
end
|
313
313
|
|
314
|
-
module AssetLocation0
|
315
|
-
def location
|
316
|
-
elements[0]
|
317
|
-
end
|
318
|
-
|
319
|
-
def ws
|
320
|
-
elements[1]
|
321
|
-
end
|
322
|
-
end
|
323
|
-
|
324
|
-
module AssetLocation1
|
325
|
-
def location
|
326
|
-
elements[1]
|
327
|
-
end
|
328
|
-
|
329
|
-
def ws
|
330
|
-
elements[3]
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
def _nt_asset_location
|
335
|
-
start_index = index
|
336
|
-
if node_cache[:asset_location].has_key?(index)
|
337
|
-
cached = node_cache[:asset_location][index]
|
338
|
-
if cached
|
339
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
340
|
-
@index = cached.interval.end
|
341
|
-
end
|
342
|
-
return cached
|
343
|
-
end
|
344
|
-
|
345
|
-
i0 = index
|
346
|
-
i1, s1 = index, []
|
347
|
-
s2, i2 = [], index
|
348
|
-
loop do
|
349
|
-
if has_terminal?('\G[^@\'"<>|\\s]', true, index)
|
350
|
-
r3 = true
|
351
|
-
@index += 1
|
352
|
-
else
|
353
|
-
r3 = nil
|
354
|
-
end
|
355
|
-
if r3
|
356
|
-
s2 << r3
|
357
|
-
else
|
358
|
-
break
|
359
|
-
end
|
360
|
-
end
|
361
|
-
if s2.empty?
|
362
|
-
@index = i2
|
363
|
-
r2 = nil
|
364
|
-
else
|
365
|
-
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
366
|
-
end
|
367
|
-
s1 << r2
|
368
|
-
if r2
|
369
|
-
r4 = _nt_ws
|
370
|
-
s1 << r4
|
371
|
-
end
|
372
|
-
if s1.last
|
373
|
-
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
374
|
-
r1.extend(AssetLocation0)
|
375
|
-
else
|
376
|
-
@index = i1
|
377
|
-
r1 = nil
|
378
|
-
end
|
379
|
-
if r1
|
380
|
-
r0 = r1
|
381
|
-
else
|
382
|
-
i5, s5 = index, []
|
383
|
-
if has_terminal?('"', false, index)
|
384
|
-
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
385
|
-
@index += 1
|
386
|
-
else
|
387
|
-
terminal_parse_failure('"')
|
388
|
-
r6 = nil
|
389
|
-
end
|
390
|
-
s5 << r6
|
391
|
-
if r6
|
392
|
-
s7, i7 = [], index
|
393
|
-
loop do
|
394
|
-
if has_terminal?('\G[^@\'"<>|*?\\[\\]{}\\s]', true, index)
|
395
|
-
r8 = true
|
396
|
-
@index += 1
|
397
|
-
else
|
398
|
-
r8 = nil
|
399
|
-
end
|
400
|
-
if r8
|
401
|
-
s7 << r8
|
402
|
-
else
|
403
|
-
break
|
404
|
-
end
|
405
|
-
end
|
406
|
-
if s7.empty?
|
407
|
-
@index = i7
|
408
|
-
r7 = nil
|
409
|
-
else
|
410
|
-
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
411
|
-
end
|
412
|
-
s5 << r7
|
413
|
-
if r7
|
414
|
-
if has_terminal?('"', false, index)
|
415
|
-
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
416
|
-
@index += 1
|
417
|
-
else
|
418
|
-
terminal_parse_failure('"')
|
419
|
-
r9 = nil
|
420
|
-
end
|
421
|
-
s5 << r9
|
422
|
-
if r9
|
423
|
-
r10 = _nt_ws
|
424
|
-
s5 << r10
|
425
|
-
end
|
426
|
-
end
|
427
|
-
end
|
428
|
-
if s5.last
|
429
|
-
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
430
|
-
r5.extend(AssetLocation1)
|
431
|
-
else
|
432
|
-
@index = i5
|
433
|
-
r5 = nil
|
434
|
-
end
|
435
|
-
if r5
|
436
|
-
r0 = r5
|
437
|
-
else
|
438
|
-
@index = i0
|
439
|
-
r0 = nil
|
440
|
-
end
|
441
|
-
end
|
442
|
-
|
443
|
-
node_cache[:asset_location][start_index] = r0
|
444
|
-
|
445
|
-
r0
|
446
|
-
end
|
447
|
-
|
448
314
|
module Retrieve0
|
449
315
|
def statement_start
|
450
316
|
elements[0]
|
451
317
|
end
|
452
318
|
|
453
|
-
def
|
319
|
+
def variable
|
454
320
|
elements[2]
|
455
321
|
end
|
456
322
|
|
@@ -462,7 +328,9 @@ module Fig
|
|
462
328
|
|
463
329
|
module Retrieve1
|
464
330
|
def to_package_statement(build_state)
|
465
|
-
return build_state.new_retrieve_statement(
|
331
|
+
return build_state.new_retrieve_statement(
|
332
|
+
statement_start, variable, path
|
333
|
+
)
|
466
334
|
end
|
467
335
|
end
|
468
336
|
|
@@ -554,43 +422,6 @@ module Fig
|
|
554
422
|
r0
|
555
423
|
end
|
556
424
|
|
557
|
-
def _nt_retrieve_path
|
558
|
-
start_index = index
|
559
|
-
if node_cache[:retrieve_path].has_key?(index)
|
560
|
-
cached = node_cache[:retrieve_path][index]
|
561
|
-
if cached
|
562
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
563
|
-
@index = cached.interval.end
|
564
|
-
end
|
565
|
-
return cached
|
566
|
-
end
|
567
|
-
|
568
|
-
s0, i0 = [], index
|
569
|
-
loop do
|
570
|
-
if has_terminal?('\G[a-zA-Z0-9_/.\\[\\]-]', true, index)
|
571
|
-
r1 = true
|
572
|
-
@index += 1
|
573
|
-
else
|
574
|
-
r1 = nil
|
575
|
-
end
|
576
|
-
if r1
|
577
|
-
s0 << r1
|
578
|
-
else
|
579
|
-
break
|
580
|
-
end
|
581
|
-
end
|
582
|
-
if s0.empty?
|
583
|
-
@index = i0
|
584
|
-
r0 = nil
|
585
|
-
else
|
586
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
587
|
-
end
|
588
|
-
|
589
|
-
node_cache[:retrieve_path][start_index] = r0
|
590
|
-
|
591
|
-
r0
|
592
|
-
end
|
593
|
-
|
594
425
|
module Config0
|
595
426
|
def statement_start
|
596
427
|
elements[0]
|
@@ -729,43 +560,6 @@ module Fig
|
|
729
560
|
r0
|
730
561
|
end
|
731
562
|
|
732
|
-
def _nt_config_name
|
733
|
-
start_index = index
|
734
|
-
if node_cache[:config_name].has_key?(index)
|
735
|
-
cached = node_cache[:config_name][index]
|
736
|
-
if cached
|
737
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
738
|
-
@index = cached.interval.end
|
739
|
-
end
|
740
|
-
return cached
|
741
|
-
end
|
742
|
-
|
743
|
-
s0, i0 = [], index
|
744
|
-
loop do
|
745
|
-
if has_terminal?('\G[a-zA-Z0-9_.-]', true, index)
|
746
|
-
r1 = true
|
747
|
-
@index += 1
|
748
|
-
else
|
749
|
-
r1 = nil
|
750
|
-
end
|
751
|
-
if r1
|
752
|
-
s0 << r1
|
753
|
-
else
|
754
|
-
break
|
755
|
-
end
|
756
|
-
end
|
757
|
-
if s0.empty?
|
758
|
-
@index = i0
|
759
|
-
r0 = nil
|
760
|
-
else
|
761
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
762
|
-
end
|
763
|
-
|
764
|
-
node_cache[:config_name][start_index] = r0
|
765
|
-
|
766
|
-
r0
|
767
|
-
end
|
768
|
-
|
769
563
|
def _nt_config_statement
|
770
564
|
start_index = index
|
771
565
|
if node_cache[:config_statement].has_key?(index)
|
@@ -997,43 +791,6 @@ module Fig
|
|
997
791
|
r0
|
998
792
|
end
|
999
793
|
|
1000
|
-
def _nt_environment_variable_name
|
1001
|
-
start_index = index
|
1002
|
-
if node_cache[:environment_variable_name].has_key?(index)
|
1003
|
-
cached = node_cache[:environment_variable_name][index]
|
1004
|
-
if cached
|
1005
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1006
|
-
@index = cached.interval.end
|
1007
|
-
end
|
1008
|
-
return cached
|
1009
|
-
end
|
1010
|
-
|
1011
|
-
s0, i0 = [], index
|
1012
|
-
loop do
|
1013
|
-
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
1014
|
-
r1 = true
|
1015
|
-
@index += 1
|
1016
|
-
else
|
1017
|
-
r1 = nil
|
1018
|
-
end
|
1019
|
-
if r1
|
1020
|
-
s0 << r1
|
1021
|
-
else
|
1022
|
-
break
|
1023
|
-
end
|
1024
|
-
end
|
1025
|
-
if s0.empty?
|
1026
|
-
@index = i0
|
1027
|
-
r0 = nil
|
1028
|
-
else
|
1029
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1030
|
-
end
|
1031
|
-
|
1032
|
-
node_cache[:environment_variable_name][start_index] = r0
|
1033
|
-
|
1034
|
-
r0
|
1035
|
-
end
|
1036
|
-
|
1037
794
|
module Set0
|
1038
795
|
def statement_start
|
1039
796
|
elements[0]
|
@@ -1249,43 +1006,6 @@ module Fig
|
|
1249
1006
|
r0
|
1250
1007
|
end
|
1251
1008
|
|
1252
|
-
def _nt_environment_variable_name_value
|
1253
|
-
start_index = index
|
1254
|
-
if node_cache[:environment_variable_name_value].has_key?(index)
|
1255
|
-
cached = node_cache[:environment_variable_name_value][index]
|
1256
|
-
if cached
|
1257
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1258
|
-
@index = cached.interval.end
|
1259
|
-
end
|
1260
|
-
return cached
|
1261
|
-
end
|
1262
|
-
|
1263
|
-
s0, i0 = [], index
|
1264
|
-
loop do
|
1265
|
-
if has_terminal?('\G[\\S]', true, index)
|
1266
|
-
r1 = true
|
1267
|
-
@index += 1
|
1268
|
-
else
|
1269
|
-
r1 = nil
|
1270
|
-
end
|
1271
|
-
if r1
|
1272
|
-
s0 << r1
|
1273
|
-
else
|
1274
|
-
break
|
1275
|
-
end
|
1276
|
-
end
|
1277
|
-
if s0.empty?
|
1278
|
-
@index = i0
|
1279
|
-
r0 = nil
|
1280
|
-
else
|
1281
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1282
|
-
end
|
1283
|
-
|
1284
|
-
node_cache[:environment_variable_name_value][start_index] = r0
|
1285
|
-
|
1286
|
-
r0
|
1287
|
-
end
|
1288
|
-
|
1289
1009
|
module Command0
|
1290
1010
|
def statement_start
|
1291
1011
|
elements[0]
|
@@ -1299,7 +1019,7 @@ module Fig
|
|
1299
1019
|
|
1300
1020
|
module Command1
|
1301
1021
|
def to_config_statement(build_state)
|
1302
|
-
return build_state.
|
1022
|
+
return build_state.new_v0_command_statement(
|
1303
1023
|
statement_start, command_line
|
1304
1024
|
)
|
1305
1025
|
end
|
@@ -1380,10 +1100,6 @@ module Fig
|
|
1380
1100
|
end
|
1381
1101
|
|
1382
1102
|
module CommandLine0
|
1383
|
-
def value
|
1384
|
-
elements[1]
|
1385
|
-
end
|
1386
|
-
|
1387
1103
|
end
|
1388
1104
|
|
1389
1105
|
def _nt_command_line
|
@@ -1484,6 +1200,288 @@ module Fig
|
|
1484
1200
|
r0
|
1485
1201
|
end
|
1486
1202
|
|
1203
|
+
def _nt_config_name
|
1204
|
+
start_index = index
|
1205
|
+
if node_cache[:config_name].has_key?(index)
|
1206
|
+
cached = node_cache[:config_name][index]
|
1207
|
+
if cached
|
1208
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1209
|
+
@index = cached.interval.end
|
1210
|
+
end
|
1211
|
+
return cached
|
1212
|
+
end
|
1213
|
+
|
1214
|
+
s0, i0 = [], index
|
1215
|
+
loop do
|
1216
|
+
if has_terminal?('\G[a-zA-Z0-9_.-]', true, index)
|
1217
|
+
r1 = true
|
1218
|
+
@index += 1
|
1219
|
+
else
|
1220
|
+
r1 = nil
|
1221
|
+
end
|
1222
|
+
if r1
|
1223
|
+
s0 << r1
|
1224
|
+
else
|
1225
|
+
break
|
1226
|
+
end
|
1227
|
+
end
|
1228
|
+
if s0.empty?
|
1229
|
+
@index = i0
|
1230
|
+
r0 = nil
|
1231
|
+
else
|
1232
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1233
|
+
end
|
1234
|
+
|
1235
|
+
node_cache[:config_name][start_index] = r0
|
1236
|
+
|
1237
|
+
r0
|
1238
|
+
end
|
1239
|
+
|
1240
|
+
def _nt_environment_variable_name
|
1241
|
+
start_index = index
|
1242
|
+
if node_cache[:environment_variable_name].has_key?(index)
|
1243
|
+
cached = node_cache[:environment_variable_name][index]
|
1244
|
+
if cached
|
1245
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1246
|
+
@index = cached.interval.end
|
1247
|
+
end
|
1248
|
+
return cached
|
1249
|
+
end
|
1250
|
+
|
1251
|
+
s0, i0 = [], index
|
1252
|
+
loop do
|
1253
|
+
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
1254
|
+
r1 = true
|
1255
|
+
@index += 1
|
1256
|
+
else
|
1257
|
+
r1 = nil
|
1258
|
+
end
|
1259
|
+
if r1
|
1260
|
+
s0 << r1
|
1261
|
+
else
|
1262
|
+
break
|
1263
|
+
end
|
1264
|
+
end
|
1265
|
+
if s0.empty?
|
1266
|
+
@index = i0
|
1267
|
+
r0 = nil
|
1268
|
+
else
|
1269
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1270
|
+
end
|
1271
|
+
|
1272
|
+
node_cache[:environment_variable_name][start_index] = r0
|
1273
|
+
|
1274
|
+
r0
|
1275
|
+
end
|
1276
|
+
|
1277
|
+
def _nt_environment_variable_name_value
|
1278
|
+
start_index = index
|
1279
|
+
if node_cache[:environment_variable_name_value].has_key?(index)
|
1280
|
+
cached = node_cache[:environment_variable_name_value][index]
|
1281
|
+
if cached
|
1282
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1283
|
+
@index = cached.interval.end
|
1284
|
+
end
|
1285
|
+
return cached
|
1286
|
+
end
|
1287
|
+
|
1288
|
+
s0, i0 = [], index
|
1289
|
+
loop do
|
1290
|
+
if has_terminal?('\G[\\S]', true, index)
|
1291
|
+
r1 = true
|
1292
|
+
@index += 1
|
1293
|
+
else
|
1294
|
+
r1 = nil
|
1295
|
+
end
|
1296
|
+
if r1
|
1297
|
+
s0 << r1
|
1298
|
+
else
|
1299
|
+
break
|
1300
|
+
end
|
1301
|
+
end
|
1302
|
+
if s0.empty?
|
1303
|
+
@index = i0
|
1304
|
+
r0 = nil
|
1305
|
+
else
|
1306
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
node_cache[:environment_variable_name_value][start_index] = r0
|
1310
|
+
|
1311
|
+
r0
|
1312
|
+
end
|
1313
|
+
|
1314
|
+
module AssetLocation0
|
1315
|
+
def location
|
1316
|
+
elements[0]
|
1317
|
+
end
|
1318
|
+
|
1319
|
+
def ws
|
1320
|
+
elements[1]
|
1321
|
+
end
|
1322
|
+
end
|
1323
|
+
|
1324
|
+
module AssetLocation1
|
1325
|
+
def location
|
1326
|
+
elements[1]
|
1327
|
+
end
|
1328
|
+
|
1329
|
+
def ws
|
1330
|
+
elements[3]
|
1331
|
+
end
|
1332
|
+
end
|
1333
|
+
|
1334
|
+
def _nt_asset_location
|
1335
|
+
start_index = index
|
1336
|
+
if node_cache[:asset_location].has_key?(index)
|
1337
|
+
cached = node_cache[:asset_location][index]
|
1338
|
+
if cached
|
1339
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1340
|
+
@index = cached.interval.end
|
1341
|
+
end
|
1342
|
+
return cached
|
1343
|
+
end
|
1344
|
+
|
1345
|
+
i0 = index
|
1346
|
+
i1, s1 = index, []
|
1347
|
+
s2, i2 = [], index
|
1348
|
+
loop do
|
1349
|
+
if has_terminal?('\G[^@\'"<>|\\s]', true, index)
|
1350
|
+
r3 = true
|
1351
|
+
@index += 1
|
1352
|
+
else
|
1353
|
+
r3 = nil
|
1354
|
+
end
|
1355
|
+
if r3
|
1356
|
+
s2 << r3
|
1357
|
+
else
|
1358
|
+
break
|
1359
|
+
end
|
1360
|
+
end
|
1361
|
+
if s2.empty?
|
1362
|
+
@index = i2
|
1363
|
+
r2 = nil
|
1364
|
+
else
|
1365
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1366
|
+
end
|
1367
|
+
s1 << r2
|
1368
|
+
if r2
|
1369
|
+
r4 = _nt_ws
|
1370
|
+
s1 << r4
|
1371
|
+
end
|
1372
|
+
if s1.last
|
1373
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1374
|
+
r1.extend(AssetLocation0)
|
1375
|
+
else
|
1376
|
+
@index = i1
|
1377
|
+
r1 = nil
|
1378
|
+
end
|
1379
|
+
if r1
|
1380
|
+
r0 = r1
|
1381
|
+
else
|
1382
|
+
i5, s5 = index, []
|
1383
|
+
if has_terminal?('"', false, index)
|
1384
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1385
|
+
@index += 1
|
1386
|
+
else
|
1387
|
+
terminal_parse_failure('"')
|
1388
|
+
r6 = nil
|
1389
|
+
end
|
1390
|
+
s5 << r6
|
1391
|
+
if r6
|
1392
|
+
s7, i7 = [], index
|
1393
|
+
loop do
|
1394
|
+
if has_terminal?('\G[^@\'"<>|*?\\[\\]{}\\s]', true, index)
|
1395
|
+
r8 = true
|
1396
|
+
@index += 1
|
1397
|
+
else
|
1398
|
+
r8 = nil
|
1399
|
+
end
|
1400
|
+
if r8
|
1401
|
+
s7 << r8
|
1402
|
+
else
|
1403
|
+
break
|
1404
|
+
end
|
1405
|
+
end
|
1406
|
+
if s7.empty?
|
1407
|
+
@index = i7
|
1408
|
+
r7 = nil
|
1409
|
+
else
|
1410
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
1411
|
+
end
|
1412
|
+
s5 << r7
|
1413
|
+
if r7
|
1414
|
+
if has_terminal?('"', false, index)
|
1415
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1416
|
+
@index += 1
|
1417
|
+
else
|
1418
|
+
terminal_parse_failure('"')
|
1419
|
+
r9 = nil
|
1420
|
+
end
|
1421
|
+
s5 << r9
|
1422
|
+
if r9
|
1423
|
+
r10 = _nt_ws
|
1424
|
+
s5 << r10
|
1425
|
+
end
|
1426
|
+
end
|
1427
|
+
end
|
1428
|
+
if s5.last
|
1429
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1430
|
+
r5.extend(AssetLocation1)
|
1431
|
+
else
|
1432
|
+
@index = i5
|
1433
|
+
r5 = nil
|
1434
|
+
end
|
1435
|
+
if r5
|
1436
|
+
r0 = r5
|
1437
|
+
else
|
1438
|
+
@index = i0
|
1439
|
+
r0 = nil
|
1440
|
+
end
|
1441
|
+
end
|
1442
|
+
|
1443
|
+
node_cache[:asset_location][start_index] = r0
|
1444
|
+
|
1445
|
+
r0
|
1446
|
+
end
|
1447
|
+
|
1448
|
+
def _nt_retrieve_path
|
1449
|
+
start_index = index
|
1450
|
+
if node_cache[:retrieve_path].has_key?(index)
|
1451
|
+
cached = node_cache[:retrieve_path][index]
|
1452
|
+
if cached
|
1453
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1454
|
+
@index = cached.interval.end
|
1455
|
+
end
|
1456
|
+
return cached
|
1457
|
+
end
|
1458
|
+
|
1459
|
+
s0, i0 = [], index
|
1460
|
+
loop do
|
1461
|
+
if has_terminal?('\G[a-zA-Z0-9_/.\\[\\]-]', true, index)
|
1462
|
+
r1 = true
|
1463
|
+
@index += 1
|
1464
|
+
else
|
1465
|
+
r1 = nil
|
1466
|
+
end
|
1467
|
+
if r1
|
1468
|
+
s0 << r1
|
1469
|
+
else
|
1470
|
+
break
|
1471
|
+
end
|
1472
|
+
end
|
1473
|
+
if s0.empty?
|
1474
|
+
@index = i0
|
1475
|
+
r0 = nil
|
1476
|
+
else
|
1477
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1478
|
+
end
|
1479
|
+
|
1480
|
+
node_cache[:retrieve_path][start_index] = r0
|
1481
|
+
|
1482
|
+
r0
|
1483
|
+
end
|
1484
|
+
|
1487
1485
|
end
|
1488
1486
|
|
1489
1487
|
class V0Parser < Treetop::Runtime::CompiledParser
|