puffy 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,661 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.0
4
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.7.3
5
+ # from Racc grammar file "parser.y".
5
6
  #
6
7
 
7
- require 'racc/parser.rb'
8
+ ###### racc/parser.rb begin
9
+ unless $".find {|p| p.end_with?('/racc/parser.rb')}
10
+ $".push "#{__dir__}/racc/parser.rb"
11
+ self.class.module_eval(<<'...end racc/parser.rb/module_eval...', 'racc/parser.rb', 1)
12
+ #--
13
+ # Copyright (c) 1999-2006 Minero Aoki
14
+ #
15
+ # This program is free software.
16
+ # You can distribute/modify this program under the same terms of ruby.
17
+ #
18
+ # As a special exception, when this code is copied by Racc
19
+ # into a Racc output file, you may use that output file
20
+ # without restriction.
21
+ #++
22
+
23
+ unless $".find {|p| p.end_with?('/racc/info.rb')}
24
+ $".push "#{__dir__}/racc/info.rb"
25
+
26
+ module Racc
27
+ VERSION = '1.7.3'
28
+ Version = VERSION
29
+ Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
30
+ end
31
+
32
+ end
33
+
34
+
35
+ unless defined?(NotImplementedError)
36
+ NotImplementedError = NotImplementError # :nodoc:
37
+ end
38
+
39
+ module Racc
40
+ class ParseError < StandardError; end
41
+ end
42
+ unless defined?(::ParseError)
43
+ ParseError = Racc::ParseError # :nodoc:
44
+ end
45
+
46
+ # Racc is a LALR(1) parser generator.
47
+ # It is written in Ruby itself, and generates Ruby programs.
48
+ #
49
+ # == Command-line Reference
50
+ #
51
+ # racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
52
+ # [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
53
+ # [-v] [--verbose]
54
+ # [-O<var>filename</var>] [--log-file=<var>filename</var>]
55
+ # [-g] [--debug]
56
+ # [-E] [--embedded]
57
+ # [-l] [--no-line-convert]
58
+ # [-c] [--line-convert-all]
59
+ # [-a] [--no-omit-actions]
60
+ # [-C] [--check-only]
61
+ # [-S] [--output-status]
62
+ # [--version] [--copyright] [--help] <var>grammarfile</var>
63
+ #
64
+ # [+grammarfile+]
65
+ # Racc grammar file. Any extension is permitted.
66
+ # [-o+outfile+, --output-file=+outfile+]
67
+ # A filename for output. default is <+filename+>.tab.rb
68
+ # [-O+filename+, --log-file=+filename+]
69
+ # Place logging output in file +filename+.
70
+ # Default log file name is <+filename+>.output.
71
+ # [-e+rubypath+, --executable=+rubypath+]
72
+ # output executable file(mode 755). where +path+ is the Ruby interpreter.
73
+ # [-v, --verbose]
74
+ # verbose mode. create +filename+.output file, like yacc's y.output file.
75
+ # [-g, --debug]
76
+ # add debug code to parser class. To display debugging information,
77
+ # use this '-g' option and set @yydebug true in parser class.
78
+ # [-E, --embedded]
79
+ # Output parser which doesn't need runtime files (racc/parser.rb).
80
+ # [-F, --frozen]
81
+ # Output parser which declares frozen_string_literals: true
82
+ # [-C, --check-only]
83
+ # Check syntax of racc grammar file and quit.
84
+ # [-S, --output-status]
85
+ # Print messages time to time while compiling.
86
+ # [-l, --no-line-convert]
87
+ # turns off line number converting.
88
+ # [-c, --line-convert-all]
89
+ # Convert line number of actions, inner, header and footer.
90
+ # [-a, --no-omit-actions]
91
+ # Call all actions, even if an action is empty.
92
+ # [--version]
93
+ # print Racc version and quit.
94
+ # [--copyright]
95
+ # Print copyright and quit.
96
+ # [--help]
97
+ # Print usage and quit.
98
+ #
99
+ # == Generating Parser Using Racc
100
+ #
101
+ # To compile Racc grammar file, simply type:
102
+ #
103
+ # $ racc parse.y
104
+ #
105
+ # This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
106
+ #
107
+ # == Writing A Racc Grammar File
108
+ #
109
+ # If you want your own parser, you have to write a grammar file.
110
+ # A grammar file contains the name of your parser class, grammar for the parser,
111
+ # user code, and anything else.
112
+ # When writing a grammar file, yacc's knowledge is helpful.
113
+ # If you have not used yacc before, Racc is not too difficult.
114
+ #
115
+ # Here's an example Racc grammar file.
116
+ #
117
+ # class Calcparser
118
+ # rule
119
+ # target: exp { print val[0] }
120
+ #
121
+ # exp: exp '+' exp
122
+ # | exp '*' exp
123
+ # | '(' exp ')'
124
+ # | NUMBER
125
+ # end
126
+ #
127
+ # Racc grammar files resemble yacc files.
128
+ # But (of course), this is Ruby code.
129
+ # yacc's $$ is the 'result', $0, $1... is
130
+ # an array called 'val', and $-1, $-2... is an array called '_values'.
131
+ #
132
+ # See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
133
+ # more information on grammar files.
134
+ #
135
+ # == Parser
136
+ #
137
+ # Then you must prepare the parse entry method. There are two types of
138
+ # parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
139
+ #
140
+ # Racc::Parser#do_parse is simple.
141
+ #
142
+ # It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
143
+ # This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
144
+ # EOF is [false, false].
145
+ # (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
146
+ # If you want to change this, see the grammar reference.
147
+ #
148
+ # Racc::Parser#yyparse is little complicated, but useful.
149
+ # It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
150
+ #
151
+ # For example, <code>yyparse(obj, :scan)</code> causes
152
+ # calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
153
+ #
154
+ # == Debugging
155
+ #
156
+ # When debugging, "-v" or/and the "-g" option is helpful.
157
+ #
158
+ # "-v" creates verbose log file (.output).
159
+ # "-g" creates a "Verbose Parser".
160
+ # Verbose Parser prints the internal status when parsing.
161
+ # But it's _not_ automatic.
162
+ # You must use -g option and set +@yydebug+ to +true+ in order to get output.
163
+ # -g option only creates the verbose parser.
164
+ #
165
+ # === Racc reported syntax error.
166
+ #
167
+ # Isn't there too many "end"?
168
+ # grammar of racc file is changed in v0.10.
169
+ #
170
+ # Racc does not use '%' mark, while yacc uses huge number of '%' marks..
171
+ #
172
+ # === Racc reported "XXXX conflicts".
173
+ #
174
+ # Try "racc -v xxxx.y".
175
+ # It causes producing racc's internal log file, xxxx.output.
176
+ #
177
+ # === Generated parsers does not work correctly
178
+ #
179
+ # Try "racc -g xxxx.y".
180
+ # This command let racc generate "debugging parser".
181
+ # Then set @yydebug=true in your parser.
182
+ # It produces a working log of your parser.
183
+ #
184
+ # == Re-distributing Racc runtime
185
+ #
186
+ # A parser, which is created by Racc, requires the Racc runtime module;
187
+ # racc/parser.rb.
188
+ #
189
+ # Ruby 1.8.x comes with Racc runtime module,
190
+ # you need NOT distribute Racc runtime files.
191
+ #
192
+ # If you want to include the Racc runtime module with your parser.
193
+ # This can be done by using '-E' option:
194
+ #
195
+ # $ racc -E -omyparser.rb myparser.y
196
+ #
197
+ # This command creates myparser.rb which `includes' Racc runtime.
198
+ # Only you must do is to distribute your parser file (myparser.rb).
199
+ #
200
+ # Note: parser.rb is ruby license, but your parser is not.
201
+ # Your own parser is completely yours.
202
+ module Racc
203
+
204
+ unless defined?(Racc_No_Extensions)
205
+ Racc_No_Extensions = false # :nodoc:
206
+ end
207
+
208
+ class Parser
209
+
210
+ Racc_Runtime_Version = ::Racc::VERSION
211
+ Racc_Runtime_Core_Version_R = ::Racc::VERSION
212
+
213
+ begin
214
+ if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
215
+ require 'jruby'
216
+ require 'racc/cparse-jruby.jar'
217
+ com.headius.racc.Cparse.new.load(JRuby.runtime, false)
218
+ else
219
+ require 'racc/cparse'
220
+ end
221
+
222
+ unless new.respond_to?(:_racc_do_parse_c, true)
223
+ raise LoadError, 'old cparse.so'
224
+ end
225
+ if Racc_No_Extensions
226
+ raise LoadError, 'selecting ruby version of racc runtime core'
227
+ end
228
+
229
+ Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
230
+ Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
231
+ Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
232
+ Racc_Runtime_Type = 'c' # :nodoc:
233
+ rescue LoadError
234
+ Racc_Main_Parsing_Routine = :_racc_do_parse_rb
235
+ Racc_YY_Parse_Method = :_racc_yyparse_rb
236
+ Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
237
+ Racc_Runtime_Type = 'ruby'
238
+ end
239
+
240
+ def Parser.racc_runtime_type # :nodoc:
241
+ Racc_Runtime_Type
242
+ end
243
+
244
+ def _racc_setup
245
+ @yydebug = false unless self.class::Racc_debug_parser
246
+ @yydebug = false unless defined?(@yydebug)
247
+ if @yydebug
248
+ @racc_debug_out = $stderr unless defined?(@racc_debug_out)
249
+ @racc_debug_out ||= $stderr
250
+ end
251
+ arg = self.class::Racc_arg
252
+ arg[13] = true if arg.size < 14
253
+ arg
254
+ end
255
+
256
+ def _racc_init_sysvars
257
+ @racc_state = [0]
258
+ @racc_tstack = []
259
+ @racc_vstack = []
260
+
261
+ @racc_t = nil
262
+ @racc_val = nil
263
+
264
+ @racc_read_next = true
265
+
266
+ @racc_user_yyerror = false
267
+ @racc_error_status = 0
268
+ end
269
+
270
+ # The entry point of the parser. This method is used with #next_token.
271
+ # If Racc wants to get token (and its value), calls next_token.
272
+ #
273
+ # Example:
274
+ # def parse
275
+ # @q = [[1,1],
276
+ # [2,2],
277
+ # [3,3],
278
+ # [false, '$']]
279
+ # do_parse
280
+ # end
281
+ #
282
+ # def next_token
283
+ # @q.shift
284
+ # end
285
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
286
+ def do_parse
287
+ #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
288
+ end
289
+ RUBY
290
+
291
+ # The method to fetch next token.
292
+ # If you use #do_parse method, you must implement #next_token.
293
+ #
294
+ # The format of return value is [TOKEN_SYMBOL, VALUE].
295
+ # +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
296
+ # for 'IDENT'. ";" (String) for ';'.
297
+ #
298
+ # The final symbol (End of file) must be false.
299
+ def next_token
300
+ raise NotImplementedError, "#{self.class}\#next_token is not defined"
301
+ end
302
+
303
+ def _racc_do_parse_rb(arg, in_debug)
304
+ action_table, action_check, action_default, action_pointer,
305
+ _, _, _, _,
306
+ _, _, token_table, * = arg
307
+
308
+ _racc_init_sysvars
309
+ tok = act = i = nil
310
+
311
+ catch(:racc_end_parse) {
312
+ while true
313
+ if i = action_pointer[@racc_state[-1]]
314
+ if @racc_read_next
315
+ if @racc_t != 0 # not EOF
316
+ tok, @racc_val = next_token()
317
+ unless tok # EOF
318
+ @racc_t = 0
319
+ else
320
+ @racc_t = (token_table[tok] or 1) # error token
321
+ end
322
+ racc_read_token(@racc_t, tok, @racc_val) if @yydebug
323
+ @racc_read_next = false
324
+ end
325
+ end
326
+ i += @racc_t
327
+ unless i >= 0 and
328
+ act = action_table[i] and
329
+ action_check[i] == @racc_state[-1]
330
+ act = action_default[@racc_state[-1]]
331
+ end
332
+ else
333
+ act = action_default[@racc_state[-1]]
334
+ end
335
+ while act = _racc_evalact(act, arg)
336
+ ;
337
+ end
338
+ end
339
+ }
340
+ end
341
+
342
+ # Another entry point for the parser.
343
+ # If you use this method, you must implement RECEIVER#METHOD_ID method.
344
+ #
345
+ # RECEIVER#METHOD_ID is a method to get next token.
346
+ # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
347
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
348
+ def yyparse(recv, mid)
349
+ #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
350
+ end
351
+ RUBY
352
+
353
+ def _racc_yyparse_rb(recv, mid, arg, c_debug)
354
+ action_table, action_check, action_default, action_pointer,
355
+ _, _, _, _,
356
+ _, _, token_table, * = arg
357
+
358
+ _racc_init_sysvars
359
+
360
+ catch(:racc_end_parse) {
361
+ until i = action_pointer[@racc_state[-1]]
362
+ while act = _racc_evalact(action_default[@racc_state[-1]], arg)
363
+ ;
364
+ end
365
+ end
366
+ recv.__send__(mid) do |tok, val|
367
+ unless tok
368
+ @racc_t = 0
369
+ else
370
+ @racc_t = (token_table[tok] or 1) # error token
371
+ end
372
+ @racc_val = val
373
+ @racc_read_next = false
374
+
375
+ i += @racc_t
376
+ unless i >= 0 and
377
+ act = action_table[i] and
378
+ action_check[i] == @racc_state[-1]
379
+ act = action_default[@racc_state[-1]]
380
+ end
381
+ while act = _racc_evalact(act, arg)
382
+ ;
383
+ end
384
+
385
+ while !(i = action_pointer[@racc_state[-1]]) ||
386
+ ! @racc_read_next ||
387
+ @racc_t == 0 # $
388
+ unless i and i += @racc_t and
389
+ i >= 0 and
390
+ act = action_table[i] and
391
+ action_check[i] == @racc_state[-1]
392
+ act = action_default[@racc_state[-1]]
393
+ end
394
+ while act = _racc_evalact(act, arg)
395
+ ;
396
+ end
397
+ end
398
+ end
399
+ }
400
+ end
401
+
402
+ ###
403
+ ### common
404
+ ###
405
+
406
+ def _racc_evalact(act, arg)
407
+ action_table, action_check, _, action_pointer,
408
+ _, _, _, _,
409
+ _, _, _, shift_n,
410
+ reduce_n, * = arg
411
+ nerr = 0 # tmp
412
+
413
+ if act > 0 and act < shift_n
414
+ #
415
+ # shift
416
+ #
417
+ if @racc_error_status > 0
418
+ @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
419
+ end
420
+ @racc_vstack.push @racc_val
421
+ @racc_state.push act
422
+ @racc_read_next = true
423
+ if @yydebug
424
+ @racc_tstack.push @racc_t
425
+ racc_shift @racc_t, @racc_tstack, @racc_vstack
426
+ end
427
+
428
+ elsif act < 0 and act > -reduce_n
429
+ #
430
+ # reduce
431
+ #
432
+ code = catch(:racc_jump) {
433
+ @racc_state.push _racc_do_reduce(arg, act)
434
+ false
435
+ }
436
+ if code
437
+ case code
438
+ when 1 # yyerror
439
+ @racc_user_yyerror = true # user_yyerror
440
+ return -reduce_n
441
+ when 2 # yyaccept
442
+ return shift_n
443
+ else
444
+ raise '[Racc Bug] unknown jump code'
445
+ end
446
+ end
447
+
448
+ elsif act == shift_n
449
+ #
450
+ # accept
451
+ #
452
+ racc_accept if @yydebug
453
+ throw :racc_end_parse, @racc_vstack[0]
454
+
455
+ elsif act == -reduce_n
456
+ #
457
+ # error
458
+ #
459
+ case @racc_error_status
460
+ when 0
461
+ unless arg[21] # user_yyerror
462
+ nerr += 1
463
+ on_error @racc_t, @racc_val, @racc_vstack
464
+ end
465
+ when 3
466
+ if @racc_t == 0 # is $
467
+ # We're at EOF, and another error occurred immediately after
468
+ # attempting auto-recovery
469
+ throw :racc_end_parse, nil
470
+ end
471
+ @racc_read_next = true
472
+ end
473
+ @racc_user_yyerror = false
474
+ @racc_error_status = 3
475
+ while true
476
+ if i = action_pointer[@racc_state[-1]]
477
+ i += 1 # error token
478
+ if i >= 0 and
479
+ (act = action_table[i]) and
480
+ action_check[i] == @racc_state[-1]
481
+ break
482
+ end
483
+ end
484
+ throw :racc_end_parse, nil if @racc_state.size <= 1
485
+ @racc_state.pop
486
+ @racc_vstack.pop
487
+ if @yydebug
488
+ @racc_tstack.pop
489
+ racc_e_pop @racc_state, @racc_tstack, @racc_vstack
490
+ end
491
+ end
492
+ return act
493
+
494
+ else
495
+ raise "[Racc Bug] unknown action #{act.inspect}"
496
+ end
497
+
498
+ racc_next_state(@racc_state[-1], @racc_state) if @yydebug
499
+
500
+ nil
501
+ end
502
+
503
+ def _racc_do_reduce(arg, act)
504
+ _, _, _, _,
505
+ goto_table, goto_check, goto_default, goto_pointer,
506
+ nt_base, reduce_table, _, _,
507
+ _, use_result, * = arg
508
+
509
+ state = @racc_state
510
+ vstack = @racc_vstack
511
+ tstack = @racc_tstack
512
+
513
+ i = act * -3
514
+ len = reduce_table[i]
515
+ reduce_to = reduce_table[i+1]
516
+ method_id = reduce_table[i+2]
517
+ void_array = []
518
+
519
+ tmp_t = tstack[-len, len] if @yydebug
520
+ tmp_v = vstack[-len, len]
521
+ tstack[-len, len] = void_array if @yydebug
522
+ vstack[-len, len] = void_array
523
+ state[-len, len] = void_array
524
+
525
+ # tstack must be updated AFTER method call
526
+ if use_result
527
+ vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
528
+ else
529
+ vstack.push __send__(method_id, tmp_v, vstack)
530
+ end
531
+ tstack.push reduce_to
532
+
533
+ racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
534
+
535
+ k1 = reduce_to - nt_base
536
+ if i = goto_pointer[k1]
537
+ i += state[-1]
538
+ if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
539
+ return curstate
540
+ end
541
+ end
542
+ goto_default[k1]
543
+ end
544
+
545
+ # This method is called when a parse error is found.
546
+ #
547
+ # ERROR_TOKEN_ID is an internal ID of token which caused error.
548
+ # You can get string representation of this ID by calling
549
+ # #token_to_str.
550
+ #
551
+ # ERROR_VALUE is a value of error token.
552
+ #
553
+ # value_stack is a stack of symbol values.
554
+ # DO NOT MODIFY this object.
555
+ #
556
+ # This method raises ParseError by default.
557
+ #
558
+ # If this method returns, parsers enter "error recovering mode".
559
+ def on_error(t, val, vstack)
560
+ raise ParseError, sprintf("parse error on value %s (%s)",
561
+ val.inspect, token_to_str(t) || '?')
562
+ end
563
+
564
+ # Enter error recovering mode.
565
+ # This method does not call #on_error.
566
+ def yyerror
567
+ throw :racc_jump, 1
568
+ end
569
+
570
+ # Exit parser.
571
+ # Return value is +Symbol_Value_Stack[0]+.
572
+ def yyaccept
573
+ throw :racc_jump, 2
574
+ end
575
+
576
+ # Leave error recovering mode.
577
+ def yyerrok
578
+ @racc_error_status = 0
579
+ end
580
+
581
+ # For debugging output
582
+ def racc_read_token(t, tok, val)
583
+ @racc_debug_out.print 'read '
584
+ @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
585
+ @racc_debug_out.puts val.inspect
586
+ @racc_debug_out.puts
587
+ end
588
+
589
+ def racc_shift(tok, tstack, vstack)
590
+ @racc_debug_out.puts "shift #{racc_token2str tok}"
591
+ racc_print_stacks tstack, vstack
592
+ @racc_debug_out.puts
593
+ end
594
+
595
+ def racc_reduce(toks, sim, tstack, vstack)
596
+ out = @racc_debug_out
597
+ out.print 'reduce '
598
+ if toks.empty?
599
+ out.print ' <none>'
600
+ else
601
+ toks.each {|t| out.print ' ', racc_token2str(t) }
602
+ end
603
+ out.puts " --> #{racc_token2str(sim)}"
604
+ racc_print_stacks tstack, vstack
605
+ @racc_debug_out.puts
606
+ end
607
+
608
+ def racc_accept
609
+ @racc_debug_out.puts 'accept'
610
+ @racc_debug_out.puts
611
+ end
612
+
613
+ def racc_e_pop(state, tstack, vstack)
614
+ @racc_debug_out.puts 'error recovering mode: pop token'
615
+ racc_print_states state
616
+ racc_print_stacks tstack, vstack
617
+ @racc_debug_out.puts
618
+ end
619
+
620
+ def racc_next_state(curstate, state)
621
+ @racc_debug_out.puts "goto #{curstate}"
622
+ racc_print_states state
623
+ @racc_debug_out.puts
624
+ end
625
+
626
+ def racc_print_stacks(t, v)
627
+ out = @racc_debug_out
628
+ out.print ' ['
629
+ t.each_index do |i|
630
+ out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
631
+ end
632
+ out.puts ' ]'
633
+ end
634
+
635
+ def racc_print_states(s)
636
+ out = @racc_debug_out
637
+ out.print ' ['
638
+ s.each {|st| out.print ' ', st }
639
+ out.puts ' ]'
640
+ end
641
+
642
+ def racc_token2str(tok)
643
+ self.class::Racc_token_to_s_table[tok] or
644
+ raise "[Racc Bug] can't convert token #{tok} to string"
645
+ end
646
+
647
+ # Convert internal ID of token symbol to the string.
648
+ def token_to_str(t)
649
+ self.class::Racc_token_to_s_table[t]
650
+ end
651
+
652
+ end
653
+
654
+ end
655
+
656
+ ...end racc/parser.rb/module_eval...
657
+ end
658
+ ###### racc/parser.rb end
8
659
 
9
660
 
10
661
  require 'deep_merge'
@@ -14,7 +665,7 @@ require 'strscan'
14
665
  module Puffy
15
666
  class Parser < Racc::Parser
16
667
 
17
- module_eval(<<'...end parser.y/module_eval...', 'parser.y', 165)
668
+ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 166)
18
669
 
19
670
  attr_accessor :yydebug
20
671
  attr_reader :policy, :filename
@@ -77,7 +728,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 165)
77
728
  when s.scan(/do\b/) then emit(:DO, s.matched)
78
729
  when s.scan(/end\b/) then emit(:END, s.matched)
79
730
 
80
- when s.scan(/\$\S+/) then emit(:VARIABLE, s.matched[1..-1], s.matched_size)
731
+ when s.scan(/\$\w[\w-]*/) then emit(:VARIABLE, s.matched[1..-1], s.matched_size)
81
732
 
82
733
  when s.scan(/pass\b/) then emit(:PASS, s.matched)
83
734
  when s.scan(/block\b/) then emit(:BLOCK, s.matched)
@@ -103,7 +754,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 165)
103
754
  when s.scan(/[[:xdigit:]]*:[:[:xdigit:]]+(\/\d+)?/) && ip = ipaddress?(s) then emit(:ADDRESS, ip, s.matched_size)
104
755
 
105
756
  when s.scan(/\d+/) then emit(:INTEGER, s.matched.to_i, s.matched_size)
106
- when s.scan(/\w[\w-]+/) then emit(:IDENTIFIER, s.matched)
757
+ when s.scan(/\w[\w-]*/) then emit(:IDENTIFIER, s.matched)
107
758
 
108
759
  when s.scan(/=/) then emit('=', s.matched)
109
760
  when s.scan(/:/) then emit(':', s.matched)
@@ -227,134 +878,138 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 165)
227
878
  ##### State transition tables begin ###
228
879
 
229
880
  racc_action_table = [
230
- 133, 133, 130, 133, 133, 33, 154, 155, 166, 21,
231
- 74, 6, 22, 34, 119, 120, 17, 109, 7, 8,
232
- 114, 115, 18, 9, 109, 30, 31, 114, 115, 76,
233
- 77, 109, 76, 77, 114, 115, 132, 132, 21, 132,
234
- 132, 22, 168, 169, 106, 110, 111, 38, 10, 112,
235
- 113, 106, 110, 111, 67, 39, 112, 113, 106, 110,
236
- 111, 49, 66, 112, 113, 30, 31, 69, 47, 48,
237
- 50, 51, 49, 25, 26, 68, 76, 77, 38, 47,
238
- 48, 50, 51, 49, 25, 26, 39, 161, 9, 159,
239
- 47, 48, 50, 51, 49, 25, 26, 114, 115, 9,
240
- 15, 47, 48, 50, 51, 49, 25, 26, 59, 60,
241
- 30, 31, 47, 48, 50, 51, 49, 25, 26, 140,
242
- 141, 114, 115, 47, 48, 50, 51, 49, 25, 26,
243
- 89, 90, 91, 27, 47, 48, 50, 51, 49, 25,
244
- 26, 89, 90, 91, 62, 47, 48, 50, 51, 49,
245
- 25, 26, 89, 90, 91, 78, 47, 48, 50, 51,
246
- 49, 25, 26, 89, 90, 91, 96, 47, 48, 50,
247
- 51, 49, 25, 26, 135, 136, 76, 77, 47, 48,
248
- 50, 51, 49, 25, 26, 114, 115, 168, 169, 47,
249
- 48, 50, 51, 49, 25, 26, 99, 100, 101, 102,
250
- 47, 48, 50, 51, 6, 25, 26, 6, 103, 104,
251
- 6, 7, 8, 6, 7, 8, 9, 7, 8, 9,
252
- 7, 8, 9, 19, 118, 9, 24, 21, 54, 55,
253
- 22, 21, 25, 26, 22, 17, 17, 17, 122, 113,
254
- 113, 18, 18, 18, 28, 113, 161, 30, 31, 170,
255
- 171, 128, 129, 137, 143, 144, 147, 149, 113, 152,
256
- 153, 157, 161, 174, 175, 161, 177, 178 ]
881
+ 134, 134, 131, 134, 134, 6, 155, 156, 167, 75,
882
+ 162, 17, 160, 7, 8, 34, 110, 18, 9, 115,
883
+ 116, 111, 110, 10, 35, 115, 116, 111, 110, 77,
884
+ 78, 115, 116, 111, 21, 17, 133, 133, 22, 133,
885
+ 133, 18, 169, 170, 107, 112, 120, 121, 113, 114,
886
+ 107, 112, 17, 15, 113, 114, 107, 112, 18, 6,
887
+ 113, 114, 6, 27, 39, 77, 78, 7, 8, 6,
888
+ 7, 8, 9, 40, 24, 9, 6, 7, 8, 68,
889
+ 25, 26, 9, 50, 7, 8, 77, 78, 67, 9,
890
+ 48, 49, 51, 52, 50, 25, 26, 115, 116, 70,
891
+ 39, 48, 49, 51, 52, 50, 25, 26, 69, 40,
892
+ 9, 63, 48, 49, 51, 52, 50, 25, 26, 136,
893
+ 137, 9, 79, 48, 49, 51, 52, 50, 25, 26,
894
+ 141, 142, 115, 116, 48, 49, 51, 52, 50, 25,
895
+ 26, 30, 31, 32, 97, 48, 49, 51, 52, 50,
896
+ 25, 26, 30, 31, 32, 100, 48, 49, 51, 52,
897
+ 50, 25, 26, 90, 91, 92, 101, 48, 49, 51,
898
+ 52, 50, 25, 26, 90, 91, 92, 102, 48, 49,
899
+ 51, 52, 50, 25, 26, 90, 91, 92, 103, 48,
900
+ 49, 51, 52, 50, 25, 26, 90, 91, 92, 104,
901
+ 48, 49, 51, 52, 50, 25, 26, 77, 78, 115,
902
+ 116, 48, 49, 51, 52, 50, 25, 26, 169, 170,
903
+ 105, 119, 48, 49, 51, 52, 19, 25, 26, 123,
904
+ 21, 17, 55, 56, 22, 21, 21, 18, 28, 22,
905
+ 22, 30, 31, 32, 60, 61, 30, 31, 32, 162,
906
+ 114, 114, 171, 172, 114, 129, 130, 138, 144, 145,
907
+ 148, 150, 114, 153, 154, 158, 162, 175, 176, 162,
908
+ 178, 179 ]
257
909
 
258
910
  racc_action_check = [
259
- 113, 130, 113, 145, 155, 16, 145, 145, 163, 19,
260
- 52, 0, 19, 16, 97, 97, 7, 89, 0, 0,
261
- 89, 89, 7, 0, 90, 28, 28, 90, 90, 52,
262
- 52, 122, 97, 97, 122, 122, 113, 130, 55, 145,
263
- 155, 55, 163, 163, 89, 89, 89, 20, 1, 89,
264
- 89, 90, 90, 90, 47, 20, 90, 90, 122, 122,
265
- 122, 33, 47, 122, 122, 60, 60, 48, 33, 33,
266
- 33, 33, 34, 33, 33, 48, 74, 74, 54, 34,
267
- 34, 34, 34, 38, 34, 34, 54, 149, 38, 149,
268
- 38, 38, 38, 38, 39, 38, 38, 109, 109, 39,
269
- 6, 39, 39, 39, 39, 44, 39, 39, 41, 41,
270
- 41, 41, 44, 44, 44, 44, 45, 44, 44, 125,
271
- 125, 125, 125, 45, 45, 45, 45, 46, 45, 45,
272
- 70, 70, 70, 10, 46, 46, 46, 46, 57, 46,
273
- 46, 71, 71, 71, 43, 57, 57, 57, 57, 58,
274
- 57, 57, 72, 72, 72, 53, 58, 58, 58, 58,
275
- 66, 58, 58, 148, 148, 148, 73, 66, 66, 66,
276
- 66, 67, 66, 66, 117, 117, 120, 120, 67, 67,
277
- 67, 67, 68, 67, 67, 141, 141, 166, 166, 68,
278
- 68, 68, 68, 69, 68, 68, 81, 82, 84, 85,
279
- 69, 69, 69, 69, 2, 69, 69, 3, 86, 87,
280
- 4, 2, 2, 5, 3, 3, 2, 4, 4, 3,
281
- 5, 5, 4, 8, 95, 5, 9, 8, 35, 35,
282
- 8, 35, 9, 9, 35, 49, 50, 51, 105, 106,
283
- 107, 49, 50, 51, 15, 110, 164, 15, 15, 164,
284
- 164, 111, 112, 118, 128, 129, 132, 134, 140, 143,
285
- 144, 147, 159, 168, 169, 171, 174, 177 ]
911
+ 114, 131, 114, 146, 156, 0, 146, 146, 164, 53,
912
+ 150, 7, 150, 0, 0, 16, 90, 7, 0, 90,
913
+ 90, 90, 91, 1, 16, 91, 91, 91, 123, 53,
914
+ 53, 123, 123, 123, 19, 50, 114, 131, 19, 146,
915
+ 156, 50, 164, 164, 90, 90, 98, 98, 90, 90,
916
+ 91, 91, 51, 6, 91, 91, 123, 123, 51, 2,
917
+ 123, 123, 3, 10, 20, 98, 98, 2, 2, 4,
918
+ 3, 3, 2, 20, 9, 3, 5, 4, 4, 48,
919
+ 9, 9, 4, 34, 5, 5, 75, 75, 48, 5,
920
+ 34, 34, 34, 34, 35, 34, 34, 110, 110, 49,
921
+ 55, 35, 35, 35, 35, 39, 35, 35, 49, 55,
922
+ 39, 44, 39, 39, 39, 39, 40, 39, 39, 118,
923
+ 118, 40, 54, 40, 40, 40, 40, 45, 40, 40,
924
+ 126, 126, 126, 126, 45, 45, 45, 45, 46, 45,
925
+ 45, 28, 28, 28, 74, 46, 46, 46, 46, 47,
926
+ 46, 46, 61, 61, 61, 82, 47, 47, 47, 47,
927
+ 58, 47, 47, 71, 71, 71, 83, 58, 58, 58,
928
+ 58, 59, 58, 58, 72, 72, 72, 85, 59, 59,
929
+ 59, 59, 67, 59, 59, 73, 73, 73, 86, 67,
930
+ 67, 67, 67, 68, 67, 67, 149, 149, 149, 87,
931
+ 68, 68, 68, 68, 69, 68, 68, 121, 121, 142,
932
+ 142, 69, 69, 69, 69, 70, 69, 69, 167, 167,
933
+ 88, 96, 70, 70, 70, 70, 8, 70, 70, 106,
934
+ 8, 52, 36, 36, 8, 36, 56, 52, 15, 36,
935
+ 56, 15, 15, 15, 42, 42, 42, 42, 42, 165,
936
+ 107, 108, 165, 165, 111, 112, 113, 119, 129, 130,
937
+ 133, 135, 141, 144, 145, 148, 160, 169, 170, 172,
938
+ 175, 178 ]
286
939
 
287
940
  racc_action_pointer = [
288
- 9, 48, 202, 205, 208, 211, 97, 14, 219, 211,
289
- 133, nil, nil, nil, nil, 240, 1, nil, nil, 1,
290
- 43, nil, nil, nil, nil, nil, nil, nil, 18, nil,
291
- nil, nil, nil, 52, 63, 223, nil, nil, 74, 85,
292
- nil, 103, nil, 139, 96, 107, 118, 50, 63, 233,
293
- 234, 235, 6, 142, 74, 30, nil, 129, 140, nil,
294
- 58, nil, nil, nil, nil, nil, 151, 162, 173, 184,
295
- 102, 113, 124, 151, 53, nil, nil, nil, nil, nil,
296
- nil, 191, 184, nil, 185, 194, 195, 204, nil, 13,
297
- 20, nil, nil, nil, nil, 204, nil, 9, nil, nil,
298
- nil, nil, nil, nil, nil, 209, 202, 203, nil, 90,
299
- 208, 217, 218, -2, nil, nil, nil, 149, 245, nil,
300
- 153, nil, 27, nil, nil, 114, nil, nil, 246, 247,
301
- -1, nil, 217, nil, 230, nil, nil, nil, nil, nil,
302
- 221, 178, nil, 224, 225, 1, nil, 223, 135, 85,
303
- nil, nil, nil, nil, nil, 2, nil, nil, nil, 260,
304
- nil, nil, nil, 2, 244, nil, 147, nil, 256, 257,
305
- nil, 263, nil, nil, 229, nil, nil, 229, nil ]
941
+ 3, 23, 57, 60, 67, 74, 50, 9, 222, 58,
942
+ 63, nil, nil, nil, nil, 234, 11, nil, nil, 26,
943
+ 60, nil, nil, nil, nil, nil, nil, nil, 134, nil,
944
+ nil, nil, nil, nil, 73, 84, 227, nil, nil, 95,
945
+ 106, nil, 239, nil, 106, 117, 128, 139, 75, 95,
946
+ 33, 50, 229, 5, 108, 96, 228, nil, 150, 161,
947
+ nil, 145, nil, nil, nil, nil, nil, 172, 183, 194,
948
+ 205, 134, 145, 156, 128, 62, nil, nil, nil, nil,
949
+ nil, nil, 150, 152, nil, 163, 183, 185, 215, nil,
950
+ 12, 18, nil, nil, nil, nil, 200, nil, 41, nil,
951
+ nil, nil, nil, nil, nil, nil, 199, 213, 214, nil,
952
+ 90, 217, 221, 222, -2, nil, nil, nil, 93, 249,
953
+ nil, 183, nil, 24, nil, nil, 125, nil, nil, 250,
954
+ 251, -1, nil, 221, nil, 233, nil, nil, nil, nil,
955
+ nil, 225, 202, nil, 228, 229, 1, nil, 227, 167,
956
+ 8, nil, nil, nil, nil, nil, 2, nil, nil, nil,
957
+ 264, nil, nil, nil, 2, 247, nil, 178, nil, 260,
958
+ 261, nil, 267, nil, nil, 233, nil, nil, 233, nil ]
306
959
 
307
960
  racc_action_default = [
308
- -5, -99, -5, -5, -5, -5, -99, -99, -99, -99,
309
- -99, -1, -2, -3, -4, -99, -99, -14, -15, -99,
310
- -99, -21, -22, -32, -33, -46, -47, 179, -99, -7,
311
- -11, -12, -13, -31, -31, -99, -20, -17, -31, -31,
312
- -25, -99, -10, -99, -31, -31, -31, -99, -99, -99,
313
- -99, -99, -48, -99, -99, -99, -19, -31, -31, -6,
314
- -99, -9, -26, -28, -29, -30, -31, -31, -31, -31,
315
- -71, -71, -71, -43, -99, -50, -54, -55, -27, -16,
316
- -18, -99, -99, -8, -99, -99, -99, -99, -38, -81,
317
- -81, -69, -70, -39, -40, -44, -42, -99, -53, -23,
318
- -24, -34, -35, -36, -37, -67, -81, -81, -74, -99,
319
- -81, -99, -99, -99, -88, -89, -68, -56, -99, -49,
320
- -99, -52, -81, -72, -73, -99, -92, -76, -99, -99,
321
- -99, -80, -85, -86, -59, -57, -58, -45, -51, -66,
322
- -81, -99, -91, -99, -99, -99, -84, -99, -99, -99,
323
- -75, -90, -77, -78, -79, -99, -83, -87, -95, -99,
324
- -61, -65, -82, -41, -99, -64, -99, -94, -99, -99,
325
- -60, -99, -63, -93, -97, -98, -62, -99, -96 ]
961
+ -5, -100, -5, -5, -5, -5, -100, -100, -100, -100,
962
+ -100, -1, -2, -3, -4, -100, -100, -15, -16, -100,
963
+ -100, -22, -23, -33, -34, -47, -48, 180, -100, -7,
964
+ -11, -12, -13, -14, -32, -32, -100, -21, -18, -32,
965
+ -32, -26, -100, -10, -100, -32, -32, -32, -100, -100,
966
+ -100, -100, -100, -49, -100, -100, -100, -20, -32, -32,
967
+ -6, -100, -9, -27, -29, -30, -31, -32, -32, -32,
968
+ -32, -72, -72, -72, -44, -100, -51, -55, -56, -28,
969
+ -17, -19, -100, -100, -8, -100, -100, -100, -100, -39,
970
+ -82, -82, -70, -71, -40, -41, -45, -43, -100, -54,
971
+ -24, -25, -35, -36, -37, -38, -68, -82, -82, -75,
972
+ -100, -82, -100, -100, -100, -89, -90, -69, -57, -100,
973
+ -50, -100, -53, -82, -73, -74, -100, -93, -77, -100,
974
+ -100, -100, -81, -86, -87, -60, -58, -59, -46, -52,
975
+ -67, -82, -100, -92, -100, -100, -100, -85, -100, -100,
976
+ -100, -76, -91, -78, -79, -80, -100, -84, -88, -96,
977
+ -100, -62, -66, -83, -42, -100, -65, -100, -95, -100,
978
+ -100, -61, -100, -64, -94, -98, -99, -63, -100, -97 ]
326
979
 
327
980
  racc_goto_table = [
328
- 75, 20, 131, 37, 29, 123, 124, 41, 16, 127,
329
- 160, 32, 36, 105, 116, 167, 35, 42, 173, 146,
330
- 165, 23, 98, 73, 126, 172, 57, 58, 56, 95,
331
- 61, 53, 176, 117, 156, 134, 53, 79, 148, 150,
332
- 142, 63, 64, 65, 162, 121, 139, 158, 80, 83,
333
- 70, 71, 72, 163, 81, 82, 151, 1, 97, 11,
334
- 12, 13, 14, 84, 85, 86, 87, 164, 138, 88,
335
- 93, 94, 125, 145 ]
981
+ 76, 20, 132, 16, 29, 38, 161, 124, 125, 106,
982
+ 117, 128, 37, 58, 59, 168, 166, 43, 174, 147,
983
+ 127, 173, 99, 89, 94, 95, 42, 33, 177, 57,
984
+ 36, 62, 23, 74, 157, 96, 143, 118, 135, 149,
985
+ 80, 151, 140, 159, 163, 122, 71, 72, 73, 81,
986
+ 84, 54, 152, 164, 98, 1, 54, 11, 12, 13,
987
+ 14, 64, 65, 66, 165, 126, 146, nil, 139, nil,
988
+ nil, nil, nil, nil, 82, 83, nil, nil, nil, nil,
989
+ nil, nil, nil, 85, 86, 87, 88 ]
336
990
 
337
991
  racc_goto_check = [
338
- 27, 12, 35, 11, 7, 31, 31, 6, 8, 31,
339
- 29, 9, 12, 30, 30, 36, 10, 7, 36, 35,
340
- 29, 17, 27, 19, 32, 29, 4, 4, 12, 20,
341
- 7, 13, 29, 21, 35, 22, 13, 11, 23, 31,
342
- 32, 13, 13, 13, 35, 27, 30, 24, 12, 7,
343
- 8, 8, 8, 25, 13, 13, 32, 1, 26, 1,
344
- 1, 1, 1, 13, 13, 13, 13, 28, 27, 18,
345
- 18, 18, 33, 34 ]
992
+ 27, 12, 35, 8, 7, 11, 29, 31, 31, 30,
993
+ 30, 31, 12, 4, 4, 36, 29, 7, 36, 35,
994
+ 32, 29, 27, 18, 18, 18, 6, 9, 29, 12,
995
+ 10, 7, 17, 19, 35, 20, 32, 21, 22, 23,
996
+ 11, 31, 30, 24, 35, 27, 8, 8, 8, 12,
997
+ 7, 13, 32, 25, 26, 1, 13, 1, 1, 1,
998
+ 1, 13, 13, 13, 28, 33, 34, nil, 27, nil,
999
+ nil, nil, nil, nil, 13, 13, nil, nil, nil, nil,
1000
+ nil, nil, nil, 13, 13, 13, 13 ]
346
1001
 
347
1002
  racc_goto_pointer = [
348
- nil, 57, nil, nil, -12, nil, -21, -11, 1, -5,
349
- -3, -17, -7, -3, nil, nil, nil, 12, -1, -29,
350
- -44, -62, -82, -96, -101, -105, -16, -52, -92, -139,
351
- -76, -101, -85, -37, -57, -111, -148 ]
1003
+ nil, 55, nil, nil, -26, nil, -2, -11, -4, 11,
1004
+ 11, -15, -7, 16, nil, nil, nil, 23, -48, -20,
1005
+ -39, -59, -80, -96, -106, -106, -21, -53, -96, -144,
1006
+ -81, -100, -90, -45, -65, -112, -149 ]
352
1007
 
353
1008
  racc_goto_default = [
354
- nil, nil, 2, 3, 4, 5, nil, nil, nil, 40,
355
- nil, nil, nil, 43, 44, 45, 46, 52, nil, nil,
356
- nil, nil, nil, nil, 92, nil, nil, nil, nil, nil,
357
- nil, 108, 107, nil, nil, nil, nil ]
1009
+ nil, nil, 2, 3, 4, 5, nil, nil, nil, 41,
1010
+ nil, nil, nil, 44, 45, 46, 47, 53, nil, nil,
1011
+ nil, nil, nil, nil, 93, nil, nil, nil, nil, nil,
1012
+ nil, 109, 108, nil, nil, nil, nil ]
358
1013
 
359
1014
  racc_reduce_table = [
360
1015
  0, 0, :racc_error,
@@ -370,96 +1025,97 @@ racc_reduce_table = [
370
1025
  1, 48, :_reduce_10,
371
1026
  1, 49, :_reduce_11,
372
1027
  1, 49, :_reduce_12,
373
- 3, 47, :_reduce_13,
374
- 1, 50, :_reduce_14,
1028
+ 1, 49, :_reduce_13,
1029
+ 3, 47, :_reduce_14,
375
1030
  1, 50, :_reduce_15,
376
- 5, 45, :_reduce_16,
377
- 3, 45, :_reduce_17,
378
- 3, 52, :_reduce_18,
379
- 2, 52, :_reduce_19,
380
- 1, 52, :_reduce_20,
381
- 1, 54, :_reduce_21,
1031
+ 1, 50, :_reduce_16,
1032
+ 5, 45, :_reduce_17,
1033
+ 3, 45, :_reduce_18,
1034
+ 3, 52, :_reduce_19,
1035
+ 2, 52, :_reduce_20,
1036
+ 1, 52, :_reduce_21,
382
1037
  1, 54, :_reduce_22,
383
- 4, 53, :_reduce_23,
1038
+ 1, 54, :_reduce_23,
384
1039
  4, 53, :_reduce_24,
385
- 1, 53, :_reduce_25,
386
- 3, 51, :_reduce_26,
1040
+ 4, 53, :_reduce_25,
1041
+ 1, 53, :_reduce_26,
387
1042
  3, 51, :_reduce_27,
388
- 2, 55, :_reduce_28,
1043
+ 3, 51, :_reduce_28,
389
1044
  2, 55, :_reduce_29,
390
1045
  2, 55, :_reduce_30,
391
- 0, 55, :_reduce_31,
392
- 2, 46, :_reduce_32,
1046
+ 2, 55, :_reduce_31,
1047
+ 0, 55, :_reduce_32,
393
1048
  2, 46, :_reduce_33,
394
- 4, 57, :_reduce_34,
1049
+ 2, 46, :_reduce_34,
395
1050
  4, 57, :_reduce_35,
396
- 4, 58, :_reduce_36,
1051
+ 4, 57, :_reduce_36,
397
1052
  4, 58, :_reduce_37,
398
- 3, 56, :_reduce_38,
1053
+ 4, 58, :_reduce_38,
399
1054
  3, 56, :_reduce_39,
400
1055
  3, 56, :_reduce_40,
401
- 8, 56, :_reduce_41,
1056
+ 3, 56, :_reduce_41,
1057
+ 8, 56, :_reduce_42,
402
1058
  1, 62, :_reduce_none,
403
1059
  0, 62, :_reduce_none,
404
1060
  0, 63, :_reduce_none,
405
- 2, 63, :_reduce_45,
406
- 1, 59, :_reduce_46,
1061
+ 2, 63, :_reduce_46,
407
1062
  1, 59, :_reduce_47,
1063
+ 1, 59, :_reduce_48,
408
1064
  0, 61, :_reduce_none,
409
- 3, 61, :_reduce_49,
410
- 1, 61, :_reduce_50,
411
- 3, 68, :_reduce_51,
412
- 2, 68, :_reduce_52,
413
- 1, 68, :_reduce_53,
414
- 1, 69, :_reduce_54,
1065
+ 3, 61, :_reduce_50,
1066
+ 1, 61, :_reduce_51,
1067
+ 3, 68, :_reduce_52,
1068
+ 2, 68, :_reduce_53,
1069
+ 1, 68, :_reduce_54,
415
1070
  1, 69, :_reduce_55,
1071
+ 1, 69, :_reduce_56,
416
1072
  0, 64, :_reduce_none,
417
- 1, 64, :_reduce_57,
418
1073
  1, 64, :_reduce_58,
1074
+ 1, 64, :_reduce_59,
419
1075
  0, 65, :_reduce_none,
420
- 4, 65, :_reduce_60,
421
- 2, 65, :_reduce_61,
422
- 3, 70, :_reduce_62,
423
- 2, 70, :_reduce_63,
424
- 1, 70, :_reduce_64,
425
- 1, 71, :_reduce_65,
426
- 4, 66, :_reduce_66,
427
- 2, 66, :_reduce_67,
1076
+ 4, 65, :_reduce_61,
1077
+ 2, 65, :_reduce_62,
1078
+ 3, 70, :_reduce_63,
1079
+ 2, 70, :_reduce_64,
1080
+ 1, 70, :_reduce_65,
1081
+ 1, 71, :_reduce_66,
1082
+ 4, 66, :_reduce_67,
428
1083
  2, 66, :_reduce_68,
429
- 1, 66, :_reduce_69,
1084
+ 2, 66, :_reduce_69,
1085
+ 1, 66, :_reduce_70,
430
1086
  1, 60, :_reduce_none,
431
- 0, 60, :_reduce_71,
432
- 2, 72, :_reduce_72,
1087
+ 0, 60, :_reduce_72,
433
1088
  2, 72, :_reduce_73,
434
- 1, 72, :_reduce_74,
435
- 4, 72, :_reduce_75,
436
- 2, 72, :_reduce_76,
437
- 4, 72, :_reduce_77,
1089
+ 2, 72, :_reduce_74,
1090
+ 1, 72, :_reduce_75,
1091
+ 4, 72, :_reduce_76,
1092
+ 2, 72, :_reduce_77,
438
1093
  4, 72, :_reduce_78,
439
- 4, 73, :_reduce_79,
440
- 2, 73, :_reduce_80,
1094
+ 4, 72, :_reduce_79,
1095
+ 4, 73, :_reduce_80,
1096
+ 2, 73, :_reduce_81,
441
1097
  0, 73, :_reduce_none,
442
- 3, 76, :_reduce_82,
443
- 2, 76, :_reduce_83,
444
- 1, 76, :_reduce_84,
445
- 1, 77, :_reduce_85,
1098
+ 3, 76, :_reduce_83,
1099
+ 2, 76, :_reduce_84,
1100
+ 1, 76, :_reduce_85,
446
1101
  1, 77, :_reduce_86,
447
- 3, 77, :_reduce_87,
448
- 1, 74, :_reduce_88,
1102
+ 1, 77, :_reduce_87,
1103
+ 3, 77, :_reduce_88,
449
1104
  1, 74, :_reduce_89,
450
- 3, 75, :_reduce_90,
451
- 2, 75, :_reduce_91,
452
- 1, 75, :_reduce_92,
453
- 3, 67, :_reduce_93,
454
- 2, 67, :_reduce_94,
455
- 0, 67, :_reduce_95,
456
- 4, 78, :_reduce_96,
457
- 2, 78, :_reduce_97,
458
- 2, 78, :_reduce_98 ]
1105
+ 1, 74, :_reduce_90,
1106
+ 3, 75, :_reduce_91,
1107
+ 2, 75, :_reduce_92,
1108
+ 1, 75, :_reduce_93,
1109
+ 3, 67, :_reduce_94,
1110
+ 2, 67, :_reduce_95,
1111
+ 0, 67, :_reduce_96,
1112
+ 4, 78, :_reduce_97,
1113
+ 2, 78, :_reduce_98,
1114
+ 2, 78, :_reduce_99 ]
459
1115
 
460
- racc_reduce_n = 99
1116
+ racc_reduce_n = 100
461
1117
 
462
- racc_shift_n = 179
1118
+ racc_shift_n = 180
463
1119
 
464
1120
  racc_token_table = {
465
1121
  false => 0,
@@ -471,30 +1127,30 @@ racc_token_table = {
471
1127
  "," => 6,
472
1128
  :ADDRESS => 7,
473
1129
  :STRING => 8,
474
- :SERVICE => 9,
475
- :NODE => 10,
476
- :REGEX => 11,
477
- :DO => 12,
478
- :END => 13,
479
- :POLICY => 14,
480
- :LOG => 15,
481
- :IPV4 => 16,
482
- :IPV6 => 17,
483
- :CLIENT => 18,
484
- :SERVER => 19,
485
- :ON => 20,
486
- :BLOCK => 21,
487
- :PASS => 22,
488
- :IN => 23,
489
- :OUT => 24,
490
- :INET => 25,
491
- :INET6 => 26,
492
- :PROTO => 27,
493
- :FROM => 28,
494
- :TO => 29,
495
- :ALL => 30,
496
- :ANY => 31,
497
- :VARIABLE => 32,
1130
+ :VARIABLE => 9,
1131
+ :SERVICE => 10,
1132
+ :NODE => 11,
1133
+ :REGEX => 12,
1134
+ :DO => 13,
1135
+ :END => 14,
1136
+ :POLICY => 15,
1137
+ :LOG => 16,
1138
+ :IPV4 => 17,
1139
+ :IPV6 => 18,
1140
+ :CLIENT => 19,
1141
+ :SERVER => 20,
1142
+ :ON => 21,
1143
+ :BLOCK => 22,
1144
+ :PASS => 23,
1145
+ :IN => 24,
1146
+ :OUT => 25,
1147
+ :INET => 26,
1148
+ :INET6 => 27,
1149
+ :PROTO => 28,
1150
+ :FROM => 29,
1151
+ :TO => 30,
1152
+ :ALL => 31,
1153
+ :ANY => 32,
498
1154
  :SRV => 33,
499
1155
  "(" => 34,
500
1156
  ")" => 35,
@@ -524,6 +1180,7 @@ Racc_arg = [
524
1180
  racc_shift_n,
525
1181
  racc_reduce_n,
526
1182
  racc_use_result_var ]
1183
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
527
1184
 
528
1185
  Racc_token_to_s_table = [
529
1186
  "$end",
@@ -535,6 +1192,7 @@ Racc_token_to_s_table = [
535
1192
  "\",\"",
536
1193
  "ADDRESS",
537
1194
  "STRING",
1195
+ "VARIABLE",
538
1196
  "SERVICE",
539
1197
  "NODE",
540
1198
  "REGEX",
@@ -558,7 +1216,6 @@ Racc_token_to_s_table = [
558
1216
  "TO",
559
1217
  "ALL",
560
1218
  "ANY",
561
- "VARIABLE",
562
1219
  "SRV",
563
1220
  "\"(\"",
564
1221
  "\")\"",
@@ -605,6 +1262,7 @@ Racc_token_to_s_table = [
605
1262
  "port_list",
606
1263
  "port",
607
1264
  "filteropt" ]
1265
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
608
1266
 
609
1267
  Racc_debug_parser = false
610
1268
 
@@ -629,7 +1287,7 @@ module_eval(<<'.,.,', 'parser.y', 4)
629
1287
 
630
1288
  module_eval(<<'.,.,', 'parser.y', 8)
631
1289
  def _reduce_6(val, _values, result)
632
- @variables[val[0][:value]] = val[3].freeze
1290
+ @variables[val[0][:value]] = val[3].flatten.freeze
633
1291
  result
634
1292
  end
635
1293
  .,.,
@@ -676,16 +1334,16 @@ module_eval(<<'.,.,', 'parser.y', 16)
676
1334
  end
677
1335
  .,.,
678
1336
 
679
- module_eval(<<'.,.,', 'parser.y', 18)
1337
+ module_eval(<<'.,.,', 'parser.y', 17)
680
1338
  def _reduce_13(val, _values, result)
681
- @services[val[1]] = val[2]
1339
+ result = @variables.fetch(val[0][:value])
682
1340
  result
683
1341
  end
684
1342
  .,.,
685
1343
 
686
- module_eval(<<'.,.,', 'parser.y', 20)
1344
+ module_eval(<<'.,.,', 'parser.y', 19)
687
1345
  def _reduce_14(val, _values, result)
688
- result = val[0][:value]
1346
+ @services[val[1]] = val[2]
689
1347
  result
690
1348
  end
691
1349
  .,.,
@@ -697,44 +1355,44 @@ module_eval(<<'.,.,', 'parser.y', 21)
697
1355
  end
698
1356
  .,.,
699
1357
 
700
- module_eval(<<'.,.,', 'parser.y', 23)
1358
+ module_eval(<<'.,.,', 'parser.y', 22)
701
1359
  def _reduce_16(val, _values, result)
702
- val[2].each { |name| @nodes[name] = val[4]; @saved_policies[name] = @policy }
1360
+ result = val[0][:value]
703
1361
  result
704
1362
  end
705
1363
  .,.,
706
1364
 
707
1365
  module_eval(<<'.,.,', 'parser.y', 24)
708
1366
  def _reduce_17(val, _values, result)
709
- @nodes[val[1]] = val[2]; @saved_policies[val[1]] = @policy
1367
+ val[2].each { |name| @nodes[name] = val[4]; @saved_policies[name] = @policy }
710
1368
  result
711
1369
  end
712
1370
  .,.,
713
1371
 
714
- module_eval(<<'.,.,', 'parser.y', 26)
1372
+ module_eval(<<'.,.,', 'parser.y', 25)
715
1373
  def _reduce_18(val, _values, result)
716
- result = val[0] + [val[2]]
1374
+ @nodes[val[1]] = val[2]; @saved_policies[val[1]] = @policy
717
1375
  result
718
1376
  end
719
1377
  .,.,
720
1378
 
721
1379
  module_eval(<<'.,.,', 'parser.y', 27)
722
1380
  def _reduce_19(val, _values, result)
723
- result = val[0] + [val[1]]
1381
+ result = val[0] + [val[2]]
724
1382
  result
725
1383
  end
726
1384
  .,.,
727
1385
 
728
1386
  module_eval(<<'.,.,', 'parser.y', 28)
729
1387
  def _reduce_20(val, _values, result)
730
- result = [val[0]]
1388
+ result = val[0] + [val[1]]
731
1389
  result
732
1390
  end
733
1391
  .,.,
734
1392
 
735
- module_eval(<<'.,.,', 'parser.y', 30)
1393
+ module_eval(<<'.,.,', 'parser.y', 29)
736
1394
  def _reduce_21(val, _values, result)
737
- result = val[0][:value]
1395
+ result = [val[0]]
738
1396
  result
739
1397
  end
740
1398
  .,.,
@@ -746,9 +1404,9 @@ module_eval(<<'.,.,', 'parser.y', 31)
746
1404
  end
747
1405
  .,.,
748
1406
 
749
- module_eval(<<'.,.,', 'parser.y', 33)
1407
+ module_eval(<<'.,.,', 'parser.y', 32)
750
1408
  def _reduce_23(val, _values, result)
751
- @policy = val[1]; result = val[2]
1409
+ result = val[0][:value]
752
1410
  result
753
1411
  end
754
1412
  .,.,
@@ -762,14 +1420,14 @@ module_eval(<<'.,.,', 'parser.y', 34)
762
1420
 
763
1421
  module_eval(<<'.,.,', 'parser.y', 35)
764
1422
  def _reduce_25(val, _values, result)
765
- @policy = nil; result = val[0]
1423
+ @policy = val[1]; result = val[2]
766
1424
  result
767
1425
  end
768
1426
  .,.,
769
1427
 
770
- module_eval(<<'.,.,', 'parser.y', 37)
1428
+ module_eval(<<'.,.,', 'parser.y', 36)
771
1429
  def _reduce_26(val, _values, result)
772
- result = val[1].freeze
1430
+ @policy = nil; result = val[0]
773
1431
  result
774
1432
  end
775
1433
  .,.,
@@ -781,9 +1439,9 @@ module_eval(<<'.,.,', 'parser.y', 38)
781
1439
  end
782
1440
  .,.,
783
1441
 
784
- module_eval(<<'.,.,', 'parser.y', 40)
1442
+ module_eval(<<'.,.,', 'parser.y', 39)
785
1443
  def _reduce_28(val, _values, result)
786
- result = val[0] + val[1]
1444
+ result = val[1].freeze
787
1445
  result
788
1446
  end
789
1447
  .,.,
@@ -804,28 +1462,28 @@ module_eval(<<'.,.,', 'parser.y', 42)
804
1462
 
805
1463
  module_eval(<<'.,.,', 'parser.y', 43)
806
1464
  def _reduce_31(val, _values, result)
807
- result = []
1465
+ result = val[0] + val[1]
808
1466
  result
809
1467
  end
810
1468
  .,.,
811
1469
 
812
- module_eval(<<'.,.,', 'parser.y', 45)
1470
+ module_eval(<<'.,.,', 'parser.y', 44)
813
1471
  def _reduce_32(val, _values, result)
814
- result = val[1][:action]
1472
+ result = []
815
1473
  result
816
1474
  end
817
1475
  .,.,
818
1476
 
819
1477
  module_eval(<<'.,.,', 'parser.y', 46)
820
1478
  def _reduce_33(val, _values, result)
821
- result = 'log'
1479
+ result = val[1][:action]
822
1480
  result
823
1481
  end
824
1482
  .,.,
825
1483
 
826
- module_eval(<<'.,.,', 'parser.y', 48)
1484
+ module_eval(<<'.,.,', 'parser.y', 47)
827
1485
  def _reduce_34(val, _values, result)
828
- result = val[2].reject { |x| x[:af] == :inet6 }.map { |x| x[:af] = :inet ; x }
1486
+ result = 'log'
829
1487
  result
830
1488
  end
831
1489
  .,.,
@@ -837,9 +1495,9 @@ module_eval(<<'.,.,', 'parser.y', 49)
837
1495
  end
838
1496
  .,.,
839
1497
 
840
- module_eval(<<'.,.,', 'parser.y', 51)
1498
+ module_eval(<<'.,.,', 'parser.y', 50)
841
1499
  def _reduce_36(val, _values, result)
842
- result = val[2].reject { |x| x[:af] == :inet }.map { |x| x[:af] = :inet6 ; x }
1500
+ result = val[2].reject { |x| x[:af] == :inet6 }.map { |x| x[:af] = :inet ; x }
843
1501
  result
844
1502
  end
845
1503
  .,.,
@@ -851,8 +1509,15 @@ module_eval(<<'.,.,', 'parser.y', 52)
851
1509
  end
852
1510
  .,.,
853
1511
 
854
- module_eval(<<'.,.,', 'parser.y', 55)
1512
+ module_eval(<<'.,.,', 'parser.y', 53)
855
1513
  def _reduce_38(val, _values, result)
1514
+ result = val[2].reject { |x| x[:af] == :inet }.map { |x| x[:af] = :inet6 ; x }
1515
+ result
1516
+ end
1517
+ .,.,
1518
+
1519
+ module_eval(<<'.,.,', 'parser.y', 56)
1520
+ def _reduce_39(val, _values, result)
856
1521
  begin
857
1522
  result = constraint_service_to_hosts(val[1], val[2])
858
1523
  rescue KeyError
@@ -863,8 +1528,8 @@ module_eval(<<'.,.,', 'parser.y', 55)
863
1528
  end
864
1529
  .,.,
865
1530
 
866
- module_eval(<<'.,.,', 'parser.y', 62)
867
- def _reduce_39(val, _values, result)
1531
+ module_eval(<<'.,.,', 'parser.y', 63)
1532
+ def _reduce_40(val, _values, result)
868
1533
  begin
869
1534
  raise "service #{val[1]} cannot be used as client" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
870
1535
  result = constraint_service_to_hosts(val[1], val[2]).map { |item| item.merge(dir: :out) }
@@ -876,8 +1541,8 @@ module_eval(<<'.,.,', 'parser.y', 62)
876
1541
  end
877
1542
  .,.,
878
1543
 
879
- module_eval(<<'.,.,', 'parser.y', 70)
880
- def _reduce_40(val, _values, result)
1544
+ module_eval(<<'.,.,', 'parser.y', 71)
1545
+ def _reduce_41(val, _values, result)
881
1546
  begin
882
1547
  raise "service #{val[1]} cannot be used as server" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
883
1548
  result = constraint_service_to_hosts(val[1], val[2]).map { |item| item.merge(dir: :in) }
@@ -889,277 +1554,270 @@ module_eval(<<'.,.,', 'parser.y', 70)
889
1554
  end
890
1555
  .,.,
891
1556
 
892
- module_eval(<<'.,.,', 'parser.y', 77)
893
- def _reduce_41(val, _values, result)
1557
+ module_eval(<<'.,.,', 'parser.y', 78)
1558
+ def _reduce_42(val, _values, result)
894
1559
  result = [val.compact.inject(:merge)]
895
1560
  result
896
1561
  end
897
1562
  .,.,
898
1563
 
899
- # reduce 42 omitted
900
-
901
1564
  # reduce 43 omitted
902
1565
 
903
1566
  # reduce 44 omitted
904
1567
 
905
- module_eval(<<'.,.,', 'parser.y', 83)
906
- def _reduce_45(val, _values, result)
907
- result = { on: val[1][:value] }
908
- result
909
- end
910
- .,.,
1568
+ # reduce 45 omitted
911
1569
 
912
- module_eval(<<'.,.,', 'parser.y', 85)
1570
+ module_eval(<<'.,.,', 'parser.y', 84)
913
1571
  def _reduce_46(val, _values, result)
914
- result = { action: :block }
1572
+ result = { on: val[1][:value] }
915
1573
  result
916
1574
  end
917
1575
  .,.,
918
1576
 
919
1577
  module_eval(<<'.,.,', 'parser.y', 86)
920
1578
  def _reduce_47(val, _values, result)
921
- result = { action: :pass }
1579
+ result = { action: :block }
922
1580
  result
923
1581
  end
924
1582
  .,.,
925
1583
 
926
- # reduce 48 omitted
927
-
928
- module_eval(<<'.,.,', 'parser.y', 89)
929
- def _reduce_49(val, _values, result)
930
- result = { dir: val[1] }
1584
+ module_eval(<<'.,.,', 'parser.y', 87)
1585
+ def _reduce_48(val, _values, result)
1586
+ result = { action: :pass }
931
1587
  result
932
1588
  end
933
1589
  .,.,
934
1590
 
1591
+ # reduce 49 omitted
1592
+
935
1593
  module_eval(<<'.,.,', 'parser.y', 90)
936
1594
  def _reduce_50(val, _values, result)
937
- result = { dir: val[0] }
1595
+ result = { dir: val[1] }
938
1596
  result
939
1597
  end
940
1598
  .,.,
941
1599
 
942
- module_eval(<<'.,.,', 'parser.y', 92)
1600
+ module_eval(<<'.,.,', 'parser.y', 91)
943
1601
  def _reduce_51(val, _values, result)
944
- result = val[0] + [val[2]]
1602
+ result = { dir: val[0] }
945
1603
  result
946
1604
  end
947
1605
  .,.,
948
1606
 
949
1607
  module_eval(<<'.,.,', 'parser.y', 93)
950
1608
  def _reduce_52(val, _values, result)
951
- result = val[0] + [val[1]]
1609
+ result = val[0] + [val[2]]
952
1610
  result
953
1611
  end
954
1612
  .,.,
955
1613
 
956
1614
  module_eval(<<'.,.,', 'parser.y', 94)
957
1615
  def _reduce_53(val, _values, result)
958
- result = [val[0]]
1616
+ result = val[0] + [val[1]]
959
1617
  result
960
1618
  end
961
1619
  .,.,
962
1620
 
963
- module_eval(<<'.,.,', 'parser.y', 96)
1621
+ module_eval(<<'.,.,', 'parser.y', 95)
964
1622
  def _reduce_54(val, _values, result)
965
- result = :in
1623
+ result = [val[0]]
966
1624
  result
967
1625
  end
968
1626
  .,.,
969
1627
 
970
1628
  module_eval(<<'.,.,', 'parser.y', 97)
971
1629
  def _reduce_55(val, _values, result)
972
- result = :out
1630
+ result = :in
973
1631
  result
974
1632
  end
975
1633
  .,.,
976
1634
 
977
- # reduce 56 omitted
978
-
979
- module_eval(<<'.,.,', 'parser.y', 100)
980
- def _reduce_57(val, _values, result)
981
- result = { af: :inet }
1635
+ module_eval(<<'.,.,', 'parser.y', 98)
1636
+ def _reduce_56(val, _values, result)
1637
+ result = :out
982
1638
  result
983
1639
  end
984
1640
  .,.,
985
1641
 
1642
+ # reduce 57 omitted
1643
+
986
1644
  module_eval(<<'.,.,', 'parser.y', 101)
987
1645
  def _reduce_58(val, _values, result)
988
- result = { af: :inet6 }
1646
+ result = { af: :inet }
989
1647
  result
990
1648
  end
991
1649
  .,.,
992
1650
 
993
- # reduce 59 omitted
994
-
995
- module_eval(<<'.,.,', 'parser.y', 104)
996
- def _reduce_60(val, _values, result)
997
- result = { proto: val[2] }
1651
+ module_eval(<<'.,.,', 'parser.y', 102)
1652
+ def _reduce_59(val, _values, result)
1653
+ result = { af: :inet6 }
998
1654
  result
999
1655
  end
1000
1656
  .,.,
1001
1657
 
1658
+ # reduce 60 omitted
1659
+
1002
1660
  module_eval(<<'.,.,', 'parser.y', 105)
1003
1661
  def _reduce_61(val, _values, result)
1004
- result = { proto: val[1] }
1662
+ result = { proto: val[2] }
1005
1663
  result
1006
1664
  end
1007
1665
  .,.,
1008
1666
 
1009
- module_eval(<<'.,.,', 'parser.y', 107)
1667
+ module_eval(<<'.,.,', 'parser.y', 106)
1010
1668
  def _reduce_62(val, _values, result)
1011
- result = val[0] + [val[2]]
1669
+ result = { proto: val[1] }
1012
1670
  result
1013
1671
  end
1014
1672
  .,.,
1015
1673
 
1016
1674
  module_eval(<<'.,.,', 'parser.y', 108)
1017
1675
  def _reduce_63(val, _values, result)
1018
- result = val[0] + [val[1]]
1676
+ result = val[0] + [val[2]]
1019
1677
  result
1020
1678
  end
1021
1679
  .,.,
1022
1680
 
1023
1681
  module_eval(<<'.,.,', 'parser.y', 109)
1024
1682
  def _reduce_64(val, _values, result)
1025
- result = [val[0]]
1683
+ result = val[0] + [val[1]]
1026
1684
  result
1027
1685
  end
1028
1686
  .,.,
1029
1687
 
1030
- module_eval(<<'.,.,', 'parser.y', 111)
1688
+ module_eval(<<'.,.,', 'parser.y', 110)
1031
1689
  def _reduce_65(val, _values, result)
1032
- result = val[0][:value].to_sym
1690
+ result = [val[0]]
1033
1691
  result
1034
1692
  end
1035
1693
  .,.,
1036
1694
 
1037
- module_eval(<<'.,.,', 'parser.y', 113)
1695
+ module_eval(<<'.,.,', 'parser.y', 112)
1038
1696
  def _reduce_66(val, _values, result)
1039
- result = { from: val[1], to: val[3] }
1697
+ result = val[0][:value].to_sym
1040
1698
  result
1041
1699
  end
1042
1700
  .,.,
1043
1701
 
1044
1702
  module_eval(<<'.,.,', 'parser.y', 114)
1045
1703
  def _reduce_67(val, _values, result)
1046
- result = { from: val[1] }
1704
+ result = { from: val[1], to: val[3] }
1047
1705
  result
1048
1706
  end
1049
1707
  .,.,
1050
1708
 
1051
1709
  module_eval(<<'.,.,', 'parser.y', 115)
1052
1710
  def _reduce_68(val, _values, result)
1053
- result = { to: val[1] }
1711
+ result = { from: val[1] }
1054
1712
  result
1055
1713
  end
1056
1714
  .,.,
1057
1715
 
1058
1716
  module_eval(<<'.,.,', 'parser.y', 116)
1059
1717
  def _reduce_69(val, _values, result)
1060
- result = {}
1718
+ result = { to: val[1] }
1061
1719
  result
1062
1720
  end
1063
1721
  .,.,
1064
1722
 
1065
- # reduce 70 omitted
1066
-
1067
- module_eval(<<'.,.,', 'parser.y', 119)
1068
- def _reduce_71(val, _values, result)
1723
+ module_eval(<<'.,.,', 'parser.y', 117)
1724
+ def _reduce_70(val, _values, result)
1069
1725
  result = {}
1070
1726
  result
1071
1727
  end
1072
1728
  .,.,
1073
1729
 
1074
- module_eval(<<'.,.,', 'parser.y', 121)
1730
+ # reduce 71 omitted
1731
+
1732
+ module_eval(<<'.,.,', 'parser.y', 120)
1075
1733
  def _reduce_72(val, _values, result)
1076
- result = [{ host: nil, port: val[1] }]
1734
+ result = {}
1077
1735
  result
1078
1736
  end
1079
1737
  .,.,
1080
1738
 
1081
1739
  module_eval(<<'.,.,', 'parser.y', 122)
1082
1740
  def _reduce_73(val, _values, result)
1083
- result = [{ host: val[0], port: val[1] }]
1741
+ result = [{ host: nil, port: val[1] }]
1084
1742
  result
1085
1743
  end
1086
1744
  .,.,
1087
1745
 
1088
1746
  module_eval(<<'.,.,', 'parser.y', 123)
1089
1747
  def _reduce_74(val, _values, result)
1090
- result = [{ host: nil, port: val[0] }]
1748
+ result = [{ host: val[0], port: val[1] }]
1091
1749
  result
1092
1750
  end
1093
1751
  .,.,
1094
1752
 
1095
1753
  module_eval(<<'.,.,', 'parser.y', 124)
1096
1754
  def _reduce_75(val, _values, result)
1097
- result = [{ host: val[1], port: val[3] }]
1755
+ result = [{ host: nil, port: val[0] }]
1098
1756
  result
1099
1757
  end
1100
1758
  .,.,
1101
1759
 
1102
1760
  module_eval(<<'.,.,', 'parser.y', 125)
1103
1761
  def _reduce_76(val, _values, result)
1104
- result = [{ host: @variables.fetch(val[0][:value]), port: val[1] }]
1762
+ result = [{ host: val[1], port: val[3] }]
1105
1763
  result
1106
1764
  end
1107
1765
  .,.,
1108
1766
 
1109
1767
  module_eval(<<'.,.,', 'parser.y', 126)
1110
1768
  def _reduce_77(val, _values, result)
1111
- result = Resolver.instance.resolv_srv(val[2][:value])
1769
+ result = [{ host: @variables.fetch(val[0][:value]), port: val[1] }]
1112
1770
  result
1113
1771
  end
1114
1772
  .,.,
1115
1773
 
1116
1774
  module_eval(<<'.,.,', 'parser.y', 127)
1117
1775
  def _reduce_78(val, _values, result)
1118
- result = Resolver.instance.resolv_apt_mirror(val[2][:value])
1776
+ result = Resolver.instance.resolv_srv(val[2][:value])
1119
1777
  result
1120
1778
  end
1121
1779
  .,.,
1122
1780
 
1123
- module_eval(<<'.,.,', 'parser.y', 129)
1781
+ module_eval(<<'.,.,', 'parser.y', 128)
1124
1782
  def _reduce_79(val, _values, result)
1125
- result = val[2]
1783
+ result = Resolver.instance.resolv_apt_mirror(val[2][:value])
1126
1784
  result
1127
1785
  end
1128
1786
  .,.,
1129
1787
 
1130
1788
  module_eval(<<'.,.,', 'parser.y', 130)
1131
1789
  def _reduce_80(val, _values, result)
1132
- result = val[1]
1790
+ result = val[2]
1133
1791
  result
1134
1792
  end
1135
1793
  .,.,
1136
1794
 
1137
- # reduce 81 omitted
1138
-
1139
- module_eval(<<'.,.,', 'parser.y', 133)
1140
- def _reduce_82(val, _values, result)
1141
- result = val[0] + [val[2]]
1795
+ module_eval(<<'.,.,', 'parser.y', 131)
1796
+ def _reduce_81(val, _values, result)
1797
+ result = val[1]
1142
1798
  result
1143
1799
  end
1144
1800
  .,.,
1145
1801
 
1802
+ # reduce 82 omitted
1803
+
1146
1804
  module_eval(<<'.,.,', 'parser.y', 134)
1147
1805
  def _reduce_83(val, _values, result)
1148
- result = val[0] + [val[1]]
1806
+ result = val[0] + [val[2]]
1149
1807
  result
1150
1808
  end
1151
1809
  .,.,
1152
1810
 
1153
1811
  module_eval(<<'.,.,', 'parser.y', 135)
1154
1812
  def _reduce_84(val, _values, result)
1155
- result = [val[0]]
1813
+ result = val[0] + [val[1]]
1156
1814
  result
1157
1815
  end
1158
1816
  .,.,
1159
1817
 
1160
- module_eval(<<'.,.,', 'parser.y', 137)
1818
+ module_eval(<<'.,.,', 'parser.y', 136)
1161
1819
  def _reduce_85(val, _values, result)
1162
- result = val[0][:value]
1820
+ result = [val[0]]
1163
1821
  result
1164
1822
  end
1165
1823
  .,.,
@@ -1173,14 +1831,14 @@ module_eval(<<'.,.,', 'parser.y', 138)
1173
1831
 
1174
1832
  module_eval(<<'.,.,', 'parser.y', 139)
1175
1833
  def _reduce_87(val, _values, result)
1176
- result = Range.new(val[0][:value], val[2][:value])
1834
+ result = val[0][:value]
1177
1835
  result
1178
1836
  end
1179
1837
  .,.,
1180
1838
 
1181
- module_eval(<<'.,.,', 'parser.y', 141)
1839
+ module_eval(<<'.,.,', 'parser.y', 140)
1182
1840
  def _reduce_88(val, _values, result)
1183
- result = val[0][:value]
1841
+ result = Range.new(val[0][:value], val[2][:value])
1184
1842
  result
1185
1843
  end
1186
1844
  .,.,
@@ -1192,64 +1850,71 @@ module_eval(<<'.,.,', 'parser.y', 142)
1192
1850
  end
1193
1851
  .,.,
1194
1852
 
1195
- module_eval(<<'.,.,', 'parser.y', 144)
1853
+ module_eval(<<'.,.,', 'parser.y', 143)
1196
1854
  def _reduce_90(val, _values, result)
1197
- result = val[0] + [val[2]]
1855
+ result = val[0][:value]
1198
1856
  result
1199
1857
  end
1200
1858
  .,.,
1201
1859
 
1202
1860
  module_eval(<<'.,.,', 'parser.y', 145)
1203
1861
  def _reduce_91(val, _values, result)
1204
- result = val[0] + [val[1]]
1862
+ result = val[0] + [val[2]]
1205
1863
  result
1206
1864
  end
1207
1865
  .,.,
1208
1866
 
1209
1867
  module_eval(<<'.,.,', 'parser.y', 146)
1210
1868
  def _reduce_92(val, _values, result)
1211
- result = [val[0]]
1869
+ result = val[0] + [val[1]]
1212
1870
  result
1213
1871
  end
1214
1872
  .,.,
1215
1873
 
1216
- module_eval(<<'.,.,', 'parser.y', 148)
1874
+ module_eval(<<'.,.,', 'parser.y', 147)
1217
1875
  def _reduce_93(val, _values, result)
1218
- result = val[0].merge(val[2])
1876
+ result = [val[0]]
1219
1877
  result
1220
1878
  end
1221
1879
  .,.,
1222
1880
 
1223
1881
  module_eval(<<'.,.,', 'parser.y', 149)
1224
1882
  def _reduce_94(val, _values, result)
1225
- result = val[0].merge(val[1])
1883
+ result = val[0].merge(val[2])
1226
1884
  result
1227
1885
  end
1228
1886
  .,.,
1229
1887
 
1230
1888
  module_eval(<<'.,.,', 'parser.y', 150)
1231
1889
  def _reduce_95(val, _values, result)
1232
- result = {}
1890
+ result = val[0].merge(val[1])
1233
1891
  result
1234
1892
  end
1235
1893
  .,.,
1236
1894
 
1237
- module_eval(<<'.,.,', 'parser.y', 152)
1895
+ module_eval(<<'.,.,', 'parser.y', 151)
1238
1896
  def _reduce_96(val, _values, result)
1239
- result = { rdr_to: [{ host: val[1][:value], port: val[3][:value] }] }
1897
+ result = {}
1240
1898
  result
1241
1899
  end
1242
1900
  .,.,
1243
1901
 
1244
1902
  module_eval(<<'.,.,', 'parser.y', 153)
1245
1903
  def _reduce_97(val, _values, result)
1246
- result = { rdr_to: [{ host: val[1][:value], port: nil }] }
1904
+ result = { rdr_to: [{ host: val[1][:value], port: val[3][:value] }] }
1247
1905
  result
1248
1906
  end
1249
1907
  .,.,
1250
1908
 
1251
1909
  module_eval(<<'.,.,', 'parser.y', 154)
1252
1910
  def _reduce_98(val, _values, result)
1911
+ result = { rdr_to: [{ host: val[1][:value], port: nil }] }
1912
+ result
1913
+ end
1914
+ .,.,
1915
+
1916
+ module_eval(<<'.,.,', 'parser.y', 155)
1917
+ def _reduce_99(val, _values, result)
1253
1918
  result = { nat_to: val[1][:value] }
1254
1919
  result
1255
1920
  end