fig 0.1.76 → 0.1.77

Sign up to get free protection for your applications and to get access to all the features.
data/Changes CHANGED
@@ -1,3 +1,43 @@
1
+ v0.1.77
2
+
3
+ Bug fixes:
4
+
5
+ - Fix for the case where the value of an environment variable statement is
6
+ the path to a symlink when a retrieve is in effect. Note that retrieves of
7
+ symlinks will be copied as the target of the symlink and not as the
8
+ symlink; however, if the retrieve is of a directory which contains
9
+ symlinks, those symlinks will be copied as symlinks.
10
+
11
+ If we have a package.fig that looks like
12
+
13
+ retrieve SOMEPATH->somewhere
14
+ config default
15
+ include foo/57
16
+ end
17
+
18
+ and the contents of the "foo" package look like
19
+
20
+ config default
21
+ set SOMEPATH=a_symlink
22
+ end
23
+
24
+ then the target of "a_symlink" will be copied to "somewhere" as the type of
25
+ the target (i.e. a file or directory). If, however, the contents of the
26
+ "foo" package look like
27
+
28
+ config default
29
+ set SOMEPATH=a_directory
30
+ end
31
+
32
+ and "a_directory" contains a symlink named "another_symlink", then
33
+ "another_symlink" will be copied to "somewhere" as a symlink.
34
+
35
+ - Retrieves of symlinks will not occur if the symlink was previously
36
+ retrieved. Previously, if you updates the same package multiple times and
37
+ that package contained symlinks, the symlinks would be recreated on every
38
+ update, even though the regular files would not.
39
+
40
+
1
41
  v0.1.76
2
42
 
3
43
  New features:
data/lib/fig.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fig
2
- VERSION = '0.1.76'
2
+ VERSION = '0.1.77'
3
3
  end
@@ -0,0 +1,162 @@
1
+ # Autogenerated from a Treetop grammar. Edits may be lost.
2
+
3
+
4
+ # The asset location stuff is broken out from the v0 grammar proper because
5
+ # having a rule within a file makes it the root of the grammar, which causes
6
+ # initialization issues in the generated Ruby code. So, the v0-specific asset
7
+ # stuff is in a separate file and the v0 grammar proper simply includes
8
+ # everything it needs.
9
+
10
+ require 'treetop'
11
+
12
+ module Fig
13
+ module Grammar
14
+ module V0AssetLocation
15
+ include Treetop::Runtime
16
+
17
+ def root
18
+ @root ||= :asset_location
19
+ end
20
+
21
+ module AssetLocation0
22
+ def location
23
+ elements[0]
24
+ end
25
+
26
+ def ws
27
+ elements[1]
28
+ end
29
+ end
30
+
31
+ module AssetLocation1
32
+ def location
33
+ elements[1]
34
+ end
35
+
36
+ def ws
37
+ elements[3]
38
+ end
39
+ end
40
+
41
+ def _nt_asset_location
42
+ start_index = index
43
+ if node_cache[:asset_location].has_key?(index)
44
+ cached = node_cache[:asset_location][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 = index
53
+ i1, s1 = index, []
54
+ s2, i2 = [], index
55
+ loop do
56
+ if has_terminal?('\G[^@\'"<>|\\s]', true, index)
57
+ r3 = true
58
+ @index += 1
59
+ else
60
+ r3 = nil
61
+ end
62
+ if r3
63
+ s2 << r3
64
+ else
65
+ break
66
+ end
67
+ end
68
+ if s2.empty?
69
+ @index = i2
70
+ r2 = nil
71
+ else
72
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
73
+ end
74
+ s1 << r2
75
+ if r2
76
+ r4 = _nt_ws
77
+ s1 << r4
78
+ end
79
+ if s1.last
80
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
81
+ r1.extend(AssetLocation0)
82
+ else
83
+ @index = i1
84
+ r1 = nil
85
+ end
86
+ if r1
87
+ r0 = r1
88
+ else
89
+ i5, s5 = index, []
90
+ if has_terminal?('"', false, index)
91
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
92
+ @index += 1
93
+ else
94
+ terminal_parse_failure('"')
95
+ r6 = nil
96
+ end
97
+ s5 << r6
98
+ if r6
99
+ s7, i7 = [], index
100
+ loop do
101
+ if has_terminal?('\G[^@\'"<>|*?\\[\\]{}\\s]', true, index)
102
+ r8 = true
103
+ @index += 1
104
+ else
105
+ r8 = nil
106
+ end
107
+ if r8
108
+ s7 << r8
109
+ else
110
+ break
111
+ end
112
+ end
113
+ if s7.empty?
114
+ @index = i7
115
+ r7 = nil
116
+ else
117
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
118
+ end
119
+ s5 << r7
120
+ if r7
121
+ if has_terminal?('"', false, index)
122
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
123
+ @index += 1
124
+ else
125
+ terminal_parse_failure('"')
126
+ r9 = nil
127
+ end
128
+ s5 << r9
129
+ if r9
130
+ r10 = _nt_ws
131
+ s5 << r10
132
+ end
133
+ end
134
+ end
135
+ if s5.last
136
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
137
+ r5.extend(AssetLocation1)
138
+ else
139
+ @index = i5
140
+ r5 = nil
141
+ end
142
+ if r5
143
+ r0 = r5
144
+ else
145
+ @index = i0
146
+ r0 = nil
147
+ end
148
+ end
149
+
150
+ node_cache[:asset_location][start_index] = r0
151
+
152
+ r0
153
+ end
154
+
155
+ end
156
+
157
+ class V0AssetLocationParser < Treetop::Runtime::CompiledParser
158
+ include V0AssetLocation
159
+ end
160
+
161
+ end
162
+ end
@@ -0,0 +1,1356 @@
1
+ # Autogenerated from a Treetop grammar. Edits may be lost.
2
+
3
+
4
+ # Treetop (http://treetop.rubyforge.org/) grammar for package definitions from
5
+ # the early days, which we're calling v0. Since we're making a slight
6
+ # incompatibility in asset locations, v1 is being used as a "gentle
7
+ # introduction" to the concept of multiple grammar versions. Since v0 and v1
8
+ # are so close, this is everything from the early grammar other than the asset
9
+ # location.
10
+
11
+ # Some aspects of this grammar are significantly dumber than they could be
12
+ # because:
13
+ #
14
+ # * We want to treat statements as identically as possible to their
15
+ # command-line equivalents.
16
+ # * Treetop parse errors are pretty inscrutable at times and we can make
17
+ # error messages clearer by validating a lot of the terminals ourselves.
18
+
19
+ require 'treetop'
20
+
21
+ module Fig
22
+ module Grammar
23
+ module V0Ish
24
+ include Treetop::Runtime
25
+
26
+ def root
27
+ @root ||= :package
28
+ end
29
+
30
+ module Package0
31
+ def optional_ws1
32
+ elements[0]
33
+ end
34
+
35
+ def grammar_version
36
+ elements[1]
37
+ end
38
+
39
+ def statements
40
+ elements[3]
41
+ end
42
+
43
+ def optional_ws2
44
+ elements[4]
45
+ end
46
+ end
47
+
48
+ module Package1
49
+ def to_package(directory, build_state)
50
+ return build_state.new_package_statement(
51
+ directory, grammar_version, statements
52
+ )
53
+ end
54
+ end
55
+
56
+ def _nt_package
57
+ start_index = index
58
+ if node_cache[:package].has_key?(index)
59
+ cached = node_cache[:package][index]
60
+ if cached
61
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
62
+ @index = cached.interval.end
63
+ end
64
+ return cached
65
+ end
66
+
67
+ i0, s0 = index, []
68
+ r1 = _nt_optional_ws
69
+ s0 << r1
70
+ if r1
71
+ r3 = _nt_grammar_version
72
+ if r3
73
+ r2 = r3
74
+ else
75
+ r2 = instantiate_node(SyntaxNode,input, index...index)
76
+ end
77
+ s0 << r2
78
+ if r2
79
+ s4, i4 = [], index
80
+ loop do
81
+ r5 = _nt_ws
82
+ if r5
83
+ s4 << r5
84
+ else
85
+ break
86
+ end
87
+ end
88
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
89
+ s0 << r4
90
+ if r4
91
+ s6, i6 = [], index
92
+ loop do
93
+ r7 = _nt_package_statement
94
+ if r7
95
+ s6 << r7
96
+ else
97
+ break
98
+ end
99
+ end
100
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
101
+ s0 << r6
102
+ if r6
103
+ r8 = _nt_optional_ws
104
+ s0 << r8
105
+ end
106
+ end
107
+ end
108
+ end
109
+ if s0.last
110
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
111
+ r0.extend(Package0)
112
+ r0.extend(Package1)
113
+ else
114
+ @index = i0
115
+ r0 = nil
116
+ end
117
+
118
+ node_cache[:package][start_index] = r0
119
+
120
+ r0
121
+ end
122
+
123
+ def _nt_package_statement
124
+ start_index = index
125
+ if node_cache[:package_statement].has_key?(index)
126
+ cached = node_cache[:package_statement][index]
127
+ if cached
128
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
129
+ @index = cached.interval.end
130
+ end
131
+ return cached
132
+ end
133
+
134
+ i0 = index
135
+ r1 = _nt_archive
136
+ if r1
137
+ r0 = r1
138
+ else
139
+ r2 = _nt_resource
140
+ if r2
141
+ r0 = r2
142
+ else
143
+ r3 = _nt_retrieve
144
+ if r3
145
+ r0 = r3
146
+ else
147
+ r4 = _nt_config
148
+ if r4
149
+ r0 = r4
150
+ else
151
+ @index = i0
152
+ r0 = nil
153
+ end
154
+ end
155
+ end
156
+ end
157
+
158
+ node_cache[:package_statement][start_index] = r0
159
+
160
+ r0
161
+ end
162
+
163
+ module Archive0
164
+ def statement_start
165
+ elements[0]
166
+ end
167
+
168
+ def location
169
+ elements[2]
170
+ end
171
+ end
172
+
173
+ module Archive1
174
+ def to_package_statement(build_state)
175
+ return build_state.new_asset_statement(
176
+ Statement::Archive, statement_start, location.location
177
+ )
178
+ end
179
+ end
180
+
181
+ def _nt_archive
182
+ start_index = index
183
+ if node_cache[:archive].has_key?(index)
184
+ cached = node_cache[:archive][index]
185
+ if cached
186
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
187
+ @index = cached.interval.end
188
+ end
189
+ return cached
190
+ end
191
+
192
+ i0, s0 = index, []
193
+ if has_terminal?('archive', false, index)
194
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
195
+ @index += 7
196
+ else
197
+ terminal_parse_failure('archive')
198
+ r1 = nil
199
+ end
200
+ s0 << r1
201
+ if r1
202
+ s2, i2 = [], index
203
+ loop do
204
+ r3 = _nt_ws
205
+ if r3
206
+ s2 << r3
207
+ else
208
+ break
209
+ end
210
+ end
211
+ if s2.empty?
212
+ @index = i2
213
+ r2 = nil
214
+ else
215
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
216
+ end
217
+ s0 << r2
218
+ if r2
219
+ r4 = _nt_asset_location
220
+ s0 << r4
221
+ end
222
+ end
223
+ if s0.last
224
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
225
+ r0.extend(Archive0)
226
+ r0.extend(Archive1)
227
+ else
228
+ @index = i0
229
+ r0 = nil
230
+ end
231
+
232
+ node_cache[:archive][start_index] = r0
233
+
234
+ r0
235
+ end
236
+
237
+ module Resource0
238
+ def statement_start
239
+ elements[0]
240
+ end
241
+
242
+ def location
243
+ elements[2]
244
+ end
245
+ end
246
+
247
+ module Resource1
248
+ def to_package_statement(build_state)
249
+ return build_state.new_asset_statement(
250
+ Statement::Resource, statement_start, location.location
251
+ )
252
+ end
253
+ end
254
+
255
+ def _nt_resource
256
+ start_index = index
257
+ if node_cache[:resource].has_key?(index)
258
+ cached = node_cache[:resource][index]
259
+ if cached
260
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
261
+ @index = cached.interval.end
262
+ end
263
+ return cached
264
+ end
265
+
266
+ i0, s0 = index, []
267
+ if has_terminal?('resource', false, index)
268
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
269
+ @index += 8
270
+ else
271
+ terminal_parse_failure('resource')
272
+ r1 = nil
273
+ end
274
+ s0 << r1
275
+ if r1
276
+ s2, i2 = [], index
277
+ loop do
278
+ r3 = _nt_ws
279
+ if r3
280
+ s2 << r3
281
+ else
282
+ break
283
+ end
284
+ end
285
+ if s2.empty?
286
+ @index = i2
287
+ r2 = nil
288
+ else
289
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
290
+ end
291
+ s0 << r2
292
+ if r2
293
+ r4 = _nt_asset_location
294
+ s0 << r4
295
+ end
296
+ end
297
+ if s0.last
298
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
299
+ r0.extend(Resource0)
300
+ r0.extend(Resource1)
301
+ else
302
+ @index = i0
303
+ r0 = nil
304
+ end
305
+
306
+ node_cache[:resource][start_index] = r0
307
+
308
+ r0
309
+ end
310
+
311
+ module Retrieve0
312
+ def statement_start
313
+ elements[0]
314
+ end
315
+
316
+ def var
317
+ elements[2]
318
+ end
319
+
320
+ def path
321
+ elements[4]
322
+ end
323
+
324
+ end
325
+
326
+ module Retrieve1
327
+ def to_package_statement(build_state)
328
+ return build_state.new_retrieve_statement(statement_start, var, path)
329
+ end
330
+ end
331
+
332
+ def _nt_retrieve
333
+ start_index = index
334
+ if node_cache[:retrieve].has_key?(index)
335
+ cached = node_cache[:retrieve][index]
336
+ if cached
337
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
338
+ @index = cached.interval.end
339
+ end
340
+ return cached
341
+ end
342
+
343
+ i0, s0 = index, []
344
+ if has_terminal?('retrieve', false, index)
345
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
346
+ @index += 8
347
+ else
348
+ terminal_parse_failure('retrieve')
349
+ r1 = nil
350
+ end
351
+ s0 << r1
352
+ if r1
353
+ s2, i2 = [], index
354
+ loop do
355
+ r3 = _nt_ws
356
+ if r3
357
+ s2 << r3
358
+ else
359
+ break
360
+ end
361
+ end
362
+ if s2.empty?
363
+ @index = i2
364
+ r2 = nil
365
+ else
366
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
367
+ end
368
+ s0 << r2
369
+ if r2
370
+ r4 = _nt_environment_variable_name
371
+ s0 << r4
372
+ if r4
373
+ if has_terminal?('->', false, index)
374
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 2))
375
+ @index += 2
376
+ else
377
+ terminal_parse_failure('->')
378
+ r5 = nil
379
+ end
380
+ s0 << r5
381
+ if r5
382
+ r6 = _nt_retrieve_path
383
+ s0 << r6
384
+ if r6
385
+ s7, i7 = [], index
386
+ loop do
387
+ r8 = _nt_ws
388
+ if r8
389
+ s7 << r8
390
+ else
391
+ break
392
+ end
393
+ end
394
+ if s7.empty?
395
+ @index = i7
396
+ r7 = nil
397
+ else
398
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
399
+ end
400
+ s0 << r7
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end
406
+ if s0.last
407
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
408
+ r0.extend(Retrieve0)
409
+ r0.extend(Retrieve1)
410
+ else
411
+ @index = i0
412
+ r0 = nil
413
+ end
414
+
415
+ node_cache[:retrieve][start_index] = r0
416
+
417
+ r0
418
+ end
419
+
420
+ def _nt_retrieve_path
421
+ start_index = index
422
+ if node_cache[:retrieve_path].has_key?(index)
423
+ cached = node_cache[:retrieve_path][index]
424
+ if cached
425
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
426
+ @index = cached.interval.end
427
+ end
428
+ return cached
429
+ end
430
+
431
+ s0, i0 = [], index
432
+ loop do
433
+ if has_terminal?('\G[a-zA-Z0-9_/.\\[\\]-]', true, index)
434
+ r1 = true
435
+ @index += 1
436
+ else
437
+ r1 = nil
438
+ end
439
+ if r1
440
+ s0 << r1
441
+ else
442
+ break
443
+ end
444
+ end
445
+ if s0.empty?
446
+ @index = i0
447
+ r0 = nil
448
+ else
449
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
450
+ end
451
+
452
+ node_cache[:retrieve_path][start_index] = r0
453
+
454
+ r0
455
+ end
456
+
457
+ module Config0
458
+ def statement_start
459
+ elements[0]
460
+ end
461
+
462
+ def config_name
463
+ elements[2]
464
+ end
465
+
466
+ def statements
467
+ elements[4]
468
+ end
469
+
470
+ end
471
+
472
+ module Config1
473
+ def to_package_statement(build_state)
474
+ return build_state.new_configuration_statement(
475
+ statement_start, config_name, statements
476
+ )
477
+ end
478
+ end
479
+
480
+ def _nt_config
481
+ start_index = index
482
+ if node_cache[:config].has_key?(index)
483
+ cached = node_cache[:config][index]
484
+ if cached
485
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
486
+ @index = cached.interval.end
487
+ end
488
+ return cached
489
+ end
490
+
491
+ i0, s0 = index, []
492
+ if has_terminal?('config', false, index)
493
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 6))
494
+ @index += 6
495
+ else
496
+ terminal_parse_failure('config')
497
+ r1 = nil
498
+ end
499
+ s0 << r1
500
+ if r1
501
+ s2, i2 = [], index
502
+ loop do
503
+ r3 = _nt_ws
504
+ if r3
505
+ s2 << r3
506
+ else
507
+ break
508
+ end
509
+ end
510
+ if s2.empty?
511
+ @index = i2
512
+ r2 = nil
513
+ else
514
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
515
+ end
516
+ s0 << r2
517
+ if r2
518
+ r4 = _nt_config_name
519
+ s0 << r4
520
+ if r4
521
+ s5, i5 = [], index
522
+ loop do
523
+ r6 = _nt_ws
524
+ if r6
525
+ s5 << r6
526
+ else
527
+ break
528
+ end
529
+ end
530
+ if s5.empty?
531
+ @index = i5
532
+ r5 = nil
533
+ else
534
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
535
+ end
536
+ s0 << r5
537
+ if r5
538
+ s7, i7 = [], index
539
+ loop do
540
+ r8 = _nt_config_statement
541
+ if r8
542
+ s7 << r8
543
+ else
544
+ break
545
+ end
546
+ end
547
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
548
+ s0 << r7
549
+ if r7
550
+ if has_terminal?('end', false, index)
551
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 3))
552
+ @index += 3
553
+ else
554
+ terminal_parse_failure('end')
555
+ r9 = nil
556
+ end
557
+ s0 << r9
558
+ if r9
559
+ s10, i10 = [], index
560
+ loop do
561
+ r11 = _nt_ws
562
+ if r11
563
+ s10 << r11
564
+ else
565
+ break
566
+ end
567
+ end
568
+ if s10.empty?
569
+ @index = i10
570
+ r10 = nil
571
+ else
572
+ r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
573
+ end
574
+ s0 << r10
575
+ end
576
+ end
577
+ end
578
+ end
579
+ end
580
+ end
581
+ if s0.last
582
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
583
+ r0.extend(Config0)
584
+ r0.extend(Config1)
585
+ else
586
+ @index = i0
587
+ r0 = nil
588
+ end
589
+
590
+ node_cache[:config][start_index] = r0
591
+
592
+ r0
593
+ end
594
+
595
+ def _nt_config_name
596
+ start_index = index
597
+ if node_cache[:config_name].has_key?(index)
598
+ cached = node_cache[:config_name][index]
599
+ if cached
600
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
601
+ @index = cached.interval.end
602
+ end
603
+ return cached
604
+ end
605
+
606
+ s0, i0 = [], index
607
+ loop do
608
+ if has_terminal?('\G[a-zA-Z0-9_.-]', true, index)
609
+ r1 = true
610
+ @index += 1
611
+ else
612
+ r1 = nil
613
+ end
614
+ if r1
615
+ s0 << r1
616
+ else
617
+ break
618
+ end
619
+ end
620
+ if s0.empty?
621
+ @index = i0
622
+ r0 = nil
623
+ else
624
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
625
+ end
626
+
627
+ node_cache[:config_name][start_index] = r0
628
+
629
+ r0
630
+ end
631
+
632
+ def _nt_config_statement
633
+ start_index = index
634
+ if node_cache[:config_statement].has_key?(index)
635
+ cached = node_cache[:config_statement][index]
636
+ if cached
637
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
638
+ @index = cached.interval.end
639
+ end
640
+ return cached
641
+ end
642
+
643
+ i0 = index
644
+ r1 = _nt_override
645
+ if r1
646
+ r0 = r1
647
+ else
648
+ r2 = _nt_include
649
+ if r2
650
+ r0 = r2
651
+ else
652
+ r3 = _nt_command
653
+ if r3
654
+ r0 = r3
655
+ else
656
+ r4 = _nt_path
657
+ if r4
658
+ r0 = r4
659
+ else
660
+ r5 = _nt_set
661
+ if r5
662
+ r0 = r5
663
+ else
664
+ @index = i0
665
+ r0 = nil
666
+ end
667
+ end
668
+ end
669
+ end
670
+ end
671
+
672
+ node_cache[:config_statement][start_index] = r0
673
+
674
+ r0
675
+ end
676
+
677
+ module Include0
678
+ def statement_start
679
+ elements[0]
680
+ end
681
+
682
+ def descriptor_string
683
+ elements[2]
684
+ end
685
+
686
+ end
687
+
688
+ module Include1
689
+ def to_config_statement(build_state)
690
+ return build_state.new_include_statement(
691
+ statement_start, descriptor_string
692
+ )
693
+ end
694
+ end
695
+
696
+ def _nt_include
697
+ start_index = index
698
+ if node_cache[:include].has_key?(index)
699
+ cached = node_cache[:include][index]
700
+ if cached
701
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
702
+ @index = cached.interval.end
703
+ end
704
+ return cached
705
+ end
706
+
707
+ i0, s0 = index, []
708
+ if has_terminal?('include', false, index)
709
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
710
+ @index += 7
711
+ else
712
+ terminal_parse_failure('include')
713
+ r1 = nil
714
+ end
715
+ s0 << r1
716
+ if r1
717
+ s2, i2 = [], index
718
+ loop do
719
+ r3 = _nt_ws
720
+ if r3
721
+ s2 << r3
722
+ else
723
+ break
724
+ end
725
+ end
726
+ if s2.empty?
727
+ @index = i2
728
+ r2 = nil
729
+ else
730
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
731
+ end
732
+ s0 << r2
733
+ if r2
734
+ r4 = _nt_descriptor_string
735
+ s0 << r4
736
+ if r4
737
+ s5, i5 = [], index
738
+ loop do
739
+ r6 = _nt_ws
740
+ if r6
741
+ s5 << r6
742
+ else
743
+ break
744
+ end
745
+ end
746
+ if s5.empty?
747
+ @index = i5
748
+ r5 = nil
749
+ else
750
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
751
+ end
752
+ s0 << r5
753
+ end
754
+ end
755
+ end
756
+ if s0.last
757
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
758
+ r0.extend(Include0)
759
+ r0.extend(Include1)
760
+ else
761
+ @index = i0
762
+ r0 = nil
763
+ end
764
+
765
+ node_cache[:include][start_index] = r0
766
+
767
+ r0
768
+ end
769
+
770
+ module Override0
771
+ def statement_start
772
+ elements[0]
773
+ end
774
+
775
+ def descriptor_string
776
+ elements[2]
777
+ end
778
+
779
+ end
780
+
781
+ module Override1
782
+ def to_config_statement(build_state)
783
+ return build_state.new_override_statement(
784
+ statement_start, descriptor_string
785
+ )
786
+ end
787
+ end
788
+
789
+ def _nt_override
790
+ start_index = index
791
+ if node_cache[:override].has_key?(index)
792
+ cached = node_cache[:override][index]
793
+ if cached
794
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
795
+ @index = cached.interval.end
796
+ end
797
+ return cached
798
+ end
799
+
800
+ i0, s0 = index, []
801
+ if has_terminal?('override', false, index)
802
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
803
+ @index += 8
804
+ else
805
+ terminal_parse_failure('override')
806
+ r1 = nil
807
+ end
808
+ s0 << r1
809
+ if r1
810
+ s2, i2 = [], index
811
+ loop do
812
+ r3 = _nt_ws
813
+ if r3
814
+ s2 << r3
815
+ else
816
+ break
817
+ end
818
+ end
819
+ if s2.empty?
820
+ @index = i2
821
+ r2 = nil
822
+ else
823
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
824
+ end
825
+ s0 << r2
826
+ if r2
827
+ r4 = _nt_descriptor_string
828
+ s0 << r4
829
+ if r4
830
+ s5, i5 = [], index
831
+ loop do
832
+ r6 = _nt_ws
833
+ if r6
834
+ s5 << r6
835
+ else
836
+ break
837
+ end
838
+ end
839
+ if s5.empty?
840
+ @index = i5
841
+ r5 = nil
842
+ else
843
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
844
+ end
845
+ s0 << r5
846
+ end
847
+ end
848
+ end
849
+ if s0.last
850
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
851
+ r0.extend(Override0)
852
+ r0.extend(Override1)
853
+ else
854
+ @index = i0
855
+ r0 = nil
856
+ end
857
+
858
+ node_cache[:override][start_index] = r0
859
+
860
+ r0
861
+ end
862
+
863
+ module Path0
864
+ def statement_start
865
+ elements[0]
866
+ end
867
+
868
+ def name_value
869
+ elements[2]
870
+ end
871
+
872
+ end
873
+
874
+ module Path1
875
+ def to_config_statement(build_state)
876
+ return build_state.new_environment_variable_statement(
877
+ Statement::Path, statement_start, name_value
878
+ )
879
+ end
880
+ end
881
+
882
+ def _nt_path
883
+ start_index = index
884
+ if node_cache[:path].has_key?(index)
885
+ cached = node_cache[:path][index]
886
+ if cached
887
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
888
+ @index = cached.interval.end
889
+ end
890
+ return cached
891
+ end
892
+
893
+ i0, s0 = index, []
894
+ i1 = index
895
+ if has_terminal?('add', false, index)
896
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 3))
897
+ @index += 3
898
+ else
899
+ terminal_parse_failure('add')
900
+ r2 = nil
901
+ end
902
+ if r2
903
+ r1 = r2
904
+ else
905
+ if has_terminal?('append', false, index)
906
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 6))
907
+ @index += 6
908
+ else
909
+ terminal_parse_failure('append')
910
+ r3 = nil
911
+ end
912
+ if r3
913
+ r1 = r3
914
+ else
915
+ if has_terminal?('path', false, index)
916
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 4))
917
+ @index += 4
918
+ else
919
+ terminal_parse_failure('path')
920
+ r4 = nil
921
+ end
922
+ if r4
923
+ r1 = r4
924
+ else
925
+ @index = i1
926
+ r1 = nil
927
+ end
928
+ end
929
+ end
930
+ s0 << r1
931
+ if r1
932
+ s5, i5 = [], index
933
+ loop do
934
+ r6 = _nt_ws
935
+ if r6
936
+ s5 << r6
937
+ else
938
+ break
939
+ end
940
+ end
941
+ if s5.empty?
942
+ @index = i5
943
+ r5 = nil
944
+ else
945
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
946
+ end
947
+ s0 << r5
948
+ if r5
949
+ s7, i7 = [], index
950
+ loop do
951
+ if has_terminal?('\G[\\S]', true, index)
952
+ r8 = true
953
+ @index += 1
954
+ else
955
+ r8 = nil
956
+ end
957
+ if r8
958
+ s7 << r8
959
+ else
960
+ break
961
+ end
962
+ end
963
+ if s7.empty?
964
+ @index = i7
965
+ r7 = nil
966
+ else
967
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
968
+ end
969
+ s0 << r7
970
+ if r7
971
+ s9, i9 = [], index
972
+ loop do
973
+ r10 = _nt_ws
974
+ if r10
975
+ s9 << r10
976
+ else
977
+ break
978
+ end
979
+ end
980
+ if s9.empty?
981
+ @index = i9
982
+ r9 = nil
983
+ else
984
+ r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
985
+ end
986
+ s0 << r9
987
+ end
988
+ end
989
+ end
990
+ if s0.last
991
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
992
+ r0.extend(Path0)
993
+ r0.extend(Path1)
994
+ else
995
+ @index = i0
996
+ r0 = nil
997
+ end
998
+
999
+ node_cache[:path][start_index] = r0
1000
+
1001
+ r0
1002
+ end
1003
+
1004
+ def _nt_environment_variable_name
1005
+ start_index = index
1006
+ if node_cache[:environment_variable_name].has_key?(index)
1007
+ cached = node_cache[:environment_variable_name][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
+ s0, i0 = [], index
1016
+ loop do
1017
+ if has_terminal?('\G[a-zA-Z0-9_]', true, index)
1018
+ r1 = true
1019
+ @index += 1
1020
+ else
1021
+ r1 = nil
1022
+ end
1023
+ if r1
1024
+ s0 << r1
1025
+ else
1026
+ break
1027
+ end
1028
+ end
1029
+ if s0.empty?
1030
+ @index = i0
1031
+ r0 = nil
1032
+ else
1033
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1034
+ end
1035
+
1036
+ node_cache[:environment_variable_name][start_index] = r0
1037
+
1038
+ r0
1039
+ end
1040
+
1041
+ module Set0
1042
+ def statement_start
1043
+ elements[0]
1044
+ end
1045
+
1046
+ def name_value
1047
+ elements[2]
1048
+ end
1049
+
1050
+ end
1051
+
1052
+ module Set1
1053
+ def to_config_statement(build_state)
1054
+ return build_state.new_environment_variable_statement(
1055
+ Statement::Set, statement_start, name_value
1056
+ )
1057
+ end
1058
+ end
1059
+
1060
+ def _nt_set
1061
+ start_index = index
1062
+ if node_cache[:set].has_key?(index)
1063
+ cached = node_cache[:set][index]
1064
+ if cached
1065
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1066
+ @index = cached.interval.end
1067
+ end
1068
+ return cached
1069
+ end
1070
+
1071
+ i0, s0 = index, []
1072
+ if has_terminal?('set', false, index)
1073
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
1074
+ @index += 3
1075
+ else
1076
+ terminal_parse_failure('set')
1077
+ r1 = nil
1078
+ end
1079
+ s0 << r1
1080
+ if r1
1081
+ s2, i2 = [], index
1082
+ loop do
1083
+ r3 = _nt_ws
1084
+ if r3
1085
+ s2 << r3
1086
+ else
1087
+ break
1088
+ end
1089
+ end
1090
+ if s2.empty?
1091
+ @index = i2
1092
+ r2 = nil
1093
+ else
1094
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1095
+ end
1096
+ s0 << r2
1097
+ if r2
1098
+ s4, i4 = [], index
1099
+ loop do
1100
+ if has_terminal?('\G[\\S]', true, index)
1101
+ r5 = true
1102
+ @index += 1
1103
+ else
1104
+ r5 = nil
1105
+ end
1106
+ if r5
1107
+ s4 << r5
1108
+ else
1109
+ break
1110
+ end
1111
+ end
1112
+ if s4.empty?
1113
+ @index = i4
1114
+ r4 = nil
1115
+ else
1116
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
1117
+ end
1118
+ s0 << r4
1119
+ if r4
1120
+ s6, i6 = [], index
1121
+ loop do
1122
+ r7 = _nt_ws
1123
+ if r7
1124
+ s6 << r7
1125
+ else
1126
+ break
1127
+ end
1128
+ end
1129
+ if s6.empty?
1130
+ @index = i6
1131
+ r6 = nil
1132
+ else
1133
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
1134
+ end
1135
+ s0 << r6
1136
+ end
1137
+ end
1138
+ end
1139
+ if s0.last
1140
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1141
+ r0.extend(Set0)
1142
+ r0.extend(Set1)
1143
+ else
1144
+ @index = i0
1145
+ r0 = nil
1146
+ end
1147
+
1148
+ node_cache[:set][start_index] = r0
1149
+
1150
+ r0
1151
+ end
1152
+
1153
+ module Command0
1154
+ def statement_start
1155
+ elements[0]
1156
+ end
1157
+
1158
+ def string
1159
+ elements[2]
1160
+ end
1161
+
1162
+ end
1163
+
1164
+ module Command1
1165
+ def to_config_statement(build_state)
1166
+ return build_state.new_command_statement(statement_start, string)
1167
+ end
1168
+ end
1169
+
1170
+ def _nt_command
1171
+ start_index = index
1172
+ if node_cache[:command].has_key?(index)
1173
+ cached = node_cache[:command][index]
1174
+ if cached
1175
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1176
+ @index = cached.interval.end
1177
+ end
1178
+ return cached
1179
+ end
1180
+
1181
+ i0, s0 = index, []
1182
+ if has_terminal?('command', false, index)
1183
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
1184
+ @index += 7
1185
+ else
1186
+ terminal_parse_failure('command')
1187
+ r1 = nil
1188
+ end
1189
+ s0 << r1
1190
+ if r1
1191
+ s2, i2 = [], index
1192
+ loop do
1193
+ r3 = _nt_ws
1194
+ if r3
1195
+ s2 << r3
1196
+ else
1197
+ break
1198
+ end
1199
+ end
1200
+ if s2.empty?
1201
+ @index = i2
1202
+ r2 = nil
1203
+ else
1204
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1205
+ end
1206
+ s0 << r2
1207
+ if r2
1208
+ r4 = _nt_string
1209
+ s0 << r4
1210
+ if r4
1211
+ s5, i5 = [], index
1212
+ loop do
1213
+ r6 = _nt_ws
1214
+ if r6
1215
+ s5 << r6
1216
+ else
1217
+ break
1218
+ end
1219
+ end
1220
+ if s5.empty?
1221
+ @index = i5
1222
+ r5 = nil
1223
+ else
1224
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1225
+ end
1226
+ s0 << r5
1227
+ end
1228
+ end
1229
+ end
1230
+ if s0.last
1231
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1232
+ r0.extend(Command0)
1233
+ r0.extend(Command1)
1234
+ else
1235
+ @index = i0
1236
+ r0 = nil
1237
+ end
1238
+
1239
+ node_cache[:command][start_index] = r0
1240
+
1241
+ r0
1242
+ end
1243
+
1244
+ module String0
1245
+ def value
1246
+ elements[1]
1247
+ end
1248
+
1249
+ end
1250
+
1251
+ def _nt_string
1252
+ start_index = index
1253
+ if node_cache[:string].has_key?(index)
1254
+ cached = node_cache[:string][index]
1255
+ if cached
1256
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1257
+ @index = cached.interval.end
1258
+ end
1259
+ return cached
1260
+ end
1261
+
1262
+ i0, s0 = index, []
1263
+ if has_terminal?('"', false, index)
1264
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
1265
+ @index += 1
1266
+ else
1267
+ terminal_parse_failure('"')
1268
+ r1 = nil
1269
+ end
1270
+ s0 << r1
1271
+ if r1
1272
+ s2, i2 = [], index
1273
+ loop do
1274
+ if has_terminal?('\G[^"]', true, index)
1275
+ r3 = true
1276
+ @index += 1
1277
+ else
1278
+ r3 = nil
1279
+ end
1280
+ if r3
1281
+ s2 << r3
1282
+ else
1283
+ break
1284
+ end
1285
+ end
1286
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1287
+ s0 << r2
1288
+ if r2
1289
+ if has_terminal?('"', false, index)
1290
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
1291
+ @index += 1
1292
+ else
1293
+ terminal_parse_failure('"')
1294
+ r4 = nil
1295
+ end
1296
+ s0 << r4
1297
+ end
1298
+ end
1299
+ if s0.last
1300
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1301
+ r0.extend(String0)
1302
+ else
1303
+ @index = i0
1304
+ r0 = nil
1305
+ end
1306
+
1307
+ node_cache[:string][start_index] = r0
1308
+
1309
+ r0
1310
+ end
1311
+
1312
+ def _nt_descriptor_string
1313
+ start_index = index
1314
+ if node_cache[:descriptor_string].has_key?(index)
1315
+ cached = node_cache[:descriptor_string][index]
1316
+ if cached
1317
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1318
+ @index = cached.interval.end
1319
+ end
1320
+ return cached
1321
+ end
1322
+
1323
+ s0, i0 = [], index
1324
+ loop do
1325
+ if has_terminal?('\G[\\S]', true, index)
1326
+ r1 = true
1327
+ @index += 1
1328
+ else
1329
+ r1 = nil
1330
+ end
1331
+ if r1
1332
+ s0 << r1
1333
+ else
1334
+ break
1335
+ end
1336
+ end
1337
+ if s0.empty?
1338
+ @index = i0
1339
+ r0 = nil
1340
+ else
1341
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1342
+ end
1343
+
1344
+ node_cache[:descriptor_string][start_index] = r0
1345
+
1346
+ r0
1347
+ end
1348
+
1349
+ end
1350
+
1351
+ class V0IshParser < Treetop::Runtime::CompiledParser
1352
+ include V0Ish
1353
+ end
1354
+
1355
+ end
1356
+ end