fig 0.1.77 → 0.1.79
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +58 -1
- data/bin/fig +1 -1
- data/lib/fig.rb +1 -1
- data/lib/fig/command.rb +3 -3
- data/lib/fig/command/action/dump_package_definition_parsed.rb +5 -4
- data/lib/fig/command/action/list_variables/all_configs.rb +2 -5
- data/lib/fig/command/action/publish_local.rb +1 -1
- data/lib/fig/command/action/role/list_variables_in_a_tree.rb +2 -5
- data/lib/fig/command/action/run_command_line.rb +10 -3
- data/lib/fig/command/action/run_command_statement.rb +1 -1
- data/lib/fig/command/options.rb +8 -7
- data/lib/fig/command/options/parser.rb +1 -1
- data/lib/fig/environment_variables/case_insensitive.rb +1 -1
- data/lib/fig/environment_variables/case_sensitive.rb +1 -1
- data/lib/fig/figrc.rb +10 -10
- data/lib/fig/{not_found_error.rb → file_not_found_error.rb} +1 -1
- data/lib/fig/grammar/v0.rb +174 -173
- data/lib/fig/grammar/v0.treetop +27 -21
- data/lib/fig/grammar/v1.rb +477 -171
- data/lib/fig/grammar/v1.treetop +34 -22
- data/lib/fig/operating_system.rb +139 -60
- data/lib/fig/package.rb +8 -4
- data/lib/fig/package_definition_text_assembler.rb +31 -23
- data/lib/fig/parser.rb +3 -5
- data/lib/fig/parser_package_build_state.rb +15 -14
- data/lib/fig/repository.rb +41 -28
- data/lib/fig/repository_package_publisher.rb +20 -25
- data/lib/fig/runtime_environment.rb +136 -87
- data/lib/fig/statement.rb +15 -116
- data/lib/fig/statement/archive.rb +6 -4
- data/lib/fig/statement/asset.rb +50 -35
- data/lib/fig/statement/command.rb +6 -2
- data/lib/fig/statement/configuration.rb +10 -2
- data/lib/fig/statement/environment_variable.rb +35 -0
- data/lib/fig/statement/grammar_version.rb +6 -2
- data/lib/fig/statement/include.rb +6 -2
- data/lib/fig/statement/override.rb +6 -2
- data/lib/fig/statement/path.rb +7 -8
- data/lib/fig/statement/resource.rb +7 -3
- data/lib/fig/statement/retrieve.rb +10 -2
- data/lib/fig/statement/set.rb +7 -8
- data/lib/fig/string_tokenizer.rb +195 -0
- data/lib/fig/tokenized_string.rb +22 -0
- data/lib/fig/tokenized_string/plain_segment.rb +24 -0
- data/lib/fig/tokenized_string/token.rb +18 -0
- data/lib/fig/unparser.rb +84 -1
- data/lib/fig/unparser/v0.rb +4 -0
- data/lib/fig/unparser/v1.rb +7 -7
- data/lib/fig/url.rb +12 -1
- data/lib/fig/{url_access_error.rb → url_access_disallowed_error.rb} +2 -2
- metadata +129 -128
- data/lib/fig/grammar/v0_asset_location.rb +0 -162
- data/lib/fig/grammar/v0_ish.rb +0 -1356
- data/lib/fig/grammar/v1_asset_location.rb +0 -162
- data/lib/fig/grammar/v2.rb +0 -1478
data/Changes
CHANGED
@@ -1,3 +1,60 @@
|
|
1
|
+
v0.1.79
|
2
|
+
|
3
|
+
Backwards incompatibilities:
|
4
|
+
|
5
|
+
- Commands given via the command-line are no longer run through the shell if
|
6
|
+
given as multiple arguments. This should be a pretty esoteric issue, but
|
7
|
+
if you're depending upon double interpolation of command-lines or joining
|
8
|
+
of quoted expressions, then this change will break your usage of fig.
|
9
|
+
|
10
|
+
Previously, running
|
11
|
+
|
12
|
+
fig -- javac -classpath '$SOMEPATH' whatever
|
13
|
+
|
14
|
+
would pass javac the value of the SOMEPATH environment variable after fig
|
15
|
+
had manipulated it. If you still want the shell involved, pass a single
|
16
|
+
argument to fig by quoting, e.g.
|
17
|
+
|
18
|
+
fig -- 'javac -classpath $SOMEPATH whatever'
|
19
|
+
|
20
|
+
- Commands given via the command-line have the same "@" expansion done on
|
21
|
+
them that "command" statements in a package definition do, i.e. "@package"
|
22
|
+
gets replaced with the path to that package and "@" gets replaced by the
|
23
|
+
path to the base package.
|
24
|
+
|
25
|
+
New features:
|
26
|
+
|
27
|
+
- Commands given via the command-line are no longer run through the shell if
|
28
|
+
given as multiple arguments. This means that there should be fewer
|
29
|
+
surprises in usage.
|
30
|
+
|
31
|
+
Note that command statements still go through splitting on whitespace and
|
32
|
+
reassembling with space characters.
|
33
|
+
|
34
|
+
- Commands given via the command-line have the same "@" expansion done on
|
35
|
+
them that "command" statements in a package definition do, i.e. "@package"
|
36
|
+
gets replaced with the path to that package and "@" gets replaced by the
|
37
|
+
path to the base package.
|
38
|
+
|
39
|
+
Bug fixes:
|
40
|
+
|
41
|
+
- For both environment variable and command statements, at signs that follow
|
42
|
+
escaped at signs are expanded. Previously, if you had
|
43
|
+
|
44
|
+
set FOO=X\@Y@Z
|
45
|
+
|
46
|
+
then the value of FOO after expansion would be "X@Y@Z". Now it would
|
47
|
+
(correctly) be "X@Ypackage-pathZ".
|
48
|
+
|
49
|
+
- Doing a --update after a --publish-local doesn't delete the local package.
|
50
|
+
Actually, updates handle failed downloads better in general and don't
|
51
|
+
delete local copies of packages.
|
52
|
+
|
53
|
+
v0.1.78.beta.2
|
54
|
+
v0.1.78.beta.1
|
55
|
+
|
56
|
+
- Test releases
|
57
|
+
|
1
58
|
v0.1.77
|
2
59
|
|
3
60
|
Bug fixes:
|
@@ -33,7 +90,7 @@ v0.1.77
|
|
33
90
|
"another_symlink" will be copied to "somewhere" as a symlink.
|
34
91
|
|
35
92
|
- Retrieves of symlinks will not occur if the symlink was previously
|
36
|
-
retrieved. Previously, if you
|
93
|
+
retrieved. Previously, if you updated the same package multiple times and
|
37
94
|
that package contained symlinks, the symlinks would be recreated on every
|
38
95
|
update, even though the regular files would not.
|
39
96
|
|
data/bin/fig
CHANGED
data/lib/fig.rb
CHANGED
data/lib/fig/command.rb
CHANGED
@@ -87,10 +87,10 @@ class Fig::Command
|
|
87
87
|
return Fig::Command::Action::EXIT_SUCCESS
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
90
|
+
def run_fig_with_exception_handling(argv, options = nil)
|
91
91
|
begin
|
92
92
|
return run_fig(argv, options)
|
93
|
-
rescue Fig::
|
93
|
+
rescue Fig::URLAccessDisallowedError => error
|
94
94
|
urls = error.urls.join(', ')
|
95
95
|
$stderr.puts \
|
96
96
|
"Access to #{urls} in #{error.package}/#{error.version} not allowed."
|
@@ -386,7 +386,7 @@ class Fig::Command
|
|
386
386
|
|statement|
|
387
387
|
|
388
388
|
Fig::Logging.warn(
|
389
|
-
"Ignored #{statement.source_description} for #{statement.
|
389
|
+
"Ignored #{statement.source_description} for #{statement.location}."
|
390
390
|
)
|
391
391
|
end
|
392
392
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'fig/command/action'
|
2
2
|
require 'fig/command/action/role/has_no_sub_action'
|
3
|
-
require 'fig/
|
3
|
+
require 'fig/package_definition_text_assembler'
|
4
4
|
|
5
5
|
module Fig; end
|
6
6
|
class Fig::Command; end
|
@@ -35,10 +35,11 @@ class Fig::Command::Action::DumpPackageDefinitionParsed
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def execute()
|
38
|
-
|
39
|
-
|
38
|
+
text_assembler = Fig::PackageDefinitionTextAssembler.new :emit_as_input
|
39
|
+
text_assembler.add_output @execution_context.base_package.statements
|
40
40
|
|
41
|
-
|
41
|
+
unparsed, explanations = text_assembler.assemble_package_definition
|
42
|
+
print unparsed
|
42
43
|
|
43
44
|
return EXIT_SUCCESS
|
44
45
|
end
|
@@ -45,11 +45,8 @@ class Fig::Command::Action::ListVariables::AllConfigs
|
|
45
45
|
|package, config_name, depth|
|
46
46
|
|
47
47
|
package[config_name].walk_statements() do |statement|
|
48
|
-
|
49
|
-
|
50
|
-
variable_names << statement.name()
|
51
|
-
when Fig::Statement::Set
|
52
|
-
variable_names << statement.name()
|
48
|
+
if statement.is_environment_variable?
|
49
|
+
variable_names << statement.name()
|
53
50
|
end
|
54
51
|
end
|
55
52
|
end
|
@@ -19,7 +19,7 @@ class Fig::Command::Action::PublishLocal
|
|
19
19
|
def execute()
|
20
20
|
publish_preflight()
|
21
21
|
|
22
|
-
Fig::Logging.info "Publishing #{@descriptor.to_string()}."
|
22
|
+
Fig::Logging.info "Publishing #{@descriptor.to_string()} locally."
|
23
23
|
@execution_context.repository.publish_package(
|
24
24
|
@publish_statements,
|
25
25
|
@descriptor,
|
@@ -83,11 +83,8 @@ module Fig::Command::Action::Role::ListVariablesInATree
|
|
83
83
|
def gather_variable_statements(config_statement)
|
84
84
|
variable_statements = []
|
85
85
|
config_statement.walk_statements() do |statement|
|
86
|
-
|
87
|
-
|
88
|
-
variable_statements << statement
|
89
|
-
when Fig::Statement::Set
|
90
|
-
variable_statements << statement
|
86
|
+
if statement.is_environment_variable?
|
87
|
+
variable_statements << statement
|
91
88
|
end
|
92
89
|
end
|
93
90
|
|
@@ -39,15 +39,22 @@ class Fig::Command::Action::RunCommandLine
|
|
39
39
|
|
40
40
|
def configure(options)
|
41
41
|
@command_line = options.shell_command
|
42
|
+
@descriptor = options.descriptor
|
42
43
|
|
43
44
|
return
|
44
45
|
end
|
45
46
|
|
46
47
|
def execute()
|
47
|
-
@execution_context.environment
|
48
|
-
|
48
|
+
environment = @execution_context.environment
|
49
|
+
base_package = @execution_context.base_package
|
50
|
+
base_config = @execution_context.base_config
|
51
|
+
|
52
|
+
environment.execute_command_line(
|
53
|
+
base_package, base_config, @descriptor, @command_line
|
54
|
+
) do
|
55
|
+
|command| @execution_context.operating_system.plain_or_shell_exec command
|
49
56
|
end
|
50
57
|
|
51
|
-
|
58
|
+
# Will never get here.
|
52
59
|
end
|
53
60
|
end
|
data/lib/fig/command/options.rb
CHANGED
@@ -159,8 +159,6 @@ class Fig::Command::Options
|
|
159
159
|
|
160
160
|
def strip_shell_command(argv)
|
161
161
|
argv.each_with_index do |arg, i|
|
162
|
-
terminating_option = nil
|
163
|
-
|
164
162
|
case arg
|
165
163
|
when '--'
|
166
164
|
set_base_action(Fig::Command::Action::RunCommandLine)
|
@@ -592,13 +590,16 @@ class Fig::Command::Options
|
|
592
590
|
return statement_class.new(nil, "#{option} option", variable, value)
|
593
591
|
end
|
594
592
|
|
595
|
-
def new_content_statement(option,
|
596
|
-
|
597
|
-
|
593
|
+
def new_content_statement(option, raw_path, statement_class)
|
594
|
+
tokenized_path =
|
595
|
+
statement_class.validate_and_process_escapes_in_location(raw_path) do
|
596
|
+
|error_description|
|
598
597
|
|
599
|
-
|
600
|
-
|
598
|
+
@parser.raise_invalid_argument(option, raw_path, error_description)
|
599
|
+
end
|
601
600
|
|
601
|
+
path = tokenized_path.to_expanded_string
|
602
|
+
need_to_glob = ! tokenized_path.single_quoted?
|
602
603
|
return statement_class.new(nil, "#{option} option", path, need_to_glob)
|
603
604
|
end
|
604
605
|
|
data/lib/fig/figrc.rb
CHANGED
@@ -2,6 +2,7 @@ require 'json'
|
|
2
2
|
|
3
3
|
require 'fig/application_configuration'
|
4
4
|
require 'fig/config_file_error'
|
5
|
+
require 'fig/file_not_found_error'
|
5
6
|
require 'fig/operating_system'
|
6
7
|
require 'fig/repository'
|
7
8
|
|
@@ -43,9 +44,10 @@ class Fig::FigRC
|
|
43
44
|
def self.handle_override_configuration(configuration, override_path)
|
44
45
|
begin
|
45
46
|
if not override_path.nil?
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
configuration_text = File::open(override_path).read
|
48
|
+
if configuration_text.length > 0
|
49
|
+
configuration.push_dataset JSON.parse(configuration_text)
|
50
|
+
end
|
49
51
|
end
|
50
52
|
rescue JSON::ParserError => exception
|
51
53
|
translate_parse_error(exception, override_path)
|
@@ -59,9 +61,8 @@ class Fig::FigRC
|
|
59
61
|
return if not File.exists? user_figrc_path
|
60
62
|
|
61
63
|
begin
|
62
|
-
|
63
|
-
|
64
|
-
)
|
64
|
+
configuration_text = File::open(user_figrc_path).read
|
65
|
+
configuration.push_dataset JSON.parse(configuration_text)
|
65
66
|
rescue JSON::ParserError => exception
|
66
67
|
translate_parse_error(exception, user_figrc_path)
|
67
68
|
end
|
@@ -90,16 +91,15 @@ class Fig::FigRC
|
|
90
91
|
begin
|
91
92
|
os.download( figrc_url, repo_figrc_path )
|
92
93
|
repo_config_exists = true
|
93
|
-
rescue Fig::
|
94
|
+
rescue Fig::FileNotFoundError
|
94
95
|
repo_config_exists = false
|
95
96
|
end
|
96
97
|
|
97
98
|
return if not repo_config_exists
|
98
99
|
|
99
100
|
begin
|
100
|
-
|
101
|
-
|
102
|
-
)
|
101
|
+
configuration_text = File.open(repo_figrc_path).read
|
102
|
+
configuration.push_dataset JSON.parse(configuration_text)
|
103
103
|
rescue JSON::ParserError => exception
|
104
104
|
translate_parse_error(exception, figrc_url)
|
105
105
|
end
|
@@ -2,7 +2,7 @@ module Fig
|
|
2
2
|
# A (possibly remote) file that was looked for was not found. This may or
|
3
3
|
# may not actually be a problem; i.e. this may be the result of an existence
|
4
4
|
# test.
|
5
|
-
class
|
5
|
+
class FileNotFoundError < StandardError
|
6
6
|
attr_reader :path
|
7
7
|
|
8
8
|
def initialize(message, path)
|
data/lib/fig/grammar/v0.rb
CHANGED
@@ -168,7 +168,7 @@ module Fig
|
|
168
168
|
elements[0]
|
169
169
|
end
|
170
170
|
|
171
|
-
def
|
171
|
+
def location
|
172
172
|
elements[2]
|
173
173
|
end
|
174
174
|
end
|
@@ -176,7 +176,7 @@ module Fig
|
|
176
176
|
module Archive1
|
177
177
|
def to_package_statement(build_state)
|
178
178
|
return build_state.new_asset_statement(
|
179
|
-
Statement::Archive, statement_start,
|
179
|
+
Statement::Archive, statement_start, location.location
|
180
180
|
)
|
181
181
|
end
|
182
182
|
end
|
@@ -219,7 +219,7 @@ module Fig
|
|
219
219
|
end
|
220
220
|
s0 << r2
|
221
221
|
if r2
|
222
|
-
r4 =
|
222
|
+
r4 = _nt_asset_location
|
223
223
|
s0 << r4
|
224
224
|
end
|
225
225
|
end
|
@@ -242,7 +242,7 @@ module Fig
|
|
242
242
|
elements[0]
|
243
243
|
end
|
244
244
|
|
245
|
-
def
|
245
|
+
def location
|
246
246
|
elements[2]
|
247
247
|
end
|
248
248
|
end
|
@@ -250,7 +250,7 @@ module Fig
|
|
250
250
|
module Resource1
|
251
251
|
def to_package_statement(build_state)
|
252
252
|
return build_state.new_asset_statement(
|
253
|
-
Statement::Resource, statement_start,
|
253
|
+
Statement::Resource, statement_start, location.location
|
254
254
|
)
|
255
255
|
end
|
256
256
|
end
|
@@ -293,7 +293,7 @@ module Fig
|
|
293
293
|
end
|
294
294
|
s0 << r2
|
295
295
|
if r2
|
296
|
-
r4 =
|
296
|
+
r4 = _nt_asset_location
|
297
297
|
s0 << r4
|
298
298
|
end
|
299
299
|
end
|
@@ -311,8 +311,8 @@ module Fig
|
|
311
311
|
r0
|
312
312
|
end
|
313
313
|
|
314
|
-
module
|
315
|
-
def
|
314
|
+
module AssetLocation0
|
315
|
+
def location
|
316
316
|
elements[0]
|
317
317
|
end
|
318
318
|
|
@@ -321,8 +321,8 @@ module Fig
|
|
321
321
|
end
|
322
322
|
end
|
323
323
|
|
324
|
-
module
|
325
|
-
def
|
324
|
+
module AssetLocation1
|
325
|
+
def location
|
326
326
|
elements[1]
|
327
327
|
end
|
328
328
|
|
@@ -331,10 +331,10 @@ module Fig
|
|
331
331
|
end
|
332
332
|
end
|
333
333
|
|
334
|
-
def
|
334
|
+
def _nt_asset_location
|
335
335
|
start_index = index
|
336
|
-
if node_cache[:
|
337
|
-
cached = node_cache[:
|
336
|
+
if node_cache[:asset_location].has_key?(index)
|
337
|
+
cached = node_cache[:asset_location][index]
|
338
338
|
if cached
|
339
339
|
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
340
340
|
@index = cached.interval.end
|
@@ -371,7 +371,7 @@ module Fig
|
|
371
371
|
end
|
372
372
|
if s1.last
|
373
373
|
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
374
|
-
r1.extend(
|
374
|
+
r1.extend(AssetLocation0)
|
375
375
|
else
|
376
376
|
@index = i1
|
377
377
|
r1 = nil
|
@@ -427,7 +427,7 @@ module Fig
|
|
427
427
|
end
|
428
428
|
if s5.last
|
429
429
|
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
430
|
-
r5.extend(
|
430
|
+
r5.extend(AssetLocation1)
|
431
431
|
else
|
432
432
|
@index = i5
|
433
433
|
r5 = nil
|
@@ -440,7 +440,7 @@ module Fig
|
|
440
440
|
end
|
441
441
|
end
|
442
442
|
|
443
|
-
node_cache[:
|
443
|
+
node_cache[:asset_location][start_index] = r0
|
444
444
|
|
445
445
|
r0
|
446
446
|
end
|
@@ -997,12 +997,142 @@ module Fig
|
|
997
997
|
r0
|
998
998
|
end
|
999
999
|
|
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
|
+
module Set0
|
1038
|
+
def statement_start
|
1039
|
+
elements[0]
|
1040
|
+
end
|
1041
|
+
|
1042
|
+
def environment_variable_name_value
|
1043
|
+
elements[2]
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
module Set1
|
1049
|
+
def to_config_statement(build_state)
|
1050
|
+
return build_state.new_environment_variable_statement(
|
1051
|
+
Statement::Set, statement_start, environment_variable_name_value
|
1052
|
+
)
|
1053
|
+
end
|
1054
|
+
end
|
1055
|
+
|
1056
|
+
def _nt_set
|
1057
|
+
start_index = index
|
1058
|
+
if node_cache[:set].has_key?(index)
|
1059
|
+
cached = node_cache[:set][index]
|
1060
|
+
if cached
|
1061
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1062
|
+
@index = cached.interval.end
|
1063
|
+
end
|
1064
|
+
return cached
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
i0, s0 = index, []
|
1068
|
+
if has_terminal?('set', false, index)
|
1069
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
1070
|
+
@index += 3
|
1071
|
+
else
|
1072
|
+
terminal_parse_failure('set')
|
1073
|
+
r1 = nil
|
1074
|
+
end
|
1075
|
+
s0 << r1
|
1076
|
+
if r1
|
1077
|
+
s2, i2 = [], index
|
1078
|
+
loop do
|
1079
|
+
r3 = _nt_ws
|
1080
|
+
if r3
|
1081
|
+
s2 << r3
|
1082
|
+
else
|
1083
|
+
break
|
1084
|
+
end
|
1085
|
+
end
|
1086
|
+
if s2.empty?
|
1087
|
+
@index = i2
|
1088
|
+
r2 = nil
|
1089
|
+
else
|
1090
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1091
|
+
end
|
1092
|
+
s0 << r2
|
1093
|
+
if r2
|
1094
|
+
r4 = _nt_environment_variable_name_value
|
1095
|
+
s0 << r4
|
1096
|
+
if r4
|
1097
|
+
s5, i5 = [], index
|
1098
|
+
loop do
|
1099
|
+
r6 = _nt_ws
|
1100
|
+
if r6
|
1101
|
+
s5 << r6
|
1102
|
+
else
|
1103
|
+
break
|
1104
|
+
end
|
1105
|
+
end
|
1106
|
+
if s5.empty?
|
1107
|
+
@index = i5
|
1108
|
+
r5 = nil
|
1109
|
+
else
|
1110
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1111
|
+
end
|
1112
|
+
s0 << r5
|
1113
|
+
end
|
1114
|
+
end
|
1115
|
+
end
|
1116
|
+
if s0.last
|
1117
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1118
|
+
r0.extend(Set0)
|
1119
|
+
r0.extend(Set1)
|
1120
|
+
else
|
1121
|
+
@index = i0
|
1122
|
+
r0 = nil
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
node_cache[:set][start_index] = r0
|
1126
|
+
|
1127
|
+
r0
|
1128
|
+
end
|
1129
|
+
|
1000
1130
|
module Path0
|
1001
1131
|
def statement_start
|
1002
1132
|
elements[0]
|
1003
1133
|
end
|
1004
1134
|
|
1005
|
-
def
|
1135
|
+
def environment_variable_name_value
|
1006
1136
|
elements[2]
|
1007
1137
|
end
|
1008
1138
|
|
@@ -1011,7 +1141,7 @@ module Fig
|
|
1011
1141
|
module Path1
|
1012
1142
|
def to_config_statement(build_state)
|
1013
1143
|
return build_state.new_environment_variable_statement(
|
1014
|
-
Statement::Path, statement_start,
|
1144
|
+
Statement::Path, statement_start, environment_variable_name_value
|
1015
1145
|
)
|
1016
1146
|
end
|
1017
1147
|
end
|
@@ -1083,44 +1213,25 @@ module Fig
|
|
1083
1213
|
end
|
1084
1214
|
s0 << r5
|
1085
1215
|
if r5
|
1086
|
-
|
1087
|
-
loop do
|
1088
|
-
if has_terminal?('\G[\\S]', true, index)
|
1089
|
-
r8 = true
|
1090
|
-
@index += 1
|
1091
|
-
else
|
1092
|
-
r8 = nil
|
1093
|
-
end
|
1094
|
-
if r8
|
1095
|
-
s7 << r8
|
1096
|
-
else
|
1097
|
-
break
|
1098
|
-
end
|
1099
|
-
end
|
1100
|
-
if s7.empty?
|
1101
|
-
@index = i7
|
1102
|
-
r7 = nil
|
1103
|
-
else
|
1104
|
-
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
1105
|
-
end
|
1216
|
+
r7 = _nt_environment_variable_name_value
|
1106
1217
|
s0 << r7
|
1107
1218
|
if r7
|
1108
|
-
|
1219
|
+
s8, i8 = [], index
|
1109
1220
|
loop do
|
1110
|
-
|
1111
|
-
if
|
1112
|
-
|
1221
|
+
r9 = _nt_ws
|
1222
|
+
if r9
|
1223
|
+
s8 << r9
|
1113
1224
|
else
|
1114
1225
|
break
|
1115
1226
|
end
|
1116
1227
|
end
|
1117
|
-
if
|
1118
|
-
@index =
|
1119
|
-
|
1228
|
+
if s8.empty?
|
1229
|
+
@index = i8
|
1230
|
+
r8 = nil
|
1120
1231
|
else
|
1121
|
-
|
1232
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
1122
1233
|
end
|
1123
|
-
s0 <<
|
1234
|
+
s0 << r8
|
1124
1235
|
end
|
1125
1236
|
end
|
1126
1237
|
end
|
@@ -1138,10 +1249,10 @@ module Fig
|
|
1138
1249
|
r0
|
1139
1250
|
end
|
1140
1251
|
|
1141
|
-
def
|
1252
|
+
def _nt_environment_variable_name_value
|
1142
1253
|
start_index = index
|
1143
|
-
if node_cache[:
|
1144
|
-
cached = node_cache[:
|
1254
|
+
if node_cache[:environment_variable_name_value].has_key?(index)
|
1255
|
+
cached = node_cache[:environment_variable_name_value][index]
|
1145
1256
|
if cached
|
1146
1257
|
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1147
1258
|
@index = cached.interval.end
|
@@ -1151,7 +1262,7 @@ module Fig
|
|
1151
1262
|
|
1152
1263
|
s0, i0 = [], index
|
1153
1264
|
loop do
|
1154
|
-
if has_terminal?('\G[
|
1265
|
+
if has_terminal?('\G[\\S]', true, index)
|
1155
1266
|
r1 = true
|
1156
1267
|
@index += 1
|
1157
1268
|
else
|
@@ -1170,119 +1281,7 @@ module Fig
|
|
1170
1281
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1171
1282
|
end
|
1172
1283
|
|
1173
|
-
node_cache[:
|
1174
|
-
|
1175
|
-
r0
|
1176
|
-
end
|
1177
|
-
|
1178
|
-
module Set0
|
1179
|
-
def statement_start
|
1180
|
-
elements[0]
|
1181
|
-
end
|
1182
|
-
|
1183
|
-
def name_value
|
1184
|
-
elements[2]
|
1185
|
-
end
|
1186
|
-
|
1187
|
-
end
|
1188
|
-
|
1189
|
-
module Set1
|
1190
|
-
def to_config_statement(build_state)
|
1191
|
-
return build_state.new_environment_variable_statement(
|
1192
|
-
Statement::Set, statement_start, name_value
|
1193
|
-
)
|
1194
|
-
end
|
1195
|
-
end
|
1196
|
-
|
1197
|
-
def _nt_set
|
1198
|
-
start_index = index
|
1199
|
-
if node_cache[:set].has_key?(index)
|
1200
|
-
cached = node_cache[:set][index]
|
1201
|
-
if cached
|
1202
|
-
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1203
|
-
@index = cached.interval.end
|
1204
|
-
end
|
1205
|
-
return cached
|
1206
|
-
end
|
1207
|
-
|
1208
|
-
i0, s0 = index, []
|
1209
|
-
if has_terminal?('set', false, index)
|
1210
|
-
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
1211
|
-
@index += 3
|
1212
|
-
else
|
1213
|
-
terminal_parse_failure('set')
|
1214
|
-
r1 = nil
|
1215
|
-
end
|
1216
|
-
s0 << r1
|
1217
|
-
if r1
|
1218
|
-
s2, i2 = [], index
|
1219
|
-
loop do
|
1220
|
-
r3 = _nt_ws
|
1221
|
-
if r3
|
1222
|
-
s2 << r3
|
1223
|
-
else
|
1224
|
-
break
|
1225
|
-
end
|
1226
|
-
end
|
1227
|
-
if s2.empty?
|
1228
|
-
@index = i2
|
1229
|
-
r2 = nil
|
1230
|
-
else
|
1231
|
-
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1232
|
-
end
|
1233
|
-
s0 << r2
|
1234
|
-
if r2
|
1235
|
-
s4, i4 = [], index
|
1236
|
-
loop do
|
1237
|
-
if has_terminal?('\G[\\S]', true, index)
|
1238
|
-
r5 = true
|
1239
|
-
@index += 1
|
1240
|
-
else
|
1241
|
-
r5 = nil
|
1242
|
-
end
|
1243
|
-
if r5
|
1244
|
-
s4 << r5
|
1245
|
-
else
|
1246
|
-
break
|
1247
|
-
end
|
1248
|
-
end
|
1249
|
-
if s4.empty?
|
1250
|
-
@index = i4
|
1251
|
-
r4 = nil
|
1252
|
-
else
|
1253
|
-
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
1254
|
-
end
|
1255
|
-
s0 << r4
|
1256
|
-
if r4
|
1257
|
-
s6, i6 = [], index
|
1258
|
-
loop do
|
1259
|
-
r7 = _nt_ws
|
1260
|
-
if r7
|
1261
|
-
s6 << r7
|
1262
|
-
else
|
1263
|
-
break
|
1264
|
-
end
|
1265
|
-
end
|
1266
|
-
if s6.empty?
|
1267
|
-
@index = i6
|
1268
|
-
r6 = nil
|
1269
|
-
else
|
1270
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
1271
|
-
end
|
1272
|
-
s0 << r6
|
1273
|
-
end
|
1274
|
-
end
|
1275
|
-
end
|
1276
|
-
if s0.last
|
1277
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1278
|
-
r0.extend(Set0)
|
1279
|
-
r0.extend(Set1)
|
1280
|
-
else
|
1281
|
-
@index = i0
|
1282
|
-
r0 = nil
|
1283
|
-
end
|
1284
|
-
|
1285
|
-
node_cache[:set][start_index] = r0
|
1284
|
+
node_cache[:environment_variable_name_value][start_index] = r0
|
1286
1285
|
|
1287
1286
|
r0
|
1288
1287
|
end
|
@@ -1292,7 +1291,7 @@ module Fig
|
|
1292
1291
|
elements[0]
|
1293
1292
|
end
|
1294
1293
|
|
1295
|
-
def
|
1294
|
+
def command_line
|
1296
1295
|
elements[2]
|
1297
1296
|
end
|
1298
1297
|
|
@@ -1300,7 +1299,9 @@ module Fig
|
|
1300
1299
|
|
1301
1300
|
module Command1
|
1302
1301
|
def to_config_statement(build_state)
|
1303
|
-
return build_state.new_command_statement(
|
1302
|
+
return build_state.new_command_statement(
|
1303
|
+
statement_start, command_line
|
1304
|
+
)
|
1304
1305
|
end
|
1305
1306
|
end
|
1306
1307
|
|
@@ -1342,7 +1343,7 @@ module Fig
|
|
1342
1343
|
end
|
1343
1344
|
s0 << r2
|
1344
1345
|
if r2
|
1345
|
-
r4 =
|
1346
|
+
r4 = _nt_command_line
|
1346
1347
|
s0 << r4
|
1347
1348
|
if r4
|
1348
1349
|
s5, i5 = [], index
|
@@ -1378,17 +1379,17 @@ module Fig
|
|
1378
1379
|
r0
|
1379
1380
|
end
|
1380
1381
|
|
1381
|
-
module
|
1382
|
+
module CommandLine0
|
1382
1383
|
def value
|
1383
1384
|
elements[1]
|
1384
1385
|
end
|
1385
1386
|
|
1386
1387
|
end
|
1387
1388
|
|
1388
|
-
def
|
1389
|
+
def _nt_command_line
|
1389
1390
|
start_index = index
|
1390
|
-
if node_cache[:
|
1391
|
-
cached = node_cache[:
|
1391
|
+
if node_cache[:command_line].has_key?(index)
|
1392
|
+
cached = node_cache[:command_line][index]
|
1392
1393
|
if cached
|
1393
1394
|
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1394
1395
|
@index = cached.interval.end
|
@@ -1435,13 +1436,13 @@ module Fig
|
|
1435
1436
|
end
|
1436
1437
|
if s0.last
|
1437
1438
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1438
|
-
r0.extend(
|
1439
|
+
r0.extend(CommandLine0)
|
1439
1440
|
else
|
1440
1441
|
@index = i0
|
1441
1442
|
r0 = nil
|
1442
1443
|
end
|
1443
1444
|
|
1444
|
-
node_cache[:
|
1445
|
+
node_cache[:command_line][start_index] = r0
|
1445
1446
|
|
1446
1447
|
r0
|
1447
1448
|
end
|