fig 0.1.81 → 0.2.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.
- 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
data/lib/fig/grammar/v0.treetop
CHANGED
@@ -21,7 +21,12 @@ module Fig
|
|
21
21
|
include Fig::Grammar::Version
|
22
22
|
|
23
23
|
rule package
|
24
|
-
optional_ws
|
24
|
+
optional_ws
|
25
|
+
grammar_version:grammar_version?
|
26
|
+
ws*
|
27
|
+
statements:(package_statement*)
|
28
|
+
optional_ws
|
29
|
+
{
|
25
30
|
def to_package(directory, build_state)
|
26
31
|
return build_state.new_package_statement(
|
27
32
|
directory, grammar_version, statements
|
@@ -54,39 +59,29 @@ module Fig
|
|
54
59
|
}
|
55
60
|
end
|
56
61
|
|
57
|
-
rule asset_location
|
58
|
-
# Unquoted allows globbing for files, quoted does not.
|
59
|
-
#
|
60
|
-
# Unquoted, anything but:
|
61
|
-
# @ - To allow for package substitution
|
62
|
-
# ' - Future expansion
|
63
|
-
# "<>| - Characters not allowed in filenames on Windows
|
64
|
-
# \s - Necessary for the "ws" token to work
|
65
|
-
(location:[^@'"<>|\s]+ ws)
|
66
|
-
|
67
|
-
# Quoted, anything but:
|
68
|
-
# @ - To allow for package substitution
|
69
|
-
# ' - Future expansion
|
70
|
-
# "<>| - Characters not allowed in filenames on Windows
|
71
|
-
# *?\[\]{} - Characters significant to Dir.glob()
|
72
|
-
# \s - We just don't want these. :]
|
73
|
-
/ ('"' location:[^@'"<>|*?\[\]{}\s]+ '"' ws)
|
74
|
-
end
|
75
|
-
|
76
62
|
rule retrieve
|
77
|
-
statement_start:'retrieve'
|
63
|
+
statement_start:'retrieve'
|
64
|
+
ws+
|
65
|
+
variable:environment_variable_name '->' path:retrieve_path
|
66
|
+
ws+
|
67
|
+
{
|
78
68
|
def to_package_statement(build_state)
|
79
|
-
return build_state.new_retrieve_statement(
|
69
|
+
return build_state.new_retrieve_statement(
|
70
|
+
statement_start, variable, path
|
71
|
+
)
|
80
72
|
end
|
81
73
|
}
|
82
74
|
end
|
83
75
|
|
84
|
-
rule retrieve_path
|
85
|
-
[a-zA-Z0-9_/.\[\]-]+
|
86
|
-
end
|
87
|
-
|
88
76
|
rule config
|
89
|
-
statement_start:'config'
|
77
|
+
statement_start:'config'
|
78
|
+
ws+
|
79
|
+
config_name
|
80
|
+
ws+
|
81
|
+
statements:config_statement*
|
82
|
+
'end'
|
83
|
+
ws+
|
84
|
+
{
|
90
85
|
def to_package_statement(build_state)
|
91
86
|
return build_state.new_configuration_statement(
|
92
87
|
statement_start, config_name, statements
|
@@ -95,10 +90,6 @@ module Fig
|
|
95
90
|
}
|
96
91
|
end
|
97
92
|
|
98
|
-
rule config_name
|
99
|
-
[a-zA-Z0-9_.-]+
|
100
|
-
end
|
101
|
-
|
102
93
|
rule config_statement
|
103
94
|
override / include / command / path / set
|
104
95
|
end
|
@@ -123,10 +114,6 @@ module Fig
|
|
123
114
|
}
|
124
115
|
end
|
125
116
|
|
126
|
-
rule environment_variable_name
|
127
|
-
[a-zA-Z0-9_]+
|
128
|
-
end
|
129
|
-
|
130
117
|
rule set
|
131
118
|
statement_start:'set' ws+ environment_variable_name_value ws+ {
|
132
119
|
def to_config_statement(build_state)
|
@@ -138,7 +125,11 @@ module Fig
|
|
138
125
|
end
|
139
126
|
|
140
127
|
rule path
|
141
|
-
statement_start:('add' / 'append' / 'path')
|
128
|
+
statement_start:('add' / 'append' / 'path')
|
129
|
+
ws+
|
130
|
+
environment_variable_name_value
|
131
|
+
ws+
|
132
|
+
{
|
142
133
|
def to_config_statement(build_state)
|
143
134
|
return build_state.new_environment_variable_statement(
|
144
135
|
Statement::Path, statement_start, environment_variable_name_value
|
@@ -147,14 +138,10 @@ module Fig
|
|
147
138
|
}
|
148
139
|
end
|
149
140
|
|
150
|
-
rule environment_variable_name_value
|
151
|
-
[\S]+
|
152
|
-
end
|
153
|
-
|
154
141
|
rule command
|
155
142
|
statement_start:'command' ws+ command_line ws+ {
|
156
143
|
def to_config_statement(build_state)
|
157
|
-
return build_state.
|
144
|
+
return build_state.new_v0_command_statement(
|
158
145
|
statement_start, command_line
|
159
146
|
)
|
160
147
|
end
|
@@ -162,12 +149,49 @@ module Fig
|
|
162
149
|
end
|
163
150
|
|
164
151
|
rule command_line
|
165
|
-
'"'
|
152
|
+
'"' [^"]* '"'
|
166
153
|
end
|
167
154
|
|
155
|
+
# Terminals
|
156
|
+
|
168
157
|
rule descriptor_string
|
169
158
|
[\S]+
|
170
159
|
end
|
160
|
+
|
161
|
+
rule config_name
|
162
|
+
[a-zA-Z0-9_.-]+
|
163
|
+
end
|
164
|
+
|
165
|
+
rule environment_variable_name
|
166
|
+
[a-zA-Z0-9_]+
|
167
|
+
end
|
168
|
+
|
169
|
+
rule environment_variable_name_value
|
170
|
+
[\S]+
|
171
|
+
end
|
172
|
+
|
173
|
+
rule asset_location
|
174
|
+
# Unquoted allows globbing for files, quoted does not.
|
175
|
+
#
|
176
|
+
# Unquoted, anything but:
|
177
|
+
# @ - To allow for package substitution
|
178
|
+
# ' - Future expansion
|
179
|
+
# "<>| - Characters not allowed in filenames on Windows
|
180
|
+
# \s - Necessary for the "ws" token to work
|
181
|
+
(location:[^@'"<>|\s]+ ws)
|
182
|
+
|
183
|
+
# Quoted, anything but:
|
184
|
+
# @ - To allow for package substitution
|
185
|
+
# ' - Future expansion
|
186
|
+
# "<>| - Characters not allowed in filenames on Windows
|
187
|
+
# *?\[\]{} - Characters significant to Dir.glob()
|
188
|
+
# \s - We just don't want these. :]
|
189
|
+
/ ('"' location:[^@'"<>|*?\[\]{}\s]+ '"' ws)
|
190
|
+
end
|
191
|
+
|
192
|
+
rule retrieve_path
|
193
|
+
[a-zA-Z0-9_/.\[\]-]+
|
194
|
+
end
|
171
195
|
end
|
172
196
|
end
|
173
197
|
end
|
data/lib/fig/grammar/v1.rb
CHANGED
@@ -265,7 +265,7 @@ module Fig
|
|
265
265
|
end
|
266
266
|
s0 << r2
|
267
267
|
if r2
|
268
|
-
r4 =
|
268
|
+
r4 = _nt_quoted_or_bare_string
|
269
269
|
s0 << r4
|
270
270
|
end
|
271
271
|
end
|
@@ -339,7 +339,7 @@ module Fig
|
|
339
339
|
end
|
340
340
|
s0 << r2
|
341
341
|
if r2
|
342
|
-
r4 =
|
342
|
+
r4 = _nt_quoted_or_bare_string
|
343
343
|
s0 << r4
|
344
344
|
end
|
345
345
|
end
|
@@ -357,238 +357,12 @@ module Fig
|
|
357
357
|
r0
|
358
358
|
end
|
359
359
|
|
360
|
-
module AssetLocation0
|
361
|
-
end
|
362
|
-
|
363
|
-
module AssetLocation1
|
364
|
-
end
|
365
|
-
|
366
|
-
module AssetLocation2
|
367
|
-
end
|
368
|
-
|
369
|
-
module AssetLocation3
|
370
|
-
end
|
371
|
-
|
372
|
-
def _nt_asset_location
|
373
|
-
start_index = index
|
374
|
-
if node_cache[:asset_location].has_key?(index)
|
375
|
-
cached = node_cache[:asset_location][index]
|
376
|
-
if cached
|
377
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
378
|
-
@index = cached.interval.end
|
379
|
-
end
|
380
|
-
return cached
|
381
|
-
end
|
382
|
-
|
383
|
-
i0 = index
|
384
|
-
i1, s1 = index, []
|
385
|
-
if has_terminal?('"', false, index)
|
386
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
387
|
-
@index += 1
|
388
|
-
else
|
389
|
-
terminal_parse_failure('"')
|
390
|
-
r2 = nil
|
391
|
-
end
|
392
|
-
s1 << r2
|
393
|
-
if r2
|
394
|
-
s3, i3 = [], index
|
395
|
-
loop do
|
396
|
-
i4 = index
|
397
|
-
if has_terminal?('\G[^"\\\\]', true, index)
|
398
|
-
r5 = true
|
399
|
-
@index += 1
|
400
|
-
else
|
401
|
-
r5 = nil
|
402
|
-
end
|
403
|
-
if r5
|
404
|
-
r4 = r5
|
405
|
-
else
|
406
|
-
i6, s6 = index, []
|
407
|
-
if has_terminal?('\\', false, index)
|
408
|
-
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
409
|
-
@index += 1
|
410
|
-
else
|
411
|
-
terminal_parse_failure('\\')
|
412
|
-
r7 = nil
|
413
|
-
end
|
414
|
-
s6 << r7
|
415
|
-
if r7
|
416
|
-
if index < input_length
|
417
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
418
|
-
@index += 1
|
419
|
-
else
|
420
|
-
terminal_parse_failure("any character")
|
421
|
-
r8 = nil
|
422
|
-
end
|
423
|
-
s6 << r8
|
424
|
-
end
|
425
|
-
if s6.last
|
426
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
427
|
-
r6.extend(AssetLocation0)
|
428
|
-
else
|
429
|
-
@index = i6
|
430
|
-
r6 = nil
|
431
|
-
end
|
432
|
-
if r6
|
433
|
-
r4 = r6
|
434
|
-
else
|
435
|
-
@index = i4
|
436
|
-
r4 = nil
|
437
|
-
end
|
438
|
-
end
|
439
|
-
if r4
|
440
|
-
s3 << r4
|
441
|
-
else
|
442
|
-
break
|
443
|
-
end
|
444
|
-
end
|
445
|
-
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
446
|
-
s1 << r3
|
447
|
-
if r3
|
448
|
-
if has_terminal?('"', false, index)
|
449
|
-
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
450
|
-
@index += 1
|
451
|
-
else
|
452
|
-
terminal_parse_failure('"')
|
453
|
-
r9 = nil
|
454
|
-
end
|
455
|
-
s1 << r9
|
456
|
-
end
|
457
|
-
end
|
458
|
-
if s1.last
|
459
|
-
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
460
|
-
r1.extend(AssetLocation1)
|
461
|
-
else
|
462
|
-
@index = i1
|
463
|
-
r1 = nil
|
464
|
-
end
|
465
|
-
if r1
|
466
|
-
r0 = r1
|
467
|
-
else
|
468
|
-
i10, s10 = index, []
|
469
|
-
if has_terminal?("'", false, index)
|
470
|
-
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
471
|
-
@index += 1
|
472
|
-
else
|
473
|
-
terminal_parse_failure("'")
|
474
|
-
r11 = nil
|
475
|
-
end
|
476
|
-
s10 << r11
|
477
|
-
if r11
|
478
|
-
s12, i12 = [], index
|
479
|
-
loop do
|
480
|
-
i13 = index
|
481
|
-
if has_terminal?('\G[^\'\\\\]', true, index)
|
482
|
-
r14 = true
|
483
|
-
@index += 1
|
484
|
-
else
|
485
|
-
r14 = nil
|
486
|
-
end
|
487
|
-
if r14
|
488
|
-
r13 = r14
|
489
|
-
else
|
490
|
-
i15, s15 = index, []
|
491
|
-
if has_terminal?('\\', false, index)
|
492
|
-
r16 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
493
|
-
@index += 1
|
494
|
-
else
|
495
|
-
terminal_parse_failure('\\')
|
496
|
-
r16 = nil
|
497
|
-
end
|
498
|
-
s15 << r16
|
499
|
-
if r16
|
500
|
-
if index < input_length
|
501
|
-
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
502
|
-
@index += 1
|
503
|
-
else
|
504
|
-
terminal_parse_failure("any character")
|
505
|
-
r17 = nil
|
506
|
-
end
|
507
|
-
s15 << r17
|
508
|
-
end
|
509
|
-
if s15.last
|
510
|
-
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
511
|
-
r15.extend(AssetLocation2)
|
512
|
-
else
|
513
|
-
@index = i15
|
514
|
-
r15 = nil
|
515
|
-
end
|
516
|
-
if r15
|
517
|
-
r13 = r15
|
518
|
-
else
|
519
|
-
@index = i13
|
520
|
-
r13 = nil
|
521
|
-
end
|
522
|
-
end
|
523
|
-
if r13
|
524
|
-
s12 << r13
|
525
|
-
else
|
526
|
-
break
|
527
|
-
end
|
528
|
-
end
|
529
|
-
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
530
|
-
s10 << r12
|
531
|
-
if r12
|
532
|
-
if has_terminal?("'", false, index)
|
533
|
-
r18 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
534
|
-
@index += 1
|
535
|
-
else
|
536
|
-
terminal_parse_failure("'")
|
537
|
-
r18 = nil
|
538
|
-
end
|
539
|
-
s10 << r18
|
540
|
-
end
|
541
|
-
end
|
542
|
-
if s10.last
|
543
|
-
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
544
|
-
r10.extend(AssetLocation3)
|
545
|
-
else
|
546
|
-
@index = i10
|
547
|
-
r10 = nil
|
548
|
-
end
|
549
|
-
if r10
|
550
|
-
r0 = r10
|
551
|
-
else
|
552
|
-
s19, i19 = [], index
|
553
|
-
loop do
|
554
|
-
if has_terminal?('\G[^\\s#]', true, index)
|
555
|
-
r20 = true
|
556
|
-
@index += 1
|
557
|
-
else
|
558
|
-
r20 = nil
|
559
|
-
end
|
560
|
-
if r20
|
561
|
-
s19 << r20
|
562
|
-
else
|
563
|
-
break
|
564
|
-
end
|
565
|
-
end
|
566
|
-
if s19.empty?
|
567
|
-
@index = i19
|
568
|
-
r19 = nil
|
569
|
-
else
|
570
|
-
r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
|
571
|
-
end
|
572
|
-
if r19
|
573
|
-
r0 = r19
|
574
|
-
else
|
575
|
-
@index = i0
|
576
|
-
r0 = nil
|
577
|
-
end
|
578
|
-
end
|
579
|
-
end
|
580
|
-
|
581
|
-
node_cache[:asset_location][start_index] = r0
|
582
|
-
|
583
|
-
r0
|
584
|
-
end
|
585
|
-
|
586
360
|
module Retrieve0
|
587
361
|
def statement_start
|
588
362
|
elements[0]
|
589
363
|
end
|
590
364
|
|
591
|
-
def
|
365
|
+
def variable
|
592
366
|
elements[2]
|
593
367
|
end
|
594
368
|
|
@@ -599,7 +373,9 @@ module Fig
|
|
599
373
|
|
600
374
|
module Retrieve1
|
601
375
|
def to_package_statement(build_state)
|
602
|
-
return build_state.new_retrieve_statement(
|
376
|
+
return build_state.new_retrieve_statement(
|
377
|
+
statement_start, variable, path
|
378
|
+
)
|
603
379
|
end
|
604
380
|
end
|
605
381
|
|
@@ -653,7 +429,7 @@ module Fig
|
|
653
429
|
end
|
654
430
|
s0 << r5
|
655
431
|
if r5
|
656
|
-
r6 =
|
432
|
+
r6 = _nt_quoted_or_bare_string
|
657
433
|
s0 << r6
|
658
434
|
end
|
659
435
|
end
|
@@ -673,43 +449,6 @@ module Fig
|
|
673
449
|
r0
|
674
450
|
end
|
675
451
|
|
676
|
-
def _nt_retrieve_path
|
677
|
-
start_index = index
|
678
|
-
if node_cache[:retrieve_path].has_key?(index)
|
679
|
-
cached = node_cache[:retrieve_path][index]
|
680
|
-
if cached
|
681
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
682
|
-
@index = cached.interval.end
|
683
|
-
end
|
684
|
-
return cached
|
685
|
-
end
|
686
|
-
|
687
|
-
s0, i0 = [], index
|
688
|
-
loop do
|
689
|
-
if has_terminal?('\G[a-zA-Z0-9_/.\\[\\]-]', true, index)
|
690
|
-
r1 = true
|
691
|
-
@index += 1
|
692
|
-
else
|
693
|
-
r1 = nil
|
694
|
-
end
|
695
|
-
if r1
|
696
|
-
s0 << r1
|
697
|
-
else
|
698
|
-
break
|
699
|
-
end
|
700
|
-
end
|
701
|
-
if s0.empty?
|
702
|
-
@index = i0
|
703
|
-
r0 = nil
|
704
|
-
else
|
705
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
706
|
-
end
|
707
|
-
|
708
|
-
node_cache[:retrieve_path][start_index] = r0
|
709
|
-
|
710
|
-
r0
|
711
|
-
end
|
712
|
-
|
713
452
|
module Config0
|
714
453
|
def statement_start
|
715
454
|
elements[0]
|
@@ -830,43 +569,6 @@ module Fig
|
|
830
569
|
r0
|
831
570
|
end
|
832
571
|
|
833
|
-
def _nt_config_name
|
834
|
-
start_index = index
|
835
|
-
if node_cache[:config_name].has_key?(index)
|
836
|
-
cached = node_cache[:config_name][index]
|
837
|
-
if cached
|
838
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
839
|
-
@index = cached.interval.end
|
840
|
-
end
|
841
|
-
return cached
|
842
|
-
end
|
843
|
-
|
844
|
-
s0, i0 = [], index
|
845
|
-
loop do
|
846
|
-
if has_terminal?('\G[a-zA-Z0-9_.-]', true, index)
|
847
|
-
r1 = true
|
848
|
-
@index += 1
|
849
|
-
else
|
850
|
-
r1 = nil
|
851
|
-
end
|
852
|
-
if r1
|
853
|
-
s0 << r1
|
854
|
-
else
|
855
|
-
break
|
856
|
-
end
|
857
|
-
end
|
858
|
-
if s0.empty?
|
859
|
-
@index = i0
|
860
|
-
r0 = nil
|
861
|
-
else
|
862
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
863
|
-
end
|
864
|
-
|
865
|
-
node_cache[:config_name][start_index] = r0
|
866
|
-
|
867
|
-
r0
|
868
|
-
end
|
869
|
-
|
870
572
|
module ConfigStatementWithWs0
|
871
573
|
def config_statement
|
872
574
|
elements[0]
|
@@ -1119,43 +821,6 @@ module Fig
|
|
1119
821
|
r0
|
1120
822
|
end
|
1121
823
|
|
1122
|
-
def _nt_environment_variable_name
|
1123
|
-
start_index = index
|
1124
|
-
if node_cache[:environment_variable_name].has_key?(index)
|
1125
|
-
cached = node_cache[:environment_variable_name][index]
|
1126
|
-
if cached
|
1127
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1128
|
-
@index = cached.interval.end
|
1129
|
-
end
|
1130
|
-
return cached
|
1131
|
-
end
|
1132
|
-
|
1133
|
-
s0, i0 = [], index
|
1134
|
-
loop do
|
1135
|
-
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
1136
|
-
r1 = true
|
1137
|
-
@index += 1
|
1138
|
-
else
|
1139
|
-
r1 = nil
|
1140
|
-
end
|
1141
|
-
if r1
|
1142
|
-
s0 << r1
|
1143
|
-
else
|
1144
|
-
break
|
1145
|
-
end
|
1146
|
-
end
|
1147
|
-
if s0.empty?
|
1148
|
-
@index = i0
|
1149
|
-
r0 = nil
|
1150
|
-
else
|
1151
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1152
|
-
end
|
1153
|
-
|
1154
|
-
node_cache[:environment_variable_name][start_index] = r0
|
1155
|
-
|
1156
|
-
r0
|
1157
|
-
end
|
1158
|
-
|
1159
824
|
module Set0
|
1160
825
|
def statement_start
|
1161
826
|
elements[0]
|
@@ -1333,21 +998,631 @@ module Fig
|
|
1333
998
|
r0
|
1334
999
|
end
|
1335
1000
|
|
1336
|
-
module
|
1337
|
-
|
1001
|
+
module Command0
|
1002
|
+
def statement_start
|
1003
|
+
elements[0]
|
1004
|
+
end
|
1338
1005
|
|
1339
|
-
|
1340
|
-
|
1006
|
+
def command_line
|
1007
|
+
elements[2]
|
1008
|
+
end
|
1341
1009
|
|
1342
|
-
module EnvironmentVariableNameValue2
|
1343
1010
|
end
|
1344
1011
|
|
1345
|
-
module
|
1346
|
-
|
1012
|
+
module Command1
|
1013
|
+
def to_config_statement(build_state)
|
1014
|
+
return build_state.new_v1_command_statement(
|
1015
|
+
statement_start, gather_command_argument_nodes(command_line)
|
1016
|
+
)
|
1017
|
+
end
|
1347
1018
|
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1019
|
+
def gather_command_argument_nodes(node, arguments = [])
|
1020
|
+
if node.respond_to? 'quoted_or_bare_string?'
|
1021
|
+
arguments << node
|
1022
|
+
return arguments
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
return arguments if not node.elements
|
1026
|
+
|
1027
|
+
node.elements.each do
|
1028
|
+
|element|
|
1029
|
+
gather_command_argument_nodes(element, arguments)
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
return arguments
|
1033
|
+
end
|
1034
|
+
end
|
1035
|
+
|
1036
|
+
def _nt_command
|
1037
|
+
start_index = index
|
1038
|
+
if node_cache[:command].has_key?(index)
|
1039
|
+
cached = node_cache[:command][index]
|
1040
|
+
if cached
|
1041
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1042
|
+
@index = cached.interval.end
|
1043
|
+
end
|
1044
|
+
return cached
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
i0, s0 = index, []
|
1048
|
+
if has_terminal?('command', false, index)
|
1049
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
1050
|
+
@index += 7
|
1051
|
+
else
|
1052
|
+
terminal_parse_failure('command')
|
1053
|
+
r1 = nil
|
1054
|
+
end
|
1055
|
+
s0 << r1
|
1056
|
+
if r1
|
1057
|
+
s2, i2 = [], index
|
1058
|
+
loop do
|
1059
|
+
r3 = _nt_ws_or_comment
|
1060
|
+
if r3
|
1061
|
+
s2 << r3
|
1062
|
+
else
|
1063
|
+
break
|
1064
|
+
end
|
1065
|
+
end
|
1066
|
+
if s2.empty?
|
1067
|
+
@index = i2
|
1068
|
+
r2 = nil
|
1069
|
+
else
|
1070
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1071
|
+
end
|
1072
|
+
s0 << r2
|
1073
|
+
if r2
|
1074
|
+
r4 = _nt_command_line
|
1075
|
+
s0 << r4
|
1076
|
+
if r4
|
1077
|
+
s5, i5 = [], index
|
1078
|
+
loop do
|
1079
|
+
r6 = _nt_ws_or_comment
|
1080
|
+
if r6
|
1081
|
+
s5 << r6
|
1082
|
+
else
|
1083
|
+
break
|
1084
|
+
end
|
1085
|
+
end
|
1086
|
+
if s5.empty?
|
1087
|
+
@index = i5
|
1088
|
+
r5 = nil
|
1089
|
+
else
|
1090
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1091
|
+
end
|
1092
|
+
s0 << r5
|
1093
|
+
if r5
|
1094
|
+
if has_terminal?('end', false, index)
|
1095
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
1096
|
+
@index += 3
|
1097
|
+
else
|
1098
|
+
terminal_parse_failure('end')
|
1099
|
+
r7 = nil
|
1100
|
+
end
|
1101
|
+
s0 << r7
|
1102
|
+
end
|
1103
|
+
end
|
1104
|
+
end
|
1105
|
+
end
|
1106
|
+
if s0.last
|
1107
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1108
|
+
r0.extend(Command0)
|
1109
|
+
r0.extend(Command1)
|
1110
|
+
else
|
1111
|
+
@index = i0
|
1112
|
+
r0 = nil
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
node_cache[:command][start_index] = r0
|
1116
|
+
|
1117
|
+
r0
|
1118
|
+
end
|
1119
|
+
|
1120
|
+
module CommandLine0
|
1121
|
+
def quoted_or_bare_string
|
1122
|
+
elements[1]
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
end
|
1126
|
+
|
1127
|
+
module CommandLine1
|
1128
|
+
def quoted_or_bare_string
|
1129
|
+
elements[0]
|
1130
|
+
end
|
1131
|
+
|
1132
|
+
end
|
1133
|
+
|
1134
|
+
def _nt_command_line
|
1135
|
+
start_index = index
|
1136
|
+
if node_cache[:command_line].has_key?(index)
|
1137
|
+
cached = node_cache[:command_line][index]
|
1138
|
+
if cached
|
1139
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1140
|
+
@index = cached.interval.end
|
1141
|
+
end
|
1142
|
+
return cached
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
i0, s0 = index, []
|
1146
|
+
r1 = _nt_quoted_or_bare_string
|
1147
|
+
s0 << r1
|
1148
|
+
if r1
|
1149
|
+
i2 = index
|
1150
|
+
r3 = lambda { |sequence| sequence[-1].text_value == 'end' }.call(s0)
|
1151
|
+
if r3
|
1152
|
+
r2 = nil
|
1153
|
+
else
|
1154
|
+
@index = i2
|
1155
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
1156
|
+
end
|
1157
|
+
s0 << r2
|
1158
|
+
if r2
|
1159
|
+
s4, i4 = [], index
|
1160
|
+
loop do
|
1161
|
+
i5, s5 = index, []
|
1162
|
+
s6, i6 = [], index
|
1163
|
+
loop do
|
1164
|
+
r7 = _nt_ws_or_comment
|
1165
|
+
if r7
|
1166
|
+
s6 << r7
|
1167
|
+
else
|
1168
|
+
break
|
1169
|
+
end
|
1170
|
+
end
|
1171
|
+
if s6.empty?
|
1172
|
+
@index = i6
|
1173
|
+
r6 = nil
|
1174
|
+
else
|
1175
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
1176
|
+
end
|
1177
|
+
s5 << r6
|
1178
|
+
if r6
|
1179
|
+
r8 = _nt_quoted_or_bare_string
|
1180
|
+
s5 << r8
|
1181
|
+
if r8
|
1182
|
+
i9 = index
|
1183
|
+
r10 = lambda { |sequence| sequence[-1].text_value == 'end' }.call(s5)
|
1184
|
+
if r10
|
1185
|
+
r9 = nil
|
1186
|
+
else
|
1187
|
+
@index = i9
|
1188
|
+
r9 = instantiate_node(SyntaxNode,input, index...index)
|
1189
|
+
end
|
1190
|
+
s5 << r9
|
1191
|
+
end
|
1192
|
+
end
|
1193
|
+
if s5.last
|
1194
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1195
|
+
r5.extend(CommandLine0)
|
1196
|
+
else
|
1197
|
+
@index = i5
|
1198
|
+
r5 = nil
|
1199
|
+
end
|
1200
|
+
if r5
|
1201
|
+
s4 << r5
|
1202
|
+
else
|
1203
|
+
break
|
1204
|
+
end
|
1205
|
+
end
|
1206
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
1207
|
+
s0 << r4
|
1208
|
+
end
|
1209
|
+
end
|
1210
|
+
if s0.last
|
1211
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1212
|
+
r0.extend(CommandLine1)
|
1213
|
+
else
|
1214
|
+
@index = i0
|
1215
|
+
r0 = nil
|
1216
|
+
end
|
1217
|
+
|
1218
|
+
node_cache[:command_line][start_index] = r0
|
1219
|
+
|
1220
|
+
r0
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
def _nt_descriptor_string
|
1224
|
+
start_index = index
|
1225
|
+
if node_cache[:descriptor_string].has_key?(index)
|
1226
|
+
cached = node_cache[:descriptor_string][index]
|
1227
|
+
if cached
|
1228
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1229
|
+
@index = cached.interval.end
|
1230
|
+
end
|
1231
|
+
return cached
|
1232
|
+
end
|
1233
|
+
|
1234
|
+
s0, i0 = [], index
|
1235
|
+
loop do
|
1236
|
+
if has_terminal?('\G[^\\s#]', true, index)
|
1237
|
+
r1 = true
|
1238
|
+
@index += 1
|
1239
|
+
else
|
1240
|
+
r1 = nil
|
1241
|
+
end
|
1242
|
+
if r1
|
1243
|
+
s0 << r1
|
1244
|
+
else
|
1245
|
+
break
|
1246
|
+
end
|
1247
|
+
end
|
1248
|
+
if s0.empty?
|
1249
|
+
@index = i0
|
1250
|
+
r0 = nil
|
1251
|
+
else
|
1252
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1253
|
+
end
|
1254
|
+
|
1255
|
+
node_cache[:descriptor_string][start_index] = r0
|
1256
|
+
|
1257
|
+
r0
|
1258
|
+
end
|
1259
|
+
|
1260
|
+
def _nt_config_name
|
1261
|
+
start_index = index
|
1262
|
+
if node_cache[:config_name].has_key?(index)
|
1263
|
+
cached = node_cache[:config_name][index]
|
1264
|
+
if cached
|
1265
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1266
|
+
@index = cached.interval.end
|
1267
|
+
end
|
1268
|
+
return cached
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
s0, i0 = [], index
|
1272
|
+
loop do
|
1273
|
+
if has_terminal?('\G[a-zA-Z0-9_.-]', true, index)
|
1274
|
+
r1 = true
|
1275
|
+
@index += 1
|
1276
|
+
else
|
1277
|
+
r1 = nil
|
1278
|
+
end
|
1279
|
+
if r1
|
1280
|
+
s0 << r1
|
1281
|
+
else
|
1282
|
+
break
|
1283
|
+
end
|
1284
|
+
end
|
1285
|
+
if s0.empty?
|
1286
|
+
@index = i0
|
1287
|
+
r0 = nil
|
1288
|
+
else
|
1289
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1290
|
+
end
|
1291
|
+
|
1292
|
+
node_cache[:config_name][start_index] = r0
|
1293
|
+
|
1294
|
+
r0
|
1295
|
+
end
|
1296
|
+
|
1297
|
+
module QuotedOrBareString0
|
1298
|
+
end
|
1299
|
+
|
1300
|
+
module QuotedOrBareString1
|
1301
|
+
end
|
1302
|
+
|
1303
|
+
module QuotedOrBareString2
|
1304
|
+
def quoted_or_bare_string?() return true end
|
1305
|
+
end
|
1306
|
+
|
1307
|
+
module QuotedOrBareString3
|
1308
|
+
end
|
1309
|
+
|
1310
|
+
module QuotedOrBareString4
|
1311
|
+
end
|
1312
|
+
|
1313
|
+
module QuotedOrBareString5
|
1314
|
+
def quoted_or_bare_string?() return true end
|
1315
|
+
end
|
1316
|
+
|
1317
|
+
module QuotedOrBareString6
|
1318
|
+
def quoted_or_bare_string?() return true end
|
1319
|
+
end
|
1320
|
+
|
1321
|
+
def _nt_quoted_or_bare_string
|
1322
|
+
start_index = index
|
1323
|
+
if node_cache[:quoted_or_bare_string].has_key?(index)
|
1324
|
+
cached = node_cache[:quoted_or_bare_string][index]
|
1325
|
+
if cached
|
1326
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1327
|
+
@index = cached.interval.end
|
1328
|
+
end
|
1329
|
+
return cached
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
i0 = index
|
1333
|
+
i1, s1 = index, []
|
1334
|
+
s2, i2 = [], index
|
1335
|
+
loop do
|
1336
|
+
if has_terminal?('\G[^\\s#\\\\"]', true, index)
|
1337
|
+
r3 = true
|
1338
|
+
@index += 1
|
1339
|
+
else
|
1340
|
+
r3 = nil
|
1341
|
+
end
|
1342
|
+
if r3
|
1343
|
+
s2 << r3
|
1344
|
+
else
|
1345
|
+
break
|
1346
|
+
end
|
1347
|
+
end
|
1348
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1349
|
+
s1 << r2
|
1350
|
+
if r2
|
1351
|
+
if has_terminal?('"', false, index)
|
1352
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1353
|
+
@index += 1
|
1354
|
+
else
|
1355
|
+
terminal_parse_failure('"')
|
1356
|
+
r4 = nil
|
1357
|
+
end
|
1358
|
+
s1 << r4
|
1359
|
+
if r4
|
1360
|
+
s5, i5 = [], index
|
1361
|
+
loop do
|
1362
|
+
i6 = index
|
1363
|
+
if has_terminal?('\G[^"\\\\]', true, index)
|
1364
|
+
r7 = true
|
1365
|
+
@index += 1
|
1366
|
+
else
|
1367
|
+
r7 = nil
|
1368
|
+
end
|
1369
|
+
if r7
|
1370
|
+
r6 = r7
|
1371
|
+
else
|
1372
|
+
i8, s8 = index, []
|
1373
|
+
if has_terminal?('\\', false, index)
|
1374
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1375
|
+
@index += 1
|
1376
|
+
else
|
1377
|
+
terminal_parse_failure('\\')
|
1378
|
+
r9 = nil
|
1379
|
+
end
|
1380
|
+
s8 << r9
|
1381
|
+
if r9
|
1382
|
+
if index < input_length
|
1383
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1384
|
+
@index += 1
|
1385
|
+
else
|
1386
|
+
terminal_parse_failure("any character")
|
1387
|
+
r10 = nil
|
1388
|
+
end
|
1389
|
+
s8 << r10
|
1390
|
+
end
|
1391
|
+
if s8.last
|
1392
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
1393
|
+
r8.extend(QuotedOrBareString0)
|
1394
|
+
else
|
1395
|
+
@index = i8
|
1396
|
+
r8 = nil
|
1397
|
+
end
|
1398
|
+
if r8
|
1399
|
+
r6 = r8
|
1400
|
+
else
|
1401
|
+
@index = i6
|
1402
|
+
r6 = nil
|
1403
|
+
end
|
1404
|
+
end
|
1405
|
+
if r6
|
1406
|
+
s5 << r6
|
1407
|
+
else
|
1408
|
+
break
|
1409
|
+
end
|
1410
|
+
end
|
1411
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1412
|
+
s1 << r5
|
1413
|
+
if r5
|
1414
|
+
if has_terminal?('"', false, index)
|
1415
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1416
|
+
@index += 1
|
1417
|
+
else
|
1418
|
+
terminal_parse_failure('"')
|
1419
|
+
r11 = nil
|
1420
|
+
end
|
1421
|
+
s1 << r11
|
1422
|
+
end
|
1423
|
+
end
|
1424
|
+
end
|
1425
|
+
if s1.last
|
1426
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1427
|
+
r1.extend(QuotedOrBareString1)
|
1428
|
+
r1.extend(QuotedOrBareString2)
|
1429
|
+
else
|
1430
|
+
@index = i1
|
1431
|
+
r1 = nil
|
1432
|
+
end
|
1433
|
+
if r1
|
1434
|
+
r0 = r1
|
1435
|
+
else
|
1436
|
+
i12, s12 = index, []
|
1437
|
+
s13, i13 = [], index
|
1438
|
+
loop do
|
1439
|
+
if has_terminal?('\G[^\\s#\\\\\']', true, index)
|
1440
|
+
r14 = true
|
1441
|
+
@index += 1
|
1442
|
+
else
|
1443
|
+
r14 = nil
|
1444
|
+
end
|
1445
|
+
if r14
|
1446
|
+
s13 << r14
|
1447
|
+
else
|
1448
|
+
break
|
1449
|
+
end
|
1450
|
+
end
|
1451
|
+
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
1452
|
+
s12 << r13
|
1453
|
+
if r13
|
1454
|
+
if has_terminal?("'", false, index)
|
1455
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1456
|
+
@index += 1
|
1457
|
+
else
|
1458
|
+
terminal_parse_failure("'")
|
1459
|
+
r15 = nil
|
1460
|
+
end
|
1461
|
+
s12 << r15
|
1462
|
+
if r15
|
1463
|
+
s16, i16 = [], index
|
1464
|
+
loop do
|
1465
|
+
i17 = index
|
1466
|
+
if has_terminal?('\G[^\'\\\\]', true, index)
|
1467
|
+
r18 = true
|
1468
|
+
@index += 1
|
1469
|
+
else
|
1470
|
+
r18 = nil
|
1471
|
+
end
|
1472
|
+
if r18
|
1473
|
+
r17 = r18
|
1474
|
+
else
|
1475
|
+
i19, s19 = index, []
|
1476
|
+
if has_terminal?('\\', false, index)
|
1477
|
+
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1478
|
+
@index += 1
|
1479
|
+
else
|
1480
|
+
terminal_parse_failure('\\')
|
1481
|
+
r20 = nil
|
1482
|
+
end
|
1483
|
+
s19 << r20
|
1484
|
+
if r20
|
1485
|
+
if index < input_length
|
1486
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1487
|
+
@index += 1
|
1488
|
+
else
|
1489
|
+
terminal_parse_failure("any character")
|
1490
|
+
r21 = nil
|
1491
|
+
end
|
1492
|
+
s19 << r21
|
1493
|
+
end
|
1494
|
+
if s19.last
|
1495
|
+
r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
|
1496
|
+
r19.extend(QuotedOrBareString3)
|
1497
|
+
else
|
1498
|
+
@index = i19
|
1499
|
+
r19 = nil
|
1500
|
+
end
|
1501
|
+
if r19
|
1502
|
+
r17 = r19
|
1503
|
+
else
|
1504
|
+
@index = i17
|
1505
|
+
r17 = nil
|
1506
|
+
end
|
1507
|
+
end
|
1508
|
+
if r17
|
1509
|
+
s16 << r17
|
1510
|
+
else
|
1511
|
+
break
|
1512
|
+
end
|
1513
|
+
end
|
1514
|
+
r16 = instantiate_node(SyntaxNode,input, i16...index, s16)
|
1515
|
+
s12 << r16
|
1516
|
+
if r16
|
1517
|
+
if has_terminal?("'", false, index)
|
1518
|
+
r22 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1519
|
+
@index += 1
|
1520
|
+
else
|
1521
|
+
terminal_parse_failure("'")
|
1522
|
+
r22 = nil
|
1523
|
+
end
|
1524
|
+
s12 << r22
|
1525
|
+
end
|
1526
|
+
end
|
1527
|
+
end
|
1528
|
+
if s12.last
|
1529
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
1530
|
+
r12.extend(QuotedOrBareString4)
|
1531
|
+
r12.extend(QuotedOrBareString5)
|
1532
|
+
else
|
1533
|
+
@index = i12
|
1534
|
+
r12 = nil
|
1535
|
+
end
|
1536
|
+
if r12
|
1537
|
+
r0 = r12
|
1538
|
+
else
|
1539
|
+
s23, i23 = [], index
|
1540
|
+
loop do
|
1541
|
+
if has_terminal?('\G[^\\s#]', true, index)
|
1542
|
+
r24 = true
|
1543
|
+
@index += 1
|
1544
|
+
else
|
1545
|
+
r24 = nil
|
1546
|
+
end
|
1547
|
+
if r24
|
1548
|
+
s23 << r24
|
1549
|
+
else
|
1550
|
+
break
|
1551
|
+
end
|
1552
|
+
end
|
1553
|
+
if s23.empty?
|
1554
|
+
@index = i23
|
1555
|
+
r23 = nil
|
1556
|
+
else
|
1557
|
+
r23 = instantiate_node(SyntaxNode,input, i23...index, s23)
|
1558
|
+
r23.extend(QuotedOrBareString6)
|
1559
|
+
end
|
1560
|
+
if r23
|
1561
|
+
r0 = r23
|
1562
|
+
else
|
1563
|
+
@index = i0
|
1564
|
+
r0 = nil
|
1565
|
+
end
|
1566
|
+
end
|
1567
|
+
end
|
1568
|
+
|
1569
|
+
node_cache[:quoted_or_bare_string][start_index] = r0
|
1570
|
+
|
1571
|
+
r0
|
1572
|
+
end
|
1573
|
+
|
1574
|
+
def _nt_environment_variable_name
|
1575
|
+
start_index = index
|
1576
|
+
if node_cache[:environment_variable_name].has_key?(index)
|
1577
|
+
cached = node_cache[:environment_variable_name][index]
|
1578
|
+
if cached
|
1579
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1580
|
+
@index = cached.interval.end
|
1581
|
+
end
|
1582
|
+
return cached
|
1583
|
+
end
|
1584
|
+
|
1585
|
+
s0, i0 = [], index
|
1586
|
+
loop do
|
1587
|
+
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
1588
|
+
r1 = true
|
1589
|
+
@index += 1
|
1590
|
+
else
|
1591
|
+
r1 = nil
|
1592
|
+
end
|
1593
|
+
if r1
|
1594
|
+
s0 << r1
|
1595
|
+
else
|
1596
|
+
break
|
1597
|
+
end
|
1598
|
+
end
|
1599
|
+
if s0.empty?
|
1600
|
+
@index = i0
|
1601
|
+
r0 = nil
|
1602
|
+
else
|
1603
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1604
|
+
end
|
1605
|
+
|
1606
|
+
node_cache[:environment_variable_name][start_index] = r0
|
1607
|
+
|
1608
|
+
r0
|
1609
|
+
end
|
1610
|
+
|
1611
|
+
module EnvironmentVariableNameValue0
|
1612
|
+
end
|
1613
|
+
|
1614
|
+
module EnvironmentVariableNameValue1
|
1615
|
+
end
|
1616
|
+
|
1617
|
+
module EnvironmentVariableNameValue2
|
1618
|
+
end
|
1619
|
+
|
1620
|
+
module EnvironmentVariableNameValue3
|
1621
|
+
end
|
1622
|
+
|
1623
|
+
def _nt_environment_variable_name_value
|
1624
|
+
start_index = index
|
1625
|
+
if node_cache[:environment_variable_name_value].has_key?(index)
|
1351
1626
|
cached = node_cache[:environment_variable_name_value][index]
|
1352
1627
|
if cached
|
1353
1628
|
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
@@ -1360,7 +1635,7 @@ module Fig
|
|
1360
1635
|
i1, s1 = index, []
|
1361
1636
|
s2, i2 = [], index
|
1362
1637
|
loop do
|
1363
|
-
if has_terminal?('\G[^\\s
|
1638
|
+
if has_terminal?('\G[^\\s#\\\\\'"]', true, index)
|
1364
1639
|
r3 = true
|
1365
1640
|
@index += 1
|
1366
1641
|
else
|
@@ -1462,7 +1737,7 @@ module Fig
|
|
1462
1737
|
i12, s12 = index, []
|
1463
1738
|
s13, i13 = [], index
|
1464
1739
|
loop do
|
1465
|
-
if has_terminal?('\G[^\\s#\\\\\']', true, index)
|
1740
|
+
if has_terminal?('\G[^\\s#\\\\\'"]', true, index)
|
1466
1741
|
r14 = true
|
1467
1742
|
@index += 1
|
1468
1743
|
else
|
@@ -1595,185 +1870,6 @@ module Fig
|
|
1595
1870
|
r0
|
1596
1871
|
end
|
1597
1872
|
|
1598
|
-
module Command0
|
1599
|
-
def statement_start
|
1600
|
-
elements[0]
|
1601
|
-
end
|
1602
|
-
|
1603
|
-
def command_line
|
1604
|
-
elements[2]
|
1605
|
-
end
|
1606
|
-
end
|
1607
|
-
|
1608
|
-
module Command1
|
1609
|
-
def to_config_statement(build_state)
|
1610
|
-
return build_state.new_command_statement(
|
1611
|
-
statement_start, command_line
|
1612
|
-
)
|
1613
|
-
end
|
1614
|
-
end
|
1615
|
-
|
1616
|
-
def _nt_command
|
1617
|
-
start_index = index
|
1618
|
-
if node_cache[:command].has_key?(index)
|
1619
|
-
cached = node_cache[:command][index]
|
1620
|
-
if cached
|
1621
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1622
|
-
@index = cached.interval.end
|
1623
|
-
end
|
1624
|
-
return cached
|
1625
|
-
end
|
1626
|
-
|
1627
|
-
i0, s0 = index, []
|
1628
|
-
if has_terminal?('command', false, index)
|
1629
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
1630
|
-
@index += 7
|
1631
|
-
else
|
1632
|
-
terminal_parse_failure('command')
|
1633
|
-
r1 = nil
|
1634
|
-
end
|
1635
|
-
s0 << r1
|
1636
|
-
if r1
|
1637
|
-
s2, i2 = [], index
|
1638
|
-
loop do
|
1639
|
-
r3 = _nt_ws_or_comment
|
1640
|
-
if r3
|
1641
|
-
s2 << r3
|
1642
|
-
else
|
1643
|
-
break
|
1644
|
-
end
|
1645
|
-
end
|
1646
|
-
if s2.empty?
|
1647
|
-
@index = i2
|
1648
|
-
r2 = nil
|
1649
|
-
else
|
1650
|
-
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1651
|
-
end
|
1652
|
-
s0 << r2
|
1653
|
-
if r2
|
1654
|
-
r4 = _nt_command_line
|
1655
|
-
s0 << r4
|
1656
|
-
end
|
1657
|
-
end
|
1658
|
-
if s0.last
|
1659
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1660
|
-
r0.extend(Command0)
|
1661
|
-
r0.extend(Command1)
|
1662
|
-
else
|
1663
|
-
@index = i0
|
1664
|
-
r0 = nil
|
1665
|
-
end
|
1666
|
-
|
1667
|
-
node_cache[:command][start_index] = r0
|
1668
|
-
|
1669
|
-
r0
|
1670
|
-
end
|
1671
|
-
|
1672
|
-
module CommandLine0
|
1673
|
-
def value
|
1674
|
-
elements[1]
|
1675
|
-
end
|
1676
|
-
|
1677
|
-
end
|
1678
|
-
|
1679
|
-
def _nt_command_line
|
1680
|
-
start_index = index
|
1681
|
-
if node_cache[:command_line].has_key?(index)
|
1682
|
-
cached = node_cache[:command_line][index]
|
1683
|
-
if cached
|
1684
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1685
|
-
@index = cached.interval.end
|
1686
|
-
end
|
1687
|
-
return cached
|
1688
|
-
end
|
1689
|
-
|
1690
|
-
i0, s0 = index, []
|
1691
|
-
if has_terminal?('"', false, index)
|
1692
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1693
|
-
@index += 1
|
1694
|
-
else
|
1695
|
-
terminal_parse_failure('"')
|
1696
|
-
r1 = nil
|
1697
|
-
end
|
1698
|
-
s0 << r1
|
1699
|
-
if r1
|
1700
|
-
s2, i2 = [], index
|
1701
|
-
loop do
|
1702
|
-
if has_terminal?('\G[^"]', true, index)
|
1703
|
-
r3 = true
|
1704
|
-
@index += 1
|
1705
|
-
else
|
1706
|
-
r3 = nil
|
1707
|
-
end
|
1708
|
-
if r3
|
1709
|
-
s2 << r3
|
1710
|
-
else
|
1711
|
-
break
|
1712
|
-
end
|
1713
|
-
end
|
1714
|
-
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1715
|
-
s0 << r2
|
1716
|
-
if r2
|
1717
|
-
if has_terminal?('"', false, index)
|
1718
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1719
|
-
@index += 1
|
1720
|
-
else
|
1721
|
-
terminal_parse_failure('"')
|
1722
|
-
r4 = nil
|
1723
|
-
end
|
1724
|
-
s0 << r4
|
1725
|
-
end
|
1726
|
-
end
|
1727
|
-
if s0.last
|
1728
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1729
|
-
r0.extend(CommandLine0)
|
1730
|
-
else
|
1731
|
-
@index = i0
|
1732
|
-
r0 = nil
|
1733
|
-
end
|
1734
|
-
|
1735
|
-
node_cache[:command_line][start_index] = r0
|
1736
|
-
|
1737
|
-
r0
|
1738
|
-
end
|
1739
|
-
|
1740
|
-
def _nt_descriptor_string
|
1741
|
-
start_index = index
|
1742
|
-
if node_cache[:descriptor_string].has_key?(index)
|
1743
|
-
cached = node_cache[:descriptor_string][index]
|
1744
|
-
if cached
|
1745
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1746
|
-
@index = cached.interval.end
|
1747
|
-
end
|
1748
|
-
return cached
|
1749
|
-
end
|
1750
|
-
|
1751
|
-
s0, i0 = [], index
|
1752
|
-
loop do
|
1753
|
-
if has_terminal?('\G[^\\s#]', true, index)
|
1754
|
-
r1 = true
|
1755
|
-
@index += 1
|
1756
|
-
else
|
1757
|
-
r1 = nil
|
1758
|
-
end
|
1759
|
-
if r1
|
1760
|
-
s0 << r1
|
1761
|
-
else
|
1762
|
-
break
|
1763
|
-
end
|
1764
|
-
end
|
1765
|
-
if s0.empty?
|
1766
|
-
@index = i0
|
1767
|
-
r0 = nil
|
1768
|
-
else
|
1769
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1770
|
-
end
|
1771
|
-
|
1772
|
-
node_cache[:descriptor_string][start_index] = r0
|
1773
|
-
|
1774
|
-
r0
|
1775
|
-
end
|
1776
|
-
|
1777
1873
|
end
|
1778
1874
|
|
1779
1875
|
class V1Parser < Treetop::Runtime::CompiledParser
|