fig 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +94 -0
- data/lib/fig.rb +1 -1
- data/lib/fig/command.rb +18 -7
- data/lib/fig/command/action/dump_package_definition_for_command_line.rb +2 -2
- data/lib/fig/command/action/dump_package_definition_parsed.rb +2 -2
- data/lib/fig/command/action/dump_package_definition_text.rb +2 -2
- data/lib/fig/command/action/source_package.rb +65 -0
- data/lib/fig/command/options.rb +64 -15
- data/lib/fig/command/options/parser.rb +24 -14
- data/lib/fig/command/package_applier.rb +32 -7
- data/lib/fig/command/package_loader.rb +16 -7
- data/lib/fig/external_program.rb +72 -0
- data/lib/fig/figrc.rb +1 -1
- data/lib/fig/grammar/v0.rb +2 -2
- data/lib/fig/grammar/v0.treetop +2 -2
- data/lib/fig/grammar/v1.rb +17 -1737
- data/lib/fig/grammar/v1.treetop +6 -217
- data/lib/fig/grammar/v1_base.rb +1750 -0
- data/lib/fig/grammar/v1_base.treetop +229 -0
- data/lib/fig/grammar/v2.rb +508 -0
- data/lib/fig/grammar/v2.treetop +65 -0
- data/lib/fig/grammar_monkey_patches.rb +7 -0
- data/lib/fig/no_such_package_config_error.rb +3 -1
- data/lib/fig/not_yet_parsed_package.rb +27 -0
- data/lib/fig/operating_system.rb +5 -5
- data/lib/fig/package.rb +20 -2
- data/lib/fig/package_definition_text_assembler.rb +2 -1
- data/lib/fig/package_descriptor.rb +11 -4
- data/lib/fig/parser.rb +44 -58
- data/lib/fig/parser_package_build_state.rb +39 -4
- data/lib/fig/protocol/file.rb +2 -2
- data/lib/fig/protocol/ftp.rb +15 -10
- data/lib/fig/protocol/http.rb +1 -1
- data/lib/fig/protocol/netrc_enabled.rb +29 -16
- data/lib/fig/protocol/sftp.rb +19 -12
- data/lib/fig/repository.rb +33 -21
- data/lib/fig/repository_package_publisher.rb +129 -8
- data/lib/fig/runtime_environment.rb +114 -28
- data/lib/fig/statement/include.rb +21 -4
- data/lib/fig/statement/include_file.rb +94 -0
- data/lib/fig/unparser.rb +15 -7
- data/lib/fig/unparser/v1.rb +2 -80
- data/lib/fig/unparser/v1_base.rb +85 -0
- data/lib/fig/unparser/v2.rb +55 -0
- data/lib/fig/working_directory_maintainer.rb +12 -0
- metadata +61 -51
data/lib/fig/grammar/v1.treetop
CHANGED
@@ -1,17 +1,10 @@
|
|
1
1
|
# Treetop (http://treetop.rubyforge.org/) grammar for package definitions in v1
|
2
2
|
# format.
|
3
3
|
|
4
|
-
# Some aspects of this grammar are significantly dumber than they could be
|
5
|
-
# because:
|
6
|
-
#
|
7
|
-
# * We want to treat statements as identically as possible to their
|
8
|
-
# command-line equivalents.
|
9
|
-
# * Treetop parse errors are pretty inscrutable at times and we can make
|
10
|
-
# error messages clearer by validating a lot of the terminals ourselves.
|
11
|
-
|
12
4
|
require 'treetop'
|
13
5
|
|
14
6
|
require 'fig/grammar/base'
|
7
|
+
require 'fig/grammar/v1_base'
|
15
8
|
require 'fig/grammar/version'
|
16
9
|
|
17
10
|
module Fig
|
@@ -19,231 +12,27 @@ module Fig
|
|
19
12
|
grammar V1
|
20
13
|
include Fig::Grammar::Base
|
21
14
|
include Fig::Grammar::Version
|
15
|
+
include Fig::Grammar::V1Base
|
22
16
|
|
17
|
+
# It would nice to be able to put this into Fig::Grammar::V1Base, but it
|
18
|
+
# looks like the root has to be declared in the concrete grammar.
|
23
19
|
rule package
|
24
20
|
optional_ws_or_comment
|
25
21
|
grammar_version:grammar_version?
|
26
22
|
statements:(package_statement_with_ws*)
|
27
23
|
optional_ws_or_comment
|
28
24
|
{
|
29
|
-
def to_package(
|
25
|
+
def to_package(unparsed_package, build_state)
|
30
26
|
return build_state.new_package_statement(
|
31
|
-
|
32
|
-
)
|
33
|
-
end
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
# Shim between "package" and "package_statement" rules to allow the
|
38
|
-
# compiled v0 and v1 grammars to have the same interface.
|
39
|
-
rule package_statement_with_ws
|
40
|
-
package_statement:package_statement ws_or_comment+ {
|
41
|
-
def to_package_statement(build_state)
|
42
|
-
return package_statement.to_package_statement(build_state)
|
43
|
-
end
|
44
|
-
}
|
45
|
-
end
|
46
|
-
|
47
|
-
rule package_statement
|
48
|
-
archive / resource / retrieve / config
|
49
|
-
end
|
50
|
-
|
51
|
-
rule archive
|
52
|
-
statement_start:'archive'
|
53
|
-
ws_or_comment+
|
54
|
-
location:quoted_or_bare_string
|
55
|
-
{
|
56
|
-
def to_package_statement(build_state)
|
57
|
-
return build_state.new_asset_statement(
|
58
|
-
Statement::Archive, statement_start, location
|
59
|
-
)
|
60
|
-
end
|
61
|
-
}
|
62
|
-
end
|
63
|
-
|
64
|
-
rule resource
|
65
|
-
statement_start:'resource'
|
66
|
-
ws_or_comment+
|
67
|
-
location:quoted_or_bare_string
|
68
|
-
{
|
69
|
-
def to_package_statement(build_state)
|
70
|
-
return build_state.new_asset_statement(
|
71
|
-
Statement::Resource, statement_start, location
|
72
|
-
)
|
73
|
-
end
|
74
|
-
}
|
75
|
-
end
|
76
|
-
|
77
|
-
rule retrieve
|
78
|
-
statement_start:'retrieve'
|
79
|
-
ws_or_comment+
|
80
|
-
variable:environment_variable_name '->' path:quoted_or_bare_string
|
81
|
-
{
|
82
|
-
def to_package_statement(build_state)
|
83
|
-
return build_state.new_retrieve_statement(
|
84
|
-
statement_start, variable, path
|
27
|
+
unparsed_package, grammar_version, statements
|
85
28
|
)
|
86
29
|
end
|
87
30
|
}
|
88
31
|
end
|
89
32
|
|
90
|
-
rule config
|
91
|
-
statement_start:'config'
|
92
|
-
ws_or_comment+
|
93
|
-
config_name
|
94
|
-
ws_or_comment+
|
95
|
-
statements:config_statement_with_ws*
|
96
|
-
'end'
|
97
|
-
{
|
98
|
-
def to_package_statement(build_state)
|
99
|
-
return build_state.new_configuration_statement(
|
100
|
-
statement_start, config_name, statements
|
101
|
-
)
|
102
|
-
end
|
103
|
-
}
|
104
|
-
end
|
105
|
-
|
106
|
-
# Shim between "config" and "config_statement" rules to allow the
|
107
|
-
# compiled v0 and v1 grammars to have the same interface.
|
108
|
-
rule config_statement_with_ws
|
109
|
-
config_statement:config_statement ws_or_comment+ {
|
110
|
-
def to_config_statement(build_state)
|
111
|
-
return config_statement.to_config_statement(build_state)
|
112
|
-
end
|
113
|
-
}
|
114
|
-
end
|
115
|
-
|
116
33
|
rule config_statement
|
117
34
|
override / include / command / path / set
|
118
35
|
end
|
119
|
-
|
120
|
-
rule include
|
121
|
-
statement_start:'include' ws_or_comment+ descriptor_string {
|
122
|
-
def to_config_statement(build_state)
|
123
|
-
return build_state.new_include_statement(
|
124
|
-
statement_start, descriptor_string
|
125
|
-
)
|
126
|
-
end
|
127
|
-
}
|
128
|
-
end
|
129
|
-
|
130
|
-
rule override
|
131
|
-
statement_start:'override' ws_or_comment+ descriptor_string {
|
132
|
-
def to_config_statement(build_state)
|
133
|
-
return build_state.new_override_statement(
|
134
|
-
statement_start, descriptor_string
|
135
|
-
)
|
136
|
-
end
|
137
|
-
}
|
138
|
-
end
|
139
|
-
|
140
|
-
rule set
|
141
|
-
statement_start:'set' ws_or_comment+ environment_variable_name_value {
|
142
|
-
def to_config_statement(build_state)
|
143
|
-
return build_state.new_environment_variable_statement(
|
144
|
-
Statement::Set, statement_start, environment_variable_name_value
|
145
|
-
)
|
146
|
-
end
|
147
|
-
}
|
148
|
-
end
|
149
|
-
|
150
|
-
rule path
|
151
|
-
statement_start:('add' / 'append' / 'path')
|
152
|
-
ws_or_comment+
|
153
|
-
environment_variable_name_value
|
154
|
-
{
|
155
|
-
def to_config_statement(build_state)
|
156
|
-
return build_state.new_environment_variable_statement(
|
157
|
-
Statement::Path, statement_start, environment_variable_name_value
|
158
|
-
)
|
159
|
-
end
|
160
|
-
}
|
161
|
-
end
|
162
|
-
|
163
|
-
rule command
|
164
|
-
statement_start:'command'
|
165
|
-
ws_or_comment+
|
166
|
-
command_line
|
167
|
-
ws_or_comment+
|
168
|
-
'end'
|
169
|
-
{
|
170
|
-
def to_config_statement(build_state)
|
171
|
-
return build_state.new_v1_command_statement(
|
172
|
-
statement_start, gather_command_argument_nodes(command_line)
|
173
|
-
)
|
174
|
-
end
|
175
|
-
|
176
|
-
def gather_command_argument_nodes(node, arguments = [])
|
177
|
-
if node.respond_to? 'quoted_or_bare_string?'
|
178
|
-
arguments << node
|
179
|
-
return arguments
|
180
|
-
end
|
181
|
-
|
182
|
-
return arguments if not node.elements
|
183
|
-
|
184
|
-
node.elements.each do
|
185
|
-
|element|
|
186
|
-
gather_command_argument_nodes(element, arguments)
|
187
|
-
end
|
188
|
-
|
189
|
-
return arguments
|
190
|
-
end
|
191
|
-
}
|
192
|
-
end
|
193
|
-
|
194
|
-
rule command_line
|
195
|
-
quoted_or_bare_string
|
196
|
-
! { |sequence| sequence[-1].text_value == 'end' }
|
197
|
-
(
|
198
|
-
ws_or_comment+
|
199
|
-
quoted_or_bare_string
|
200
|
-
! { |sequence| sequence[-1].text_value == 'end' }
|
201
|
-
)*
|
202
|
-
end
|
203
|
-
|
204
|
-
# Terminals
|
205
|
-
|
206
|
-
rule descriptor_string
|
207
|
-
[^\s#]+
|
208
|
-
end
|
209
|
-
|
210
|
-
rule config_name
|
211
|
-
[a-zA-Z0-9_.-]+
|
212
|
-
end
|
213
|
-
|
214
|
-
rule quoted_or_bare_string
|
215
|
-
# In order to deal with the hierarchy of nodes that the command_line
|
216
|
-
# rule above generates, we tag each of the expressions here so that
|
217
|
-
# they can be found in the syntax tree.
|
218
|
-
[^\s#\\"]* '"' ( [^"\\] / '\\' . )* '"'
|
219
|
-
{ def quoted_or_bare_string?() return true end }
|
220
|
-
|
221
|
-
/
|
222
|
-
|
223
|
-
[^\s#\\']* "'" ( [^'\\] / '\\' . )* "'"
|
224
|
-
{ def quoted_or_bare_string?() return true end }
|
225
|
-
|
226
|
-
/
|
227
|
-
|
228
|
-
[^\s#]+
|
229
|
-
{ def quoted_or_bare_string?() return true end }
|
230
|
-
end
|
231
|
-
|
232
|
-
rule environment_variable_name
|
233
|
-
[a-zA-Z0-9_]+
|
234
|
-
end
|
235
|
-
|
236
|
-
rule environment_variable_name_value
|
237
|
-
# This is like quoted_or_bare_string, but allows for the unquoted
|
238
|
-
# variable name followed by equals sign prior to the quotation marks
|
239
|
-
# coming in.
|
240
|
-
#
|
241
|
-
# Should result in somewhat reasonable handling by Treetop when
|
242
|
-
# encountering mis-quoted constructs.
|
243
|
-
[^\s#\\'"]* '"' ( [^"\\] / '\\' . )* '"' /
|
244
|
-
[^\s#\\'"]* "'" ( [^'\\] / '\\' . )* "'" /
|
245
|
-
[^\s#]+
|
246
|
-
end
|
247
36
|
end
|
248
37
|
end
|
249
38
|
end
|
@@ -0,0 +1,1750 @@
|
|
1
|
+
# Autogenerated from a Treetop grammar. Edits may be lost.
|
2
|
+
|
3
|
+
|
4
|
+
# Reusable parts of Treetop (http://treetop.rubyforge.org/) grammar for package
|
5
|
+
# definitions in v1 format.
|
6
|
+
|
7
|
+
# Some aspects of this grammar are significantly dumber than they could be
|
8
|
+
# because:
|
9
|
+
#
|
10
|
+
# * We want to treat statements as identically as possible to their
|
11
|
+
# command-line equivalents.
|
12
|
+
# * Treetop parse errors are pretty inscrutable at times and we can make
|
13
|
+
# error messages clearer by validating a lot of the terminals ourselves.
|
14
|
+
|
15
|
+
require 'treetop'
|
16
|
+
|
17
|
+
module Fig
|
18
|
+
module Grammar
|
19
|
+
# Consumers of this need to mix in Fig::Grammar::Base and
|
20
|
+
# Fig::Grammar::Version and have a "rule config_statement".
|
21
|
+
module V1Base
|
22
|
+
include Treetop::Runtime
|
23
|
+
|
24
|
+
def root
|
25
|
+
@root ||= :package_statement_with_ws
|
26
|
+
end
|
27
|
+
|
28
|
+
module PackageStatementWithWs0
|
29
|
+
def package_statement
|
30
|
+
elements[0]
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
module PackageStatementWithWs1
|
36
|
+
def to_package_statement(build_state)
|
37
|
+
return package_statement.to_package_statement(build_state)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def _nt_package_statement_with_ws
|
42
|
+
start_index = index
|
43
|
+
if node_cache[:package_statement_with_ws].has_key?(index)
|
44
|
+
cached = node_cache[:package_statement_with_ws][index]
|
45
|
+
if cached
|
46
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
47
|
+
@index = cached.interval.end
|
48
|
+
end
|
49
|
+
return cached
|
50
|
+
end
|
51
|
+
|
52
|
+
i0, s0 = index, []
|
53
|
+
r1 = _nt_package_statement
|
54
|
+
s0 << r1
|
55
|
+
if r1
|
56
|
+
s2, i2 = [], index
|
57
|
+
loop do
|
58
|
+
r3 = _nt_ws_or_comment
|
59
|
+
if r3
|
60
|
+
s2 << r3
|
61
|
+
else
|
62
|
+
break
|
63
|
+
end
|
64
|
+
end
|
65
|
+
if s2.empty?
|
66
|
+
@index = i2
|
67
|
+
r2 = nil
|
68
|
+
else
|
69
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
70
|
+
end
|
71
|
+
s0 << r2
|
72
|
+
end
|
73
|
+
if s0.last
|
74
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
75
|
+
r0.extend(PackageStatementWithWs0)
|
76
|
+
r0.extend(PackageStatementWithWs1)
|
77
|
+
else
|
78
|
+
@index = i0
|
79
|
+
r0 = nil
|
80
|
+
end
|
81
|
+
|
82
|
+
node_cache[:package_statement_with_ws][start_index] = r0
|
83
|
+
|
84
|
+
r0
|
85
|
+
end
|
86
|
+
|
87
|
+
def _nt_package_statement
|
88
|
+
start_index = index
|
89
|
+
if node_cache[:package_statement].has_key?(index)
|
90
|
+
cached = node_cache[:package_statement][index]
|
91
|
+
if cached
|
92
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
93
|
+
@index = cached.interval.end
|
94
|
+
end
|
95
|
+
return cached
|
96
|
+
end
|
97
|
+
|
98
|
+
i0 = index
|
99
|
+
r1 = _nt_archive
|
100
|
+
if r1
|
101
|
+
r0 = r1
|
102
|
+
else
|
103
|
+
r2 = _nt_resource
|
104
|
+
if r2
|
105
|
+
r0 = r2
|
106
|
+
else
|
107
|
+
r3 = _nt_retrieve
|
108
|
+
if r3
|
109
|
+
r0 = r3
|
110
|
+
else
|
111
|
+
r4 = _nt_config
|
112
|
+
if r4
|
113
|
+
r0 = r4
|
114
|
+
else
|
115
|
+
@index = i0
|
116
|
+
r0 = nil
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
node_cache[:package_statement][start_index] = r0
|
123
|
+
|
124
|
+
r0
|
125
|
+
end
|
126
|
+
|
127
|
+
module Archive0
|
128
|
+
def statement_start
|
129
|
+
elements[0]
|
130
|
+
end
|
131
|
+
|
132
|
+
def location
|
133
|
+
elements[2]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
module Archive1
|
138
|
+
def to_package_statement(build_state)
|
139
|
+
return build_state.new_asset_statement(
|
140
|
+
Statement::Archive, statement_start, location
|
141
|
+
)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def _nt_archive
|
146
|
+
start_index = index
|
147
|
+
if node_cache[:archive].has_key?(index)
|
148
|
+
cached = node_cache[:archive][index]
|
149
|
+
if cached
|
150
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
151
|
+
@index = cached.interval.end
|
152
|
+
end
|
153
|
+
return cached
|
154
|
+
end
|
155
|
+
|
156
|
+
i0, s0 = index, []
|
157
|
+
if has_terminal?('archive', false, index)
|
158
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
159
|
+
@index += 7
|
160
|
+
else
|
161
|
+
terminal_parse_failure('archive')
|
162
|
+
r1 = nil
|
163
|
+
end
|
164
|
+
s0 << r1
|
165
|
+
if r1
|
166
|
+
s2, i2 = [], index
|
167
|
+
loop do
|
168
|
+
r3 = _nt_ws_or_comment
|
169
|
+
if r3
|
170
|
+
s2 << r3
|
171
|
+
else
|
172
|
+
break
|
173
|
+
end
|
174
|
+
end
|
175
|
+
if s2.empty?
|
176
|
+
@index = i2
|
177
|
+
r2 = nil
|
178
|
+
else
|
179
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
180
|
+
end
|
181
|
+
s0 << r2
|
182
|
+
if r2
|
183
|
+
r4 = _nt_quoted_or_bare_string
|
184
|
+
s0 << r4
|
185
|
+
end
|
186
|
+
end
|
187
|
+
if s0.last
|
188
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
189
|
+
r0.extend(Archive0)
|
190
|
+
r0.extend(Archive1)
|
191
|
+
else
|
192
|
+
@index = i0
|
193
|
+
r0 = nil
|
194
|
+
end
|
195
|
+
|
196
|
+
node_cache[:archive][start_index] = r0
|
197
|
+
|
198
|
+
r0
|
199
|
+
end
|
200
|
+
|
201
|
+
module Resource0
|
202
|
+
def statement_start
|
203
|
+
elements[0]
|
204
|
+
end
|
205
|
+
|
206
|
+
def location
|
207
|
+
elements[2]
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
module Resource1
|
212
|
+
def to_package_statement(build_state)
|
213
|
+
return build_state.new_asset_statement(
|
214
|
+
Statement::Resource, statement_start, location
|
215
|
+
)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
def _nt_resource
|
220
|
+
start_index = index
|
221
|
+
if node_cache[:resource].has_key?(index)
|
222
|
+
cached = node_cache[:resource][index]
|
223
|
+
if cached
|
224
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
225
|
+
@index = cached.interval.end
|
226
|
+
end
|
227
|
+
return cached
|
228
|
+
end
|
229
|
+
|
230
|
+
i0, s0 = index, []
|
231
|
+
if has_terminal?('resource', false, index)
|
232
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
|
233
|
+
@index += 8
|
234
|
+
else
|
235
|
+
terminal_parse_failure('resource')
|
236
|
+
r1 = nil
|
237
|
+
end
|
238
|
+
s0 << r1
|
239
|
+
if r1
|
240
|
+
s2, i2 = [], index
|
241
|
+
loop do
|
242
|
+
r3 = _nt_ws_or_comment
|
243
|
+
if r3
|
244
|
+
s2 << r3
|
245
|
+
else
|
246
|
+
break
|
247
|
+
end
|
248
|
+
end
|
249
|
+
if s2.empty?
|
250
|
+
@index = i2
|
251
|
+
r2 = nil
|
252
|
+
else
|
253
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
254
|
+
end
|
255
|
+
s0 << r2
|
256
|
+
if r2
|
257
|
+
r4 = _nt_quoted_or_bare_string
|
258
|
+
s0 << r4
|
259
|
+
end
|
260
|
+
end
|
261
|
+
if s0.last
|
262
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
263
|
+
r0.extend(Resource0)
|
264
|
+
r0.extend(Resource1)
|
265
|
+
else
|
266
|
+
@index = i0
|
267
|
+
r0 = nil
|
268
|
+
end
|
269
|
+
|
270
|
+
node_cache[:resource][start_index] = r0
|
271
|
+
|
272
|
+
r0
|
273
|
+
end
|
274
|
+
|
275
|
+
module Retrieve0
|
276
|
+
def statement_start
|
277
|
+
elements[0]
|
278
|
+
end
|
279
|
+
|
280
|
+
def variable
|
281
|
+
elements[2]
|
282
|
+
end
|
283
|
+
|
284
|
+
def path
|
285
|
+
elements[4]
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
module Retrieve1
|
290
|
+
def to_package_statement(build_state)
|
291
|
+
return build_state.new_retrieve_statement(
|
292
|
+
statement_start, variable, path
|
293
|
+
)
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
def _nt_retrieve
|
298
|
+
start_index = index
|
299
|
+
if node_cache[:retrieve].has_key?(index)
|
300
|
+
cached = node_cache[:retrieve][index]
|
301
|
+
if cached
|
302
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
303
|
+
@index = cached.interval.end
|
304
|
+
end
|
305
|
+
return cached
|
306
|
+
end
|
307
|
+
|
308
|
+
i0, s0 = index, []
|
309
|
+
if has_terminal?('retrieve', false, index)
|
310
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
|
311
|
+
@index += 8
|
312
|
+
else
|
313
|
+
terminal_parse_failure('retrieve')
|
314
|
+
r1 = nil
|
315
|
+
end
|
316
|
+
s0 << r1
|
317
|
+
if r1
|
318
|
+
s2, i2 = [], index
|
319
|
+
loop do
|
320
|
+
r3 = _nt_ws_or_comment
|
321
|
+
if r3
|
322
|
+
s2 << r3
|
323
|
+
else
|
324
|
+
break
|
325
|
+
end
|
326
|
+
end
|
327
|
+
if s2.empty?
|
328
|
+
@index = i2
|
329
|
+
r2 = nil
|
330
|
+
else
|
331
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
332
|
+
end
|
333
|
+
s0 << r2
|
334
|
+
if r2
|
335
|
+
r4 = _nt_environment_variable_name
|
336
|
+
s0 << r4
|
337
|
+
if r4
|
338
|
+
if has_terminal?('->', false, index)
|
339
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
340
|
+
@index += 2
|
341
|
+
else
|
342
|
+
terminal_parse_failure('->')
|
343
|
+
r5 = nil
|
344
|
+
end
|
345
|
+
s0 << r5
|
346
|
+
if r5
|
347
|
+
r6 = _nt_quoted_or_bare_string
|
348
|
+
s0 << r6
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
if s0.last
|
354
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
355
|
+
r0.extend(Retrieve0)
|
356
|
+
r0.extend(Retrieve1)
|
357
|
+
else
|
358
|
+
@index = i0
|
359
|
+
r0 = nil
|
360
|
+
end
|
361
|
+
|
362
|
+
node_cache[:retrieve][start_index] = r0
|
363
|
+
|
364
|
+
r0
|
365
|
+
end
|
366
|
+
|
367
|
+
module Config0
|
368
|
+
def statement_start
|
369
|
+
elements[0]
|
370
|
+
end
|
371
|
+
|
372
|
+
def config_name
|
373
|
+
elements[2]
|
374
|
+
end
|
375
|
+
|
376
|
+
def statements
|
377
|
+
elements[4]
|
378
|
+
end
|
379
|
+
|
380
|
+
end
|
381
|
+
|
382
|
+
module Config1
|
383
|
+
def to_package_statement(build_state)
|
384
|
+
return build_state.new_configuration_statement(
|
385
|
+
statement_start, config_name, statements
|
386
|
+
)
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
def _nt_config
|
391
|
+
start_index = index
|
392
|
+
if node_cache[:config].has_key?(index)
|
393
|
+
cached = node_cache[:config][index]
|
394
|
+
if cached
|
395
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
396
|
+
@index = cached.interval.end
|
397
|
+
end
|
398
|
+
return cached
|
399
|
+
end
|
400
|
+
|
401
|
+
i0, s0 = index, []
|
402
|
+
if has_terminal?('config', false, index)
|
403
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
404
|
+
@index += 6
|
405
|
+
else
|
406
|
+
terminal_parse_failure('config')
|
407
|
+
r1 = nil
|
408
|
+
end
|
409
|
+
s0 << r1
|
410
|
+
if r1
|
411
|
+
s2, i2 = [], index
|
412
|
+
loop do
|
413
|
+
r3 = _nt_ws_or_comment
|
414
|
+
if r3
|
415
|
+
s2 << r3
|
416
|
+
else
|
417
|
+
break
|
418
|
+
end
|
419
|
+
end
|
420
|
+
if s2.empty?
|
421
|
+
@index = i2
|
422
|
+
r2 = nil
|
423
|
+
else
|
424
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
425
|
+
end
|
426
|
+
s0 << r2
|
427
|
+
if r2
|
428
|
+
r4 = _nt_config_name
|
429
|
+
s0 << r4
|
430
|
+
if r4
|
431
|
+
s5, i5 = [], index
|
432
|
+
loop do
|
433
|
+
r6 = _nt_ws_or_comment
|
434
|
+
if r6
|
435
|
+
s5 << r6
|
436
|
+
else
|
437
|
+
break
|
438
|
+
end
|
439
|
+
end
|
440
|
+
if s5.empty?
|
441
|
+
@index = i5
|
442
|
+
r5 = nil
|
443
|
+
else
|
444
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
445
|
+
end
|
446
|
+
s0 << r5
|
447
|
+
if r5
|
448
|
+
s7, i7 = [], index
|
449
|
+
loop do
|
450
|
+
r8 = _nt_config_statement_with_ws
|
451
|
+
if r8
|
452
|
+
s7 << r8
|
453
|
+
else
|
454
|
+
break
|
455
|
+
end
|
456
|
+
end
|
457
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
458
|
+
s0 << r7
|
459
|
+
if r7
|
460
|
+
if has_terminal?('end', false, index)
|
461
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
462
|
+
@index += 3
|
463
|
+
else
|
464
|
+
terminal_parse_failure('end')
|
465
|
+
r9 = nil
|
466
|
+
end
|
467
|
+
s0 << r9
|
468
|
+
end
|
469
|
+
end
|
470
|
+
end
|
471
|
+
end
|
472
|
+
end
|
473
|
+
if s0.last
|
474
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
475
|
+
r0.extend(Config0)
|
476
|
+
r0.extend(Config1)
|
477
|
+
else
|
478
|
+
@index = i0
|
479
|
+
r0 = nil
|
480
|
+
end
|
481
|
+
|
482
|
+
node_cache[:config][start_index] = r0
|
483
|
+
|
484
|
+
r0
|
485
|
+
end
|
486
|
+
|
487
|
+
module ConfigStatementWithWs0
|
488
|
+
def config_statement
|
489
|
+
elements[0]
|
490
|
+
end
|
491
|
+
|
492
|
+
end
|
493
|
+
|
494
|
+
module ConfigStatementWithWs1
|
495
|
+
def to_config_statement(build_state)
|
496
|
+
return config_statement.to_config_statement(build_state)
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
def _nt_config_statement_with_ws
|
501
|
+
start_index = index
|
502
|
+
if node_cache[:config_statement_with_ws].has_key?(index)
|
503
|
+
cached = node_cache[:config_statement_with_ws][index]
|
504
|
+
if cached
|
505
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
506
|
+
@index = cached.interval.end
|
507
|
+
end
|
508
|
+
return cached
|
509
|
+
end
|
510
|
+
|
511
|
+
i0, s0 = index, []
|
512
|
+
r1 = _nt_config_statement
|
513
|
+
s0 << r1
|
514
|
+
if r1
|
515
|
+
s2, i2 = [], index
|
516
|
+
loop do
|
517
|
+
r3 = _nt_ws_or_comment
|
518
|
+
if r3
|
519
|
+
s2 << r3
|
520
|
+
else
|
521
|
+
break
|
522
|
+
end
|
523
|
+
end
|
524
|
+
if s2.empty?
|
525
|
+
@index = i2
|
526
|
+
r2 = nil
|
527
|
+
else
|
528
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
529
|
+
end
|
530
|
+
s0 << r2
|
531
|
+
end
|
532
|
+
if s0.last
|
533
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
534
|
+
r0.extend(ConfigStatementWithWs0)
|
535
|
+
r0.extend(ConfigStatementWithWs1)
|
536
|
+
else
|
537
|
+
@index = i0
|
538
|
+
r0 = nil
|
539
|
+
end
|
540
|
+
|
541
|
+
node_cache[:config_statement_with_ws][start_index] = r0
|
542
|
+
|
543
|
+
r0
|
544
|
+
end
|
545
|
+
|
546
|
+
module Include0
|
547
|
+
def statement_start
|
548
|
+
elements[0]
|
549
|
+
end
|
550
|
+
|
551
|
+
def descriptor_string
|
552
|
+
elements[2]
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
module Include1
|
557
|
+
def to_config_statement(build_state)
|
558
|
+
return build_state.new_include_statement(
|
559
|
+
statement_start, descriptor_string
|
560
|
+
)
|
561
|
+
end
|
562
|
+
end
|
563
|
+
|
564
|
+
def _nt_include
|
565
|
+
start_index = index
|
566
|
+
if node_cache[:include].has_key?(index)
|
567
|
+
cached = node_cache[:include][index]
|
568
|
+
if cached
|
569
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
570
|
+
@index = cached.interval.end
|
571
|
+
end
|
572
|
+
return cached
|
573
|
+
end
|
574
|
+
|
575
|
+
i0, s0 = index, []
|
576
|
+
if has_terminal?('include', false, index)
|
577
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
578
|
+
@index += 7
|
579
|
+
else
|
580
|
+
terminal_parse_failure('include')
|
581
|
+
r1 = nil
|
582
|
+
end
|
583
|
+
s0 << r1
|
584
|
+
if r1
|
585
|
+
s2, i2 = [], index
|
586
|
+
loop do
|
587
|
+
r3 = _nt_ws_or_comment
|
588
|
+
if r3
|
589
|
+
s2 << r3
|
590
|
+
else
|
591
|
+
break
|
592
|
+
end
|
593
|
+
end
|
594
|
+
if s2.empty?
|
595
|
+
@index = i2
|
596
|
+
r2 = nil
|
597
|
+
else
|
598
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
599
|
+
end
|
600
|
+
s0 << r2
|
601
|
+
if r2
|
602
|
+
r4 = _nt_descriptor_string
|
603
|
+
s0 << r4
|
604
|
+
end
|
605
|
+
end
|
606
|
+
if s0.last
|
607
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
608
|
+
r0.extend(Include0)
|
609
|
+
r0.extend(Include1)
|
610
|
+
else
|
611
|
+
@index = i0
|
612
|
+
r0 = nil
|
613
|
+
end
|
614
|
+
|
615
|
+
node_cache[:include][start_index] = r0
|
616
|
+
|
617
|
+
r0
|
618
|
+
end
|
619
|
+
|
620
|
+
module Override0
|
621
|
+
def statement_start
|
622
|
+
elements[0]
|
623
|
+
end
|
624
|
+
|
625
|
+
def descriptor_string
|
626
|
+
elements[2]
|
627
|
+
end
|
628
|
+
end
|
629
|
+
|
630
|
+
module Override1
|
631
|
+
def to_config_statement(build_state)
|
632
|
+
return build_state.new_override_statement(
|
633
|
+
statement_start, descriptor_string
|
634
|
+
)
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
def _nt_override
|
639
|
+
start_index = index
|
640
|
+
if node_cache[:override].has_key?(index)
|
641
|
+
cached = node_cache[:override][index]
|
642
|
+
if cached
|
643
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
644
|
+
@index = cached.interval.end
|
645
|
+
end
|
646
|
+
return cached
|
647
|
+
end
|
648
|
+
|
649
|
+
i0, s0 = index, []
|
650
|
+
if has_terminal?('override', false, index)
|
651
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
|
652
|
+
@index += 8
|
653
|
+
else
|
654
|
+
terminal_parse_failure('override')
|
655
|
+
r1 = nil
|
656
|
+
end
|
657
|
+
s0 << r1
|
658
|
+
if r1
|
659
|
+
s2, i2 = [], index
|
660
|
+
loop do
|
661
|
+
r3 = _nt_ws_or_comment
|
662
|
+
if r3
|
663
|
+
s2 << r3
|
664
|
+
else
|
665
|
+
break
|
666
|
+
end
|
667
|
+
end
|
668
|
+
if s2.empty?
|
669
|
+
@index = i2
|
670
|
+
r2 = nil
|
671
|
+
else
|
672
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
673
|
+
end
|
674
|
+
s0 << r2
|
675
|
+
if r2
|
676
|
+
r4 = _nt_descriptor_string
|
677
|
+
s0 << r4
|
678
|
+
end
|
679
|
+
end
|
680
|
+
if s0.last
|
681
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
682
|
+
r0.extend(Override0)
|
683
|
+
r0.extend(Override1)
|
684
|
+
else
|
685
|
+
@index = i0
|
686
|
+
r0 = nil
|
687
|
+
end
|
688
|
+
|
689
|
+
node_cache[:override][start_index] = r0
|
690
|
+
|
691
|
+
r0
|
692
|
+
end
|
693
|
+
|
694
|
+
module Set0
|
695
|
+
def statement_start
|
696
|
+
elements[0]
|
697
|
+
end
|
698
|
+
|
699
|
+
def environment_variable_name_value
|
700
|
+
elements[2]
|
701
|
+
end
|
702
|
+
end
|
703
|
+
|
704
|
+
module Set1
|
705
|
+
def to_config_statement(build_state)
|
706
|
+
return build_state.new_environment_variable_statement(
|
707
|
+
Statement::Set, statement_start, environment_variable_name_value
|
708
|
+
)
|
709
|
+
end
|
710
|
+
end
|
711
|
+
|
712
|
+
def _nt_set
|
713
|
+
start_index = index
|
714
|
+
if node_cache[:set].has_key?(index)
|
715
|
+
cached = node_cache[:set][index]
|
716
|
+
if cached
|
717
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
718
|
+
@index = cached.interval.end
|
719
|
+
end
|
720
|
+
return cached
|
721
|
+
end
|
722
|
+
|
723
|
+
i0, s0 = index, []
|
724
|
+
if has_terminal?('set', false, index)
|
725
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
726
|
+
@index += 3
|
727
|
+
else
|
728
|
+
terminal_parse_failure('set')
|
729
|
+
r1 = nil
|
730
|
+
end
|
731
|
+
s0 << r1
|
732
|
+
if r1
|
733
|
+
s2, i2 = [], index
|
734
|
+
loop do
|
735
|
+
r3 = _nt_ws_or_comment
|
736
|
+
if r3
|
737
|
+
s2 << r3
|
738
|
+
else
|
739
|
+
break
|
740
|
+
end
|
741
|
+
end
|
742
|
+
if s2.empty?
|
743
|
+
@index = i2
|
744
|
+
r2 = nil
|
745
|
+
else
|
746
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
747
|
+
end
|
748
|
+
s0 << r2
|
749
|
+
if r2
|
750
|
+
r4 = _nt_environment_variable_name_value
|
751
|
+
s0 << r4
|
752
|
+
end
|
753
|
+
end
|
754
|
+
if s0.last
|
755
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
756
|
+
r0.extend(Set0)
|
757
|
+
r0.extend(Set1)
|
758
|
+
else
|
759
|
+
@index = i0
|
760
|
+
r0 = nil
|
761
|
+
end
|
762
|
+
|
763
|
+
node_cache[:set][start_index] = r0
|
764
|
+
|
765
|
+
r0
|
766
|
+
end
|
767
|
+
|
768
|
+
module Path0
|
769
|
+
def statement_start
|
770
|
+
elements[0]
|
771
|
+
end
|
772
|
+
|
773
|
+
def environment_variable_name_value
|
774
|
+
elements[2]
|
775
|
+
end
|
776
|
+
end
|
777
|
+
|
778
|
+
module Path1
|
779
|
+
def to_config_statement(build_state)
|
780
|
+
return build_state.new_environment_variable_statement(
|
781
|
+
Statement::Path, statement_start, environment_variable_name_value
|
782
|
+
)
|
783
|
+
end
|
784
|
+
end
|
785
|
+
|
786
|
+
def _nt_path
|
787
|
+
start_index = index
|
788
|
+
if node_cache[:path].has_key?(index)
|
789
|
+
cached = node_cache[:path][index]
|
790
|
+
if cached
|
791
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
792
|
+
@index = cached.interval.end
|
793
|
+
end
|
794
|
+
return cached
|
795
|
+
end
|
796
|
+
|
797
|
+
i0, s0 = index, []
|
798
|
+
i1 = index
|
799
|
+
if has_terminal?('add', false, index)
|
800
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
801
|
+
@index += 3
|
802
|
+
else
|
803
|
+
terminal_parse_failure('add')
|
804
|
+
r2 = nil
|
805
|
+
end
|
806
|
+
if r2
|
807
|
+
r1 = r2
|
808
|
+
else
|
809
|
+
if has_terminal?('append', false, index)
|
810
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
811
|
+
@index += 6
|
812
|
+
else
|
813
|
+
terminal_parse_failure('append')
|
814
|
+
r3 = nil
|
815
|
+
end
|
816
|
+
if r3
|
817
|
+
r1 = r3
|
818
|
+
else
|
819
|
+
if has_terminal?('path', false, index)
|
820
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
821
|
+
@index += 4
|
822
|
+
else
|
823
|
+
terminal_parse_failure('path')
|
824
|
+
r4 = nil
|
825
|
+
end
|
826
|
+
if r4
|
827
|
+
r1 = r4
|
828
|
+
else
|
829
|
+
@index = i1
|
830
|
+
r1 = nil
|
831
|
+
end
|
832
|
+
end
|
833
|
+
end
|
834
|
+
s0 << r1
|
835
|
+
if r1
|
836
|
+
s5, i5 = [], index
|
837
|
+
loop do
|
838
|
+
r6 = _nt_ws_or_comment
|
839
|
+
if r6
|
840
|
+
s5 << r6
|
841
|
+
else
|
842
|
+
break
|
843
|
+
end
|
844
|
+
end
|
845
|
+
if s5.empty?
|
846
|
+
@index = i5
|
847
|
+
r5 = nil
|
848
|
+
else
|
849
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
850
|
+
end
|
851
|
+
s0 << r5
|
852
|
+
if r5
|
853
|
+
r7 = _nt_environment_variable_name_value
|
854
|
+
s0 << r7
|
855
|
+
end
|
856
|
+
end
|
857
|
+
if s0.last
|
858
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
859
|
+
r0.extend(Path0)
|
860
|
+
r0.extend(Path1)
|
861
|
+
else
|
862
|
+
@index = i0
|
863
|
+
r0 = nil
|
864
|
+
end
|
865
|
+
|
866
|
+
node_cache[:path][start_index] = r0
|
867
|
+
|
868
|
+
r0
|
869
|
+
end
|
870
|
+
|
871
|
+
module Command0
|
872
|
+
def statement_start
|
873
|
+
elements[0]
|
874
|
+
end
|
875
|
+
|
876
|
+
def command_line
|
877
|
+
elements[2]
|
878
|
+
end
|
879
|
+
|
880
|
+
end
|
881
|
+
|
882
|
+
module Command1
|
883
|
+
def to_config_statement(build_state)
|
884
|
+
return build_state.new_v1_command_statement(
|
885
|
+
statement_start, gather_command_argument_nodes(command_line)
|
886
|
+
)
|
887
|
+
end
|
888
|
+
|
889
|
+
def gather_command_argument_nodes(node, arguments = [])
|
890
|
+
if node.respond_to? 'quoted_or_bare_string?'
|
891
|
+
arguments << node
|
892
|
+
return arguments
|
893
|
+
end
|
894
|
+
|
895
|
+
return arguments if not node.elements
|
896
|
+
|
897
|
+
node.elements.each do
|
898
|
+
|element|
|
899
|
+
gather_command_argument_nodes(element, arguments)
|
900
|
+
end
|
901
|
+
|
902
|
+
return arguments
|
903
|
+
end
|
904
|
+
end
|
905
|
+
|
906
|
+
def _nt_command
|
907
|
+
start_index = index
|
908
|
+
if node_cache[:command].has_key?(index)
|
909
|
+
cached = node_cache[:command][index]
|
910
|
+
if cached
|
911
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
912
|
+
@index = cached.interval.end
|
913
|
+
end
|
914
|
+
return cached
|
915
|
+
end
|
916
|
+
|
917
|
+
i0, s0 = index, []
|
918
|
+
if has_terminal?('command', false, index)
|
919
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
920
|
+
@index += 7
|
921
|
+
else
|
922
|
+
terminal_parse_failure('command')
|
923
|
+
r1 = nil
|
924
|
+
end
|
925
|
+
s0 << r1
|
926
|
+
if r1
|
927
|
+
s2, i2 = [], index
|
928
|
+
loop do
|
929
|
+
r3 = _nt_ws_or_comment
|
930
|
+
if r3
|
931
|
+
s2 << r3
|
932
|
+
else
|
933
|
+
break
|
934
|
+
end
|
935
|
+
end
|
936
|
+
if s2.empty?
|
937
|
+
@index = i2
|
938
|
+
r2 = nil
|
939
|
+
else
|
940
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
941
|
+
end
|
942
|
+
s0 << r2
|
943
|
+
if r2
|
944
|
+
r4 = _nt_command_line
|
945
|
+
s0 << r4
|
946
|
+
if r4
|
947
|
+
s5, i5 = [], index
|
948
|
+
loop do
|
949
|
+
r6 = _nt_ws_or_comment
|
950
|
+
if r6
|
951
|
+
s5 << r6
|
952
|
+
else
|
953
|
+
break
|
954
|
+
end
|
955
|
+
end
|
956
|
+
if s5.empty?
|
957
|
+
@index = i5
|
958
|
+
r5 = nil
|
959
|
+
else
|
960
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
961
|
+
end
|
962
|
+
s0 << r5
|
963
|
+
if r5
|
964
|
+
if has_terminal?('end', false, index)
|
965
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
966
|
+
@index += 3
|
967
|
+
else
|
968
|
+
terminal_parse_failure('end')
|
969
|
+
r7 = nil
|
970
|
+
end
|
971
|
+
s0 << r7
|
972
|
+
end
|
973
|
+
end
|
974
|
+
end
|
975
|
+
end
|
976
|
+
if s0.last
|
977
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
978
|
+
r0.extend(Command0)
|
979
|
+
r0.extend(Command1)
|
980
|
+
else
|
981
|
+
@index = i0
|
982
|
+
r0 = nil
|
983
|
+
end
|
984
|
+
|
985
|
+
node_cache[:command][start_index] = r0
|
986
|
+
|
987
|
+
r0
|
988
|
+
end
|
989
|
+
|
990
|
+
module CommandLine0
|
991
|
+
def quoted_or_bare_string
|
992
|
+
elements[1]
|
993
|
+
end
|
994
|
+
|
995
|
+
end
|
996
|
+
|
997
|
+
module CommandLine1
|
998
|
+
def quoted_or_bare_string
|
999
|
+
elements[0]
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
def _nt_command_line
|
1005
|
+
start_index = index
|
1006
|
+
if node_cache[:command_line].has_key?(index)
|
1007
|
+
cached = node_cache[:command_line][index]
|
1008
|
+
if cached
|
1009
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1010
|
+
@index = cached.interval.end
|
1011
|
+
end
|
1012
|
+
return cached
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
i0, s0 = index, []
|
1016
|
+
r1 = _nt_quoted_or_bare_string
|
1017
|
+
s0 << r1
|
1018
|
+
if r1
|
1019
|
+
i2 = index
|
1020
|
+
r3 = lambda { |sequence| sequence[-1].text_value == 'end' }.call(s0)
|
1021
|
+
if r3
|
1022
|
+
r2 = nil
|
1023
|
+
else
|
1024
|
+
@index = i2
|
1025
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
1026
|
+
end
|
1027
|
+
s0 << r2
|
1028
|
+
if r2
|
1029
|
+
s4, i4 = [], index
|
1030
|
+
loop do
|
1031
|
+
i5, s5 = index, []
|
1032
|
+
s6, i6 = [], index
|
1033
|
+
loop do
|
1034
|
+
r7 = _nt_ws_or_comment
|
1035
|
+
if r7
|
1036
|
+
s6 << r7
|
1037
|
+
else
|
1038
|
+
break
|
1039
|
+
end
|
1040
|
+
end
|
1041
|
+
if s6.empty?
|
1042
|
+
@index = i6
|
1043
|
+
r6 = nil
|
1044
|
+
else
|
1045
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
1046
|
+
end
|
1047
|
+
s5 << r6
|
1048
|
+
if r6
|
1049
|
+
r8 = _nt_quoted_or_bare_string
|
1050
|
+
s5 << r8
|
1051
|
+
if r8
|
1052
|
+
i9 = index
|
1053
|
+
r10 = lambda { |sequence| sequence[-1].text_value == 'end' }.call(s5)
|
1054
|
+
if r10
|
1055
|
+
r9 = nil
|
1056
|
+
else
|
1057
|
+
@index = i9
|
1058
|
+
r9 = instantiate_node(SyntaxNode,input, index...index)
|
1059
|
+
end
|
1060
|
+
s5 << r9
|
1061
|
+
end
|
1062
|
+
end
|
1063
|
+
if s5.last
|
1064
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1065
|
+
r5.extend(CommandLine0)
|
1066
|
+
else
|
1067
|
+
@index = i5
|
1068
|
+
r5 = nil
|
1069
|
+
end
|
1070
|
+
if r5
|
1071
|
+
s4 << r5
|
1072
|
+
else
|
1073
|
+
break
|
1074
|
+
end
|
1075
|
+
end
|
1076
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
1077
|
+
s0 << r4
|
1078
|
+
end
|
1079
|
+
end
|
1080
|
+
if s0.last
|
1081
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1082
|
+
r0.extend(CommandLine1)
|
1083
|
+
else
|
1084
|
+
@index = i0
|
1085
|
+
r0 = nil
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
node_cache[:command_line][start_index] = r0
|
1089
|
+
|
1090
|
+
r0
|
1091
|
+
end
|
1092
|
+
|
1093
|
+
def _nt_descriptor_string
|
1094
|
+
start_index = index
|
1095
|
+
if node_cache[:descriptor_string].has_key?(index)
|
1096
|
+
cached = node_cache[:descriptor_string][index]
|
1097
|
+
if cached
|
1098
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1099
|
+
@index = cached.interval.end
|
1100
|
+
end
|
1101
|
+
return cached
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
s0, i0 = [], index
|
1105
|
+
loop do
|
1106
|
+
if has_terminal?('\G[^\\s#]', true, index)
|
1107
|
+
r1 = true
|
1108
|
+
@index += 1
|
1109
|
+
else
|
1110
|
+
r1 = nil
|
1111
|
+
end
|
1112
|
+
if r1
|
1113
|
+
s0 << r1
|
1114
|
+
else
|
1115
|
+
break
|
1116
|
+
end
|
1117
|
+
end
|
1118
|
+
if s0.empty?
|
1119
|
+
@index = i0
|
1120
|
+
r0 = nil
|
1121
|
+
else
|
1122
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
node_cache[:descriptor_string][start_index] = r0
|
1126
|
+
|
1127
|
+
r0
|
1128
|
+
end
|
1129
|
+
|
1130
|
+
def _nt_config_name
|
1131
|
+
start_index = index
|
1132
|
+
if node_cache[:config_name].has_key?(index)
|
1133
|
+
cached = node_cache[:config_name][index]
|
1134
|
+
if cached
|
1135
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1136
|
+
@index = cached.interval.end
|
1137
|
+
end
|
1138
|
+
return cached
|
1139
|
+
end
|
1140
|
+
|
1141
|
+
s0, i0 = [], index
|
1142
|
+
loop do
|
1143
|
+
if has_terminal?('\G[a-zA-Z0-9_.-]', true, index)
|
1144
|
+
r1 = true
|
1145
|
+
@index += 1
|
1146
|
+
else
|
1147
|
+
r1 = nil
|
1148
|
+
end
|
1149
|
+
if r1
|
1150
|
+
s0 << r1
|
1151
|
+
else
|
1152
|
+
break
|
1153
|
+
end
|
1154
|
+
end
|
1155
|
+
if s0.empty?
|
1156
|
+
@index = i0
|
1157
|
+
r0 = nil
|
1158
|
+
else
|
1159
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1160
|
+
end
|
1161
|
+
|
1162
|
+
node_cache[:config_name][start_index] = r0
|
1163
|
+
|
1164
|
+
r0
|
1165
|
+
end
|
1166
|
+
|
1167
|
+
module QuotedOrBareString0
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
module QuotedOrBareString1
|
1171
|
+
end
|
1172
|
+
|
1173
|
+
module QuotedOrBareString2
|
1174
|
+
def quoted_or_bare_string?() return true end
|
1175
|
+
end
|
1176
|
+
|
1177
|
+
module QuotedOrBareString3
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
module QuotedOrBareString4
|
1181
|
+
end
|
1182
|
+
|
1183
|
+
module QuotedOrBareString5
|
1184
|
+
def quoted_or_bare_string?() return true end
|
1185
|
+
end
|
1186
|
+
|
1187
|
+
module QuotedOrBareString6
|
1188
|
+
def quoted_or_bare_string?() return true end
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
def _nt_quoted_or_bare_string
|
1192
|
+
start_index = index
|
1193
|
+
if node_cache[:quoted_or_bare_string].has_key?(index)
|
1194
|
+
cached = node_cache[:quoted_or_bare_string][index]
|
1195
|
+
if cached
|
1196
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1197
|
+
@index = cached.interval.end
|
1198
|
+
end
|
1199
|
+
return cached
|
1200
|
+
end
|
1201
|
+
|
1202
|
+
i0 = index
|
1203
|
+
i1, s1 = index, []
|
1204
|
+
s2, i2 = [], index
|
1205
|
+
loop do
|
1206
|
+
if has_terminal?('\G[^\\s#\\\\"]', true, index)
|
1207
|
+
r3 = true
|
1208
|
+
@index += 1
|
1209
|
+
else
|
1210
|
+
r3 = nil
|
1211
|
+
end
|
1212
|
+
if r3
|
1213
|
+
s2 << r3
|
1214
|
+
else
|
1215
|
+
break
|
1216
|
+
end
|
1217
|
+
end
|
1218
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1219
|
+
s1 << r2
|
1220
|
+
if r2
|
1221
|
+
if has_terminal?('"', false, index)
|
1222
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1223
|
+
@index += 1
|
1224
|
+
else
|
1225
|
+
terminal_parse_failure('"')
|
1226
|
+
r4 = nil
|
1227
|
+
end
|
1228
|
+
s1 << r4
|
1229
|
+
if r4
|
1230
|
+
s5, i5 = [], index
|
1231
|
+
loop do
|
1232
|
+
i6 = index
|
1233
|
+
if has_terminal?('\G[^"\\\\]', true, index)
|
1234
|
+
r7 = true
|
1235
|
+
@index += 1
|
1236
|
+
else
|
1237
|
+
r7 = nil
|
1238
|
+
end
|
1239
|
+
if r7
|
1240
|
+
r6 = r7
|
1241
|
+
else
|
1242
|
+
i8, s8 = index, []
|
1243
|
+
if has_terminal?('\\', false, index)
|
1244
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1245
|
+
@index += 1
|
1246
|
+
else
|
1247
|
+
terminal_parse_failure('\\')
|
1248
|
+
r9 = nil
|
1249
|
+
end
|
1250
|
+
s8 << r9
|
1251
|
+
if r9
|
1252
|
+
if index < input_length
|
1253
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1254
|
+
@index += 1
|
1255
|
+
else
|
1256
|
+
terminal_parse_failure("any character")
|
1257
|
+
r10 = nil
|
1258
|
+
end
|
1259
|
+
s8 << r10
|
1260
|
+
end
|
1261
|
+
if s8.last
|
1262
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
1263
|
+
r8.extend(QuotedOrBareString0)
|
1264
|
+
else
|
1265
|
+
@index = i8
|
1266
|
+
r8 = nil
|
1267
|
+
end
|
1268
|
+
if r8
|
1269
|
+
r6 = r8
|
1270
|
+
else
|
1271
|
+
@index = i6
|
1272
|
+
r6 = nil
|
1273
|
+
end
|
1274
|
+
end
|
1275
|
+
if r6
|
1276
|
+
s5 << r6
|
1277
|
+
else
|
1278
|
+
break
|
1279
|
+
end
|
1280
|
+
end
|
1281
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1282
|
+
s1 << r5
|
1283
|
+
if r5
|
1284
|
+
if has_terminal?('"', false, index)
|
1285
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1286
|
+
@index += 1
|
1287
|
+
else
|
1288
|
+
terminal_parse_failure('"')
|
1289
|
+
r11 = nil
|
1290
|
+
end
|
1291
|
+
s1 << r11
|
1292
|
+
end
|
1293
|
+
end
|
1294
|
+
end
|
1295
|
+
if s1.last
|
1296
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1297
|
+
r1.extend(QuotedOrBareString1)
|
1298
|
+
r1.extend(QuotedOrBareString2)
|
1299
|
+
else
|
1300
|
+
@index = i1
|
1301
|
+
r1 = nil
|
1302
|
+
end
|
1303
|
+
if r1
|
1304
|
+
r0 = r1
|
1305
|
+
else
|
1306
|
+
i12, s12 = index, []
|
1307
|
+
s13, i13 = [], index
|
1308
|
+
loop do
|
1309
|
+
if has_terminal?('\G[^\\s#\\\\\']', true, index)
|
1310
|
+
r14 = true
|
1311
|
+
@index += 1
|
1312
|
+
else
|
1313
|
+
r14 = nil
|
1314
|
+
end
|
1315
|
+
if r14
|
1316
|
+
s13 << r14
|
1317
|
+
else
|
1318
|
+
break
|
1319
|
+
end
|
1320
|
+
end
|
1321
|
+
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
1322
|
+
s12 << r13
|
1323
|
+
if r13
|
1324
|
+
if has_terminal?("'", false, index)
|
1325
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1326
|
+
@index += 1
|
1327
|
+
else
|
1328
|
+
terminal_parse_failure("'")
|
1329
|
+
r15 = nil
|
1330
|
+
end
|
1331
|
+
s12 << r15
|
1332
|
+
if r15
|
1333
|
+
s16, i16 = [], index
|
1334
|
+
loop do
|
1335
|
+
i17 = index
|
1336
|
+
if has_terminal?('\G[^\'\\\\]', true, index)
|
1337
|
+
r18 = true
|
1338
|
+
@index += 1
|
1339
|
+
else
|
1340
|
+
r18 = nil
|
1341
|
+
end
|
1342
|
+
if r18
|
1343
|
+
r17 = r18
|
1344
|
+
else
|
1345
|
+
i19, s19 = index, []
|
1346
|
+
if has_terminal?('\\', false, index)
|
1347
|
+
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1348
|
+
@index += 1
|
1349
|
+
else
|
1350
|
+
terminal_parse_failure('\\')
|
1351
|
+
r20 = nil
|
1352
|
+
end
|
1353
|
+
s19 << r20
|
1354
|
+
if r20
|
1355
|
+
if index < input_length
|
1356
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1357
|
+
@index += 1
|
1358
|
+
else
|
1359
|
+
terminal_parse_failure("any character")
|
1360
|
+
r21 = nil
|
1361
|
+
end
|
1362
|
+
s19 << r21
|
1363
|
+
end
|
1364
|
+
if s19.last
|
1365
|
+
r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
|
1366
|
+
r19.extend(QuotedOrBareString3)
|
1367
|
+
else
|
1368
|
+
@index = i19
|
1369
|
+
r19 = nil
|
1370
|
+
end
|
1371
|
+
if r19
|
1372
|
+
r17 = r19
|
1373
|
+
else
|
1374
|
+
@index = i17
|
1375
|
+
r17 = nil
|
1376
|
+
end
|
1377
|
+
end
|
1378
|
+
if r17
|
1379
|
+
s16 << r17
|
1380
|
+
else
|
1381
|
+
break
|
1382
|
+
end
|
1383
|
+
end
|
1384
|
+
r16 = instantiate_node(SyntaxNode,input, i16...index, s16)
|
1385
|
+
s12 << r16
|
1386
|
+
if r16
|
1387
|
+
if has_terminal?("'", false, index)
|
1388
|
+
r22 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1389
|
+
@index += 1
|
1390
|
+
else
|
1391
|
+
terminal_parse_failure("'")
|
1392
|
+
r22 = nil
|
1393
|
+
end
|
1394
|
+
s12 << r22
|
1395
|
+
end
|
1396
|
+
end
|
1397
|
+
end
|
1398
|
+
if s12.last
|
1399
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
1400
|
+
r12.extend(QuotedOrBareString4)
|
1401
|
+
r12.extend(QuotedOrBareString5)
|
1402
|
+
else
|
1403
|
+
@index = i12
|
1404
|
+
r12 = nil
|
1405
|
+
end
|
1406
|
+
if r12
|
1407
|
+
r0 = r12
|
1408
|
+
else
|
1409
|
+
s23, i23 = [], index
|
1410
|
+
loop do
|
1411
|
+
if has_terminal?('\G[^\\s#]', true, index)
|
1412
|
+
r24 = true
|
1413
|
+
@index += 1
|
1414
|
+
else
|
1415
|
+
r24 = nil
|
1416
|
+
end
|
1417
|
+
if r24
|
1418
|
+
s23 << r24
|
1419
|
+
else
|
1420
|
+
break
|
1421
|
+
end
|
1422
|
+
end
|
1423
|
+
if s23.empty?
|
1424
|
+
@index = i23
|
1425
|
+
r23 = nil
|
1426
|
+
else
|
1427
|
+
r23 = instantiate_node(SyntaxNode,input, i23...index, s23)
|
1428
|
+
r23.extend(QuotedOrBareString6)
|
1429
|
+
end
|
1430
|
+
if r23
|
1431
|
+
r0 = r23
|
1432
|
+
else
|
1433
|
+
@index = i0
|
1434
|
+
r0 = nil
|
1435
|
+
end
|
1436
|
+
end
|
1437
|
+
end
|
1438
|
+
|
1439
|
+
node_cache[:quoted_or_bare_string][start_index] = r0
|
1440
|
+
|
1441
|
+
r0
|
1442
|
+
end
|
1443
|
+
|
1444
|
+
def _nt_environment_variable_name
|
1445
|
+
start_index = index
|
1446
|
+
if node_cache[:environment_variable_name].has_key?(index)
|
1447
|
+
cached = node_cache[:environment_variable_name][index]
|
1448
|
+
if cached
|
1449
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1450
|
+
@index = cached.interval.end
|
1451
|
+
end
|
1452
|
+
return cached
|
1453
|
+
end
|
1454
|
+
|
1455
|
+
s0, i0 = [], index
|
1456
|
+
loop do
|
1457
|
+
if has_terminal?('\G[a-zA-Z0-9_]', true, index)
|
1458
|
+
r1 = true
|
1459
|
+
@index += 1
|
1460
|
+
else
|
1461
|
+
r1 = nil
|
1462
|
+
end
|
1463
|
+
if r1
|
1464
|
+
s0 << r1
|
1465
|
+
else
|
1466
|
+
break
|
1467
|
+
end
|
1468
|
+
end
|
1469
|
+
if s0.empty?
|
1470
|
+
@index = i0
|
1471
|
+
r0 = nil
|
1472
|
+
else
|
1473
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
node_cache[:environment_variable_name][start_index] = r0
|
1477
|
+
|
1478
|
+
r0
|
1479
|
+
end
|
1480
|
+
|
1481
|
+
module EnvironmentVariableNameValue0
|
1482
|
+
end
|
1483
|
+
|
1484
|
+
module EnvironmentVariableNameValue1
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
module EnvironmentVariableNameValue2
|
1488
|
+
end
|
1489
|
+
|
1490
|
+
module EnvironmentVariableNameValue3
|
1491
|
+
end
|
1492
|
+
|
1493
|
+
def _nt_environment_variable_name_value
|
1494
|
+
start_index = index
|
1495
|
+
if node_cache[:environment_variable_name_value].has_key?(index)
|
1496
|
+
cached = node_cache[:environment_variable_name_value][index]
|
1497
|
+
if cached
|
1498
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1499
|
+
@index = cached.interval.end
|
1500
|
+
end
|
1501
|
+
return cached
|
1502
|
+
end
|
1503
|
+
|
1504
|
+
i0 = index
|
1505
|
+
i1, s1 = index, []
|
1506
|
+
s2, i2 = [], index
|
1507
|
+
loop do
|
1508
|
+
if has_terminal?('\G[^\\s#\\\\\'"]', true, index)
|
1509
|
+
r3 = true
|
1510
|
+
@index += 1
|
1511
|
+
else
|
1512
|
+
r3 = nil
|
1513
|
+
end
|
1514
|
+
if r3
|
1515
|
+
s2 << r3
|
1516
|
+
else
|
1517
|
+
break
|
1518
|
+
end
|
1519
|
+
end
|
1520
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1521
|
+
s1 << r2
|
1522
|
+
if r2
|
1523
|
+
if has_terminal?('"', false, index)
|
1524
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1525
|
+
@index += 1
|
1526
|
+
else
|
1527
|
+
terminal_parse_failure('"')
|
1528
|
+
r4 = nil
|
1529
|
+
end
|
1530
|
+
s1 << r4
|
1531
|
+
if r4
|
1532
|
+
s5, i5 = [], index
|
1533
|
+
loop do
|
1534
|
+
i6 = index
|
1535
|
+
if has_terminal?('\G[^"\\\\]', true, index)
|
1536
|
+
r7 = true
|
1537
|
+
@index += 1
|
1538
|
+
else
|
1539
|
+
r7 = nil
|
1540
|
+
end
|
1541
|
+
if r7
|
1542
|
+
r6 = r7
|
1543
|
+
else
|
1544
|
+
i8, s8 = index, []
|
1545
|
+
if has_terminal?('\\', false, index)
|
1546
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1547
|
+
@index += 1
|
1548
|
+
else
|
1549
|
+
terminal_parse_failure('\\')
|
1550
|
+
r9 = nil
|
1551
|
+
end
|
1552
|
+
s8 << r9
|
1553
|
+
if r9
|
1554
|
+
if index < input_length
|
1555
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1556
|
+
@index += 1
|
1557
|
+
else
|
1558
|
+
terminal_parse_failure("any character")
|
1559
|
+
r10 = nil
|
1560
|
+
end
|
1561
|
+
s8 << r10
|
1562
|
+
end
|
1563
|
+
if s8.last
|
1564
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
1565
|
+
r8.extend(EnvironmentVariableNameValue0)
|
1566
|
+
else
|
1567
|
+
@index = i8
|
1568
|
+
r8 = nil
|
1569
|
+
end
|
1570
|
+
if r8
|
1571
|
+
r6 = r8
|
1572
|
+
else
|
1573
|
+
@index = i6
|
1574
|
+
r6 = nil
|
1575
|
+
end
|
1576
|
+
end
|
1577
|
+
if r6
|
1578
|
+
s5 << r6
|
1579
|
+
else
|
1580
|
+
break
|
1581
|
+
end
|
1582
|
+
end
|
1583
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1584
|
+
s1 << r5
|
1585
|
+
if r5
|
1586
|
+
if has_terminal?('"', false, index)
|
1587
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1588
|
+
@index += 1
|
1589
|
+
else
|
1590
|
+
terminal_parse_failure('"')
|
1591
|
+
r11 = nil
|
1592
|
+
end
|
1593
|
+
s1 << r11
|
1594
|
+
end
|
1595
|
+
end
|
1596
|
+
end
|
1597
|
+
if s1.last
|
1598
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1599
|
+
r1.extend(EnvironmentVariableNameValue1)
|
1600
|
+
else
|
1601
|
+
@index = i1
|
1602
|
+
r1 = nil
|
1603
|
+
end
|
1604
|
+
if r1
|
1605
|
+
r0 = r1
|
1606
|
+
else
|
1607
|
+
i12, s12 = index, []
|
1608
|
+
s13, i13 = [], index
|
1609
|
+
loop do
|
1610
|
+
if has_terminal?('\G[^\\s#\\\\\'"]', true, index)
|
1611
|
+
r14 = true
|
1612
|
+
@index += 1
|
1613
|
+
else
|
1614
|
+
r14 = nil
|
1615
|
+
end
|
1616
|
+
if r14
|
1617
|
+
s13 << r14
|
1618
|
+
else
|
1619
|
+
break
|
1620
|
+
end
|
1621
|
+
end
|
1622
|
+
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
1623
|
+
s12 << r13
|
1624
|
+
if r13
|
1625
|
+
if has_terminal?("'", false, index)
|
1626
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1627
|
+
@index += 1
|
1628
|
+
else
|
1629
|
+
terminal_parse_failure("'")
|
1630
|
+
r15 = nil
|
1631
|
+
end
|
1632
|
+
s12 << r15
|
1633
|
+
if r15
|
1634
|
+
s16, i16 = [], index
|
1635
|
+
loop do
|
1636
|
+
i17 = index
|
1637
|
+
if has_terminal?('\G[^\'\\\\]', true, index)
|
1638
|
+
r18 = true
|
1639
|
+
@index += 1
|
1640
|
+
else
|
1641
|
+
r18 = nil
|
1642
|
+
end
|
1643
|
+
if r18
|
1644
|
+
r17 = r18
|
1645
|
+
else
|
1646
|
+
i19, s19 = index, []
|
1647
|
+
if has_terminal?('\\', false, index)
|
1648
|
+
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1649
|
+
@index += 1
|
1650
|
+
else
|
1651
|
+
terminal_parse_failure('\\')
|
1652
|
+
r20 = nil
|
1653
|
+
end
|
1654
|
+
s19 << r20
|
1655
|
+
if r20
|
1656
|
+
if index < input_length
|
1657
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1658
|
+
@index += 1
|
1659
|
+
else
|
1660
|
+
terminal_parse_failure("any character")
|
1661
|
+
r21 = nil
|
1662
|
+
end
|
1663
|
+
s19 << r21
|
1664
|
+
end
|
1665
|
+
if s19.last
|
1666
|
+
r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
|
1667
|
+
r19.extend(EnvironmentVariableNameValue2)
|
1668
|
+
else
|
1669
|
+
@index = i19
|
1670
|
+
r19 = nil
|
1671
|
+
end
|
1672
|
+
if r19
|
1673
|
+
r17 = r19
|
1674
|
+
else
|
1675
|
+
@index = i17
|
1676
|
+
r17 = nil
|
1677
|
+
end
|
1678
|
+
end
|
1679
|
+
if r17
|
1680
|
+
s16 << r17
|
1681
|
+
else
|
1682
|
+
break
|
1683
|
+
end
|
1684
|
+
end
|
1685
|
+
r16 = instantiate_node(SyntaxNode,input, i16...index, s16)
|
1686
|
+
s12 << r16
|
1687
|
+
if r16
|
1688
|
+
if has_terminal?("'", false, index)
|
1689
|
+
r22 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1690
|
+
@index += 1
|
1691
|
+
else
|
1692
|
+
terminal_parse_failure("'")
|
1693
|
+
r22 = nil
|
1694
|
+
end
|
1695
|
+
s12 << r22
|
1696
|
+
end
|
1697
|
+
end
|
1698
|
+
end
|
1699
|
+
if s12.last
|
1700
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
1701
|
+
r12.extend(EnvironmentVariableNameValue3)
|
1702
|
+
else
|
1703
|
+
@index = i12
|
1704
|
+
r12 = nil
|
1705
|
+
end
|
1706
|
+
if r12
|
1707
|
+
r0 = r12
|
1708
|
+
else
|
1709
|
+
s23, i23 = [], index
|
1710
|
+
loop do
|
1711
|
+
if has_terminal?('\G[^\\s#]', true, index)
|
1712
|
+
r24 = true
|
1713
|
+
@index += 1
|
1714
|
+
else
|
1715
|
+
r24 = nil
|
1716
|
+
end
|
1717
|
+
if r24
|
1718
|
+
s23 << r24
|
1719
|
+
else
|
1720
|
+
break
|
1721
|
+
end
|
1722
|
+
end
|
1723
|
+
if s23.empty?
|
1724
|
+
@index = i23
|
1725
|
+
r23 = nil
|
1726
|
+
else
|
1727
|
+
r23 = instantiate_node(SyntaxNode,input, i23...index, s23)
|
1728
|
+
end
|
1729
|
+
if r23
|
1730
|
+
r0 = r23
|
1731
|
+
else
|
1732
|
+
@index = i0
|
1733
|
+
r0 = nil
|
1734
|
+
end
|
1735
|
+
end
|
1736
|
+
end
|
1737
|
+
|
1738
|
+
node_cache[:environment_variable_name_value][start_index] = r0
|
1739
|
+
|
1740
|
+
r0
|
1741
|
+
end
|
1742
|
+
|
1743
|
+
end
|
1744
|
+
|
1745
|
+
class V1BaseParser < Treetop::Runtime::CompiledParser
|
1746
|
+
include V1Base
|
1747
|
+
end
|
1748
|
+
|
1749
|
+
end
|
1750
|
+
end
|