racc 1.4.14 → 1.4.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/Manifest.txt +50 -0
  3. data/ext/racc/com/headius/racc/Cparse.java +66 -23
  4. data/ext/racc/cparse.c +1 -1
  5. data/ext/racc/depend +1 -1
  6. data/lib/racc/info.rb +2 -2
  7. data/test/assets/bibtex.y +141 -0
  8. data/test/assets/cadenza.y +170 -0
  9. data/test/assets/cast.y +926 -0
  10. data/test/assets/csspool.y +729 -0
  11. data/test/assets/edtf.y +583 -0
  12. data/test/assets/huia.y +318 -0
  13. data/test/assets/journey.y +47 -0
  14. data/test/assets/liquor.y +313 -0
  15. data/test/assets/machete.y +423 -0
  16. data/test/assets/macruby.y +2197 -0
  17. data/test/assets/mediacloth.y +599 -0
  18. data/test/assets/mof.y +649 -0
  19. data/test/assets/namae.y +302 -0
  20. data/test/assets/nasl.y +626 -0
  21. data/test/assets/nokogiri-css.y +255 -0
  22. data/test/assets/opal.y +1807 -0
  23. data/test/assets/php_serialization.y +98 -0
  24. data/test/assets/rdblockparser.y +576 -0
  25. data/test/assets/rdinlineparser.y +561 -0
  26. data/test/assets/riml.y +665 -0
  27. data/test/assets/ruby18.y +1943 -0
  28. data/test/assets/ruby19.y +2174 -0
  29. data/test/assets/ruby20.y +2350 -0
  30. data/test/assets/ruby21.y +2359 -0
  31. data/test/assets/ruby22.y +2381 -0
  32. data/test/assets/tp_plus.y +622 -0
  33. data/test/assets/twowaysql.y +278 -0
  34. data/test/helper.rb +31 -15
  35. data/test/regress/bibtex +474 -0
  36. data/test/regress/cadenza +796 -0
  37. data/test/regress/cast +3425 -0
  38. data/test/regress/csspool +2318 -0
  39. data/test/regress/edtf +1794 -0
  40. data/test/regress/huia +1392 -0
  41. data/test/regress/journey +222 -0
  42. data/test/regress/liquor +885 -0
  43. data/test/regress/machete +833 -0
  44. data/test/regress/mediacloth +1463 -0
  45. data/test/regress/mof +1368 -0
  46. data/test/regress/namae +634 -0
  47. data/test/regress/nasl +2058 -0
  48. data/test/regress/nokogiri-css +836 -0
  49. data/test/regress/opal +6429 -0
  50. data/test/regress/php_serialization +336 -0
  51. data/test/regress/rdblockparser +1061 -0
  52. data/test/regress/rdinlineparser +1243 -0
  53. data/test/regress/riml +3297 -0
  54. data/test/regress/ruby18 +6351 -0
  55. data/test/regress/ruby22 +7456 -0
  56. data/test/regress/tp_plus +1933 -0
  57. data/test/regress/twowaysql +556 -0
  58. data/test/test_racc_command.rb +177 -0
  59. metadata +75 -20
@@ -0,0 +1,222 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by Racc 1.4.14
4
+ # from Racc grammer file "".
5
+ #
6
+
7
+ require 'racc/parser.rb'
8
+
9
+
10
+ require 'journey/parser_extras'
11
+ module Journey
12
+ class Parser < Racc::Parser
13
+ ##### State transition tables begin ###
14
+
15
+ racc_action_table = [
16
+ 17, 21, 13, 15, 14, 7, nil, 16, 8, 19,
17
+ 13, 15, 14, 7, 23, 16, 8, 19, 13, 15,
18
+ 14, 7, nil, 16, 8, 13, 15, 14, 7, nil,
19
+ 16, 8, 13, 15, 14, 7, nil, 16, 8 ]
20
+
21
+ racc_action_check = [
22
+ 1, 17, 1, 1, 1, 1, nil, 1, 1, 1,
23
+ 20, 20, 20, 20, 20, 20, 20, 20, 0, 0,
24
+ 0, 0, nil, 0, 0, 7, 7, 7, 7, nil,
25
+ 7, 7, 19, 19, 19, 19, nil, 19, 19 ]
26
+
27
+ racc_action_pointer = [
28
+ 16, 0, nil, nil, nil, nil, nil, 23, nil, nil,
29
+ nil, nil, nil, nil, nil, nil, nil, 1, nil, 30,
30
+ 8, nil, nil, nil ]
31
+
32
+ racc_action_default = [
33
+ -18, -18, -2, -3, -4, -5, -6, -18, -9, -10,
34
+ -11, -12, -13, -14, -15, -16, -17, -18, -1, -18,
35
+ -18, 24, -8, -7 ]
36
+
37
+ racc_goto_table = [
38
+ 18, 1, nil, nil, nil, nil, nil, nil, 20, nil,
39
+ nil, nil, nil, nil, nil, nil, nil, nil, 22, 18 ]
40
+
41
+ racc_goto_check = [
42
+ 2, 1, nil, nil, nil, nil, nil, nil, 1, nil,
43
+ nil, nil, nil, nil, nil, nil, nil, nil, 2, 2 ]
44
+
45
+ racc_goto_pointer = [
46
+ nil, 1, -1, nil, nil, nil, nil, nil, nil, nil,
47
+ nil ]
48
+
49
+ racc_goto_default = [
50
+ nil, nil, 2, 3, 4, 5, 6, 9, 10, 11,
51
+ 12 ]
52
+
53
+ racc_reduce_table = [
54
+ 0, 0, :racc_error,
55
+ 2, 11, :_reduce_1,
56
+ 1, 11, :_reduce_2,
57
+ 1, 11, :_reduce_none,
58
+ 1, 12, :_reduce_none,
59
+ 1, 12, :_reduce_none,
60
+ 1, 12, :_reduce_none,
61
+ 3, 15, :_reduce_7,
62
+ 3, 13, :_reduce_8,
63
+ 1, 16, :_reduce_9,
64
+ 1, 14, :_reduce_none,
65
+ 1, 14, :_reduce_none,
66
+ 1, 14, :_reduce_none,
67
+ 1, 14, :_reduce_none,
68
+ 1, 19, :_reduce_14,
69
+ 1, 17, :_reduce_15,
70
+ 1, 18, :_reduce_16,
71
+ 1, 20, :_reduce_17 ]
72
+
73
+ racc_reduce_n = 18
74
+
75
+ racc_shift_n = 24
76
+
77
+ racc_token_table = {
78
+ false => 0,
79
+ :error => 1,
80
+ :SLASH => 2,
81
+ :LITERAL => 3,
82
+ :SYMBOL => 4,
83
+ :LPAREN => 5,
84
+ :RPAREN => 6,
85
+ :DOT => 7,
86
+ :STAR => 8,
87
+ :OR => 9 }
88
+
89
+ racc_nt_base = 10
90
+
91
+ racc_use_result_var = true
92
+
93
+ Racc_arg = [
94
+ racc_action_table,
95
+ racc_action_check,
96
+ racc_action_default,
97
+ racc_action_pointer,
98
+ racc_goto_table,
99
+ racc_goto_check,
100
+ racc_goto_default,
101
+ racc_goto_pointer,
102
+ racc_nt_base,
103
+ racc_reduce_table,
104
+ racc_token_table,
105
+ racc_shift_n,
106
+ racc_reduce_n,
107
+ racc_use_result_var ]
108
+
109
+ Racc_token_to_s_table = [
110
+ "$end",
111
+ "error",
112
+ "SLASH",
113
+ "LITERAL",
114
+ "SYMBOL",
115
+ "LPAREN",
116
+ "RPAREN",
117
+ "DOT",
118
+ "STAR",
119
+ "OR",
120
+ "$start",
121
+ "expressions",
122
+ "expression",
123
+ "or",
124
+ "terminal",
125
+ "group",
126
+ "star",
127
+ "symbol",
128
+ "literal",
129
+ "slash",
130
+ "dot" ]
131
+
132
+ Racc_debug_parser = false
133
+
134
+ ##### State transition tables end #####
135
+
136
+ # reduce 0 omitted
137
+
138
+ module_eval(<<'.,.,', 'journey.y', 6)
139
+ def _reduce_1(val, _values, result)
140
+ result = Cat.new(val.first, val.last)
141
+ result
142
+ end
143
+ .,.,
144
+
145
+ module_eval(<<'.,.,', 'journey.y', 7)
146
+ def _reduce_2(val, _values, result)
147
+ result = val.first
148
+ result
149
+ end
150
+ .,.,
151
+
152
+ # reduce 3 omitted
153
+
154
+ # reduce 4 omitted
155
+
156
+ # reduce 5 omitted
157
+
158
+ # reduce 6 omitted
159
+
160
+ module_eval(<<'.,.,', 'journey.y', 16)
161
+ def _reduce_7(val, _values, result)
162
+ result = Group.new(val[1])
163
+ result
164
+ end
165
+ .,.,
166
+
167
+ module_eval(<<'.,.,', 'journey.y', 19)
168
+ def _reduce_8(val, _values, result)
169
+ result = Or.new([val.first, val.last])
170
+ result
171
+ end
172
+ .,.,
173
+
174
+ module_eval(<<'.,.,', 'journey.y', 22)
175
+ def _reduce_9(val, _values, result)
176
+ result = Star.new(Symbol.new(val.last))
177
+ result
178
+ end
179
+ .,.,
180
+
181
+ # reduce 10 omitted
182
+
183
+ # reduce 11 omitted
184
+
185
+ # reduce 12 omitted
186
+
187
+ # reduce 13 omitted
188
+
189
+ module_eval(<<'.,.,', 'journey.y', 31)
190
+ def _reduce_14(val, _values, result)
191
+ result = Slash.new('/')
192
+ result
193
+ end
194
+ .,.,
195
+
196
+ module_eval(<<'.,.,', 'journey.y', 34)
197
+ def _reduce_15(val, _values, result)
198
+ result = Symbol.new(val.first)
199
+ result
200
+ end
201
+ .,.,
202
+
203
+ module_eval(<<'.,.,', 'journey.y', 37)
204
+ def _reduce_16(val, _values, result)
205
+ result = Literal.new(val.first)
206
+ result
207
+ end
208
+ .,.,
209
+
210
+ module_eval(<<'.,.,', 'journey.y', 39)
211
+ def _reduce_17(val, _values, result)
212
+ result = Dot.new(val.first)
213
+ result
214
+ end
215
+ .,.,
216
+
217
+ def _reduce_none(val, _values, result)
218
+ val[0]
219
+ end
220
+
221
+ end # class Parser
222
+ end # module Journey
@@ -0,0 +1,885 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by Racc 1.4.14
4
+ # from Racc grammer file "".
5
+ #
6
+
7
+ require 'racc/parser.rb'
8
+ module Liquor
9
+ class Parser < Racc::Parser
10
+
11
+ module_eval(<<'...end liquor.y/module_eval...', 'liquor.y', 216)
12
+ attr_reader :errors, :ast
13
+
14
+ def initialize(tags={})
15
+ super()
16
+
17
+ @errors = []
18
+ @ast = nil
19
+ @tags = tags
20
+ end
21
+
22
+ def success?
23
+ @errors.empty?
24
+ end
25
+
26
+ def parse(string, name='(code)')
27
+ @errors.clear
28
+ @name = name
29
+ @ast = nil
30
+
31
+ begin
32
+ @stream = Lexer.lex(string, @name, @tags)
33
+ @ast = do_parse
34
+ rescue Liquor::SyntaxError => e
35
+ @errors << e
36
+ end
37
+
38
+ success?
39
+ end
40
+
41
+ def next_token
42
+ tok = @stream.shift
43
+ [ tok[0], tok ] if tok
44
+ end
45
+
46
+ TOKEN_NAME_MAP = {
47
+ :comma => ',',
48
+ :dot => '.',
49
+ :lblock => '{%',
50
+ :rblock => '%}',
51
+ :linterp => '{{',
52
+ :rinterp => '}}',
53
+ :lbracket => '[',
54
+ :rbracket => ']',
55
+ :lparen => '(',
56
+ :rparen => ')',
57
+ :pipe => '|',
58
+ :op_not => '!',
59
+ :op_mul => '*',
60
+ :op_div => '/',
61
+ :op_mod => '%',
62
+ :op_plus => '+',
63
+ :op_minus => '-',
64
+ :op_eq => '==',
65
+ :op_neq => '!=',
66
+ :op_lt => '<',
67
+ :op_leq => '<=',
68
+ :op_gt => '>',
69
+ :op_geq => '>=',
70
+ :keyword => 'keyword argument name',
71
+ :kwarg => 'keyword argument',
72
+ :ident => 'identifier',
73
+ }
74
+
75
+ def on_error(error_token_id, error_token, value_stack)
76
+ if token_to_str(error_token_id) == "$end"
77
+ raise Liquor::SyntaxError.new("unexpected end of program", {
78
+ file: @name
79
+ })
80
+ else
81
+ type, (loc, value) = error_token
82
+ type = TOKEN_NAME_MAP[type] || type
83
+
84
+ raise Liquor::SyntaxError.new("unexpected token `#{type}'", loc)
85
+ end
86
+ end
87
+
88
+ def retag(nodes)
89
+ loc = nodes.map { |node| node[1] }.compact
90
+ first, *, last = loc
91
+ return first if last.nil?
92
+
93
+ {
94
+ file: first[:file],
95
+ line: first[:line],
96
+ start: first[:start],
97
+ end: last[:end],
98
+ }
99
+ end
100
+
101
+ def reduce_tag_args(list)
102
+ list.each_slice(2).reduce([]) { |args, (k, v)|
103
+ if v[0] == :block
104
+ args << [ :blockarg, retag([ k, v ]), k, v[2] || [] ]
105
+ else
106
+ args << [ :kwarg, retag([ k, v ]), k, v ]
107
+ end
108
+ }
109
+ end
110
+ ...end liquor.y/module_eval...
111
+ ##### State transition tables begin ###
112
+
113
+ racc_action_table = [
114
+ 76, 26, 26, 6, 77, 70, 5, 6, 25, 25,
115
+ 5, 28, 32, 36, 37, 34, 35, 31, 29, 27,
116
+ 33, 2, 30, 26, 26, 2, 6, 43, 52, 5,
117
+ 25, 25, 38, 39, 28, 32, 36, 37, 34, 35,
118
+ 31, 29, 27, 33, 2, 30, 26, 94, 51, 98,
119
+ 26, 96, 26, 25, 97, 38, 39, 25, 111, 25,
120
+ 28, 32, 36, 37, 34, 35, 31, 29, 27, 33,
121
+ 41, 30, 26, 26, 43, 6, 107, 74, 5, 25,
122
+ 25, 38, 39, 28, 32, 36, 37, 34, 35, 31,
123
+ 29, 27, 33, 2, 30, 7, 26, 70, 6, 96,
124
+ 102, 5, 97, 25, 38, 39, 28, 32, 36, 37,
125
+ 34, 35, 31, 29, 27, 33, 2, 30, 54, 26,
126
+ 74, 6, 96, 74, 5, 97, 25, 38, 39, 28,
127
+ 32, 36, 37, 34, 35, 31, 29, 27, 33, 2,
128
+ 30, 87, 26, 96, 6, 22, 97, 5, 84, 25,
129
+ 38, 39, 28, 32, 36, 37, 34, 35, 31, 29,
130
+ 27, 33, 2, 30, 40, 26, 23, nil, 24, nil,
131
+ nil, nil, 25, 38, 39, 28, 32, 36, 37, 34,
132
+ 35, 31, 29, 27, 33, nil, 30, nil, 26, nil,
133
+ 82, nil, 52, nil, nil, 25, 38, 39, 28, 32,
134
+ 36, 37, 34, 35, 31, 29, 27, 33, nil, 30,
135
+ nil, 26, 51, nil, nil, nil, nil, nil, 25, 38,
136
+ 39, 28, 32, 36, 37, 34, 35, 31, 29, 27,
137
+ 33, nil, 30, nil, 26, nil, nil, nil, 75, nil,
138
+ nil, 25, 38, 39, 28, 32, 36, 37, 34, 35,
139
+ 31, 29, 27, 33, nil, 30, 13, 15, nil, 13,
140
+ 15, 21, nil, 14, 21, 38, 14, nil, nil, nil,
141
+ 18, nil, nil, 18, 19, nil, nil, 19, nil, 13,
142
+ 15, nil, 16, nil, 21, 16, 14, nil, nil, 13,
143
+ 15, nil, nil, 18, 21, nil, 14, 19, nil, 13,
144
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
145
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
146
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
147
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
148
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
149
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
150
+ 15, 74, nil, 18, 21, 16, 14, 19, nil, 13,
151
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
152
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
153
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
154
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
155
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
156
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
157
+ 15, 52, nil, 18, 21, 16, 14, 19, nil, 13,
158
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
159
+ 15, 51, nil, 18, 21, 16, 14, 19, nil, 13,
160
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
161
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
162
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
163
+ 15, nil, nil, 18, 21, 16, 14, 19, nil, 13,
164
+ 15, 81, nil, 18, 21, 16, 14, 19, nil, 13,
165
+ 15, nil, 26, 18, 21, 16, 14, 19, nil, 25,
166
+ nil, 101, 28, 18, nil, 16, 26, 19, nil, 29,
167
+ 27, 106, nil, 25, nil, 16, 28, 32, 36, 37,
168
+ 34, 35, 31, 29, 27, 33, 26, 30, nil, nil,
169
+ nil, nil, nil, 25, nil, nil, 28, nil, 26, nil,
170
+ nil, nil, 31, 29, 27, 25, nil, 30, 28, nil,
171
+ 26, nil, nil, nil, 31, 29, 27, 25, nil, 30,
172
+ 28, nil, 26, nil, nil, nil, 31, 29, 27, 25,
173
+ nil, 30, 28, nil, 26, nil, nil, nil, 31, 29,
174
+ 27, 25, nil, 30, 28, nil, 26, nil, nil, nil,
175
+ 31, 29, 27, 25, nil, 30, 28, nil, 26, nil,
176
+ nil, nil, 31, 29, 27, 25, nil, 30, 28, nil,
177
+ nil, nil, nil, nil, nil, 29, 27 ]
178
+
179
+ racc_action_check = [
180
+ 47, 47, 55, 101, 48, 84, 101, 4, 47, 55,
181
+ 4, 47, 47, 47, 47, 47, 47, 47, 47, 47,
182
+ 47, 101, 47, 56, 79, 4, 0, 54, 79, 0,
183
+ 56, 79, 47, 47, 79, 79, 79, 79, 79, 79,
184
+ 79, 79, 79, 79, 0, 79, 57, 91, 79, 96,
185
+ 104, 104, 45, 57, 104, 79, 79, 104, 109, 45,
186
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
187
+ 12, 104, 46, 71, 13, 2, 103, 71, 2, 46,
188
+ 71, 104, 104, 71, 71, 71, 71, 71, 71, 71,
189
+ 71, 71, 71, 2, 71, 1, 99, 40, 3, 107,
190
+ 99, 3, 107, 99, 71, 71, 99, 99, 99, 99,
191
+ 99, 99, 99, 99, 99, 99, 3, 99, 26, 88,
192
+ 70, 81, 94, 88, 81, 94, 88, 99, 99, 88,
193
+ 88, 88, 88, 88, 88, 88, 88, 88, 88, 81,
194
+ 88, 72, 11, 111, 106, 6, 111, 106, 69, 11,
195
+ 88, 88, 11, 11, 11, 11, 11, 11, 11, 11,
196
+ 11, 11, 106, 11, 11, 53, 7, nil, 11, nil,
197
+ nil, nil, 53, 11, 11, 53, 53, 53, 53, 53,
198
+ 53, 53, 53, 53, 53, nil, 53, nil, 49, nil,
199
+ 53, nil, 49, nil, nil, 49, 53, 53, 49, 49,
200
+ 49, 49, 49, 49, 49, 49, 49, 49, nil, 49,
201
+ nil, 44, 49, nil, nil, nil, nil, nil, 44, 49,
202
+ 49, 44, 44, 44, 44, 44, 44, 44, 44, 44,
203
+ 44, nil, 44, nil, 67, nil, nil, nil, 44, nil,
204
+ nil, 67, 44, 44, 67, 67, 67, 67, 67, 67,
205
+ 67, 67, 67, 67, nil, 67, 30, 30, nil, 31,
206
+ 31, 30, nil, 30, 31, 67, 31, nil, nil, nil,
207
+ 30, nil, nil, 31, 30, nil, nil, 31, nil, 32,
208
+ 32, nil, 30, nil, 32, 31, 32, nil, nil, 33,
209
+ 33, nil, nil, 32, 33, nil, 33, 32, nil, 34,
210
+ 34, nil, nil, 33, 34, 32, 34, 33, nil, 35,
211
+ 35, nil, nil, 34, 35, 33, 35, 34, nil, 36,
212
+ 36, nil, nil, 35, 36, 34, 36, 35, nil, 37,
213
+ 37, nil, nil, 36, 37, 35, 37, 36, nil, 38,
214
+ 38, nil, nil, 37, 38, 36, 38, 37, nil, 39,
215
+ 39, nil, nil, 38, 39, 37, 39, 38, nil, 43,
216
+ 43, 43, nil, 39, 43, 38, 43, 39, nil, 74,
217
+ 74, nil, nil, 43, 74, 39, 74, 43, nil, 5,
218
+ 5, nil, nil, 74, 5, 43, 5, 74, nil, 14,
219
+ 14, nil, nil, 5, 14, 74, 14, 5, nil, 18,
220
+ 18, nil, nil, 14, 18, 5, 18, 14, nil, 19,
221
+ 19, nil, nil, 18, 19, 14, 19, 18, nil, 21,
222
+ 21, nil, nil, 19, 21, 18, 21, 19, nil, 22,
223
+ 22, 22, nil, 21, 22, 19, 22, 21, nil, 25,
224
+ 25, nil, nil, 22, 25, 21, 25, 22, nil, 27,
225
+ 27, 22, nil, 25, 27, 22, 27, 25, nil, 28,
226
+ 28, nil, nil, 27, 28, 25, 28, 27, nil, 29,
227
+ 29, nil, nil, 28, 29, 27, 29, 28, nil, 52,
228
+ 52, nil, nil, 29, 52, 28, 52, 29, nil, 76,
229
+ 76, nil, nil, 52, 76, 29, 76, 52, nil, 97,
230
+ 97, 52, nil, 76, 97, 52, 97, 76, nil, 102,
231
+ 102, nil, 58, 97, 102, 76, 102, 97, nil, 58,
232
+ nil, 97, 58, 102, nil, 97, 66, 102, nil, 58,
233
+ 58, 102, nil, 66, nil, 102, 66, 66, 66, 66,
234
+ 66, 66, 66, 66, 66, 66, 60, 66, nil, nil,
235
+ nil, nil, nil, 60, nil, nil, 60, nil, 61, nil,
236
+ nil, nil, 60, 60, 60, 61, nil, 60, 61, nil,
237
+ 62, nil, nil, nil, 61, 61, 61, 62, nil, 61,
238
+ 62, nil, 63, nil, nil, nil, 62, 62, 62, 63,
239
+ nil, 62, 63, nil, 64, nil, nil, nil, 63, 63,
240
+ 63, 64, nil, 63, 64, nil, 65, nil, nil, nil,
241
+ 64, 64, 64, 65, nil, 64, 65, nil, 59, nil,
242
+ nil, nil, 65, 65, 65, 59, nil, 65, 59, nil,
243
+ nil, nil, nil, nil, nil, 59, 59 ]
244
+
245
+ racc_action_pointer = [
246
+ 18, 95, 67, 90, -1, 374, 140, 166, nil, nil,
247
+ nil, 139, 41, 62, 384, nil, nil, nil, 394, 404,
248
+ nil, 414, 424, nil, nil, 434, 113, 444, 454, 464,
249
+ 251, 254, 274, 284, 294, 304, 314, 324, 334, 344,
250
+ 92, nil, nil, 354, 208, 49, 69, -2, -24, 185,
251
+ nil, nil, 474, 162, 15, -1, 20, 43, 509, 615,
252
+ 543, 555, 567, 579, 591, 603, 523, 231, nil, 123,
253
+ 113, 70, 111, nil, 364, nil, 484, nil, nil, 21,
254
+ nil, 113, nil, nil, 0, nil, nil, nil, 116, nil,
255
+ nil, 38, nil, nil, 118, nil, 22, 494, nil, 93,
256
+ nil, -5, 504, 67, 47, nil, 136, 95, nil, 49,
257
+ nil, 139, nil ]
258
+
259
+ racc_action_default = [
260
+ -1, -57, -1, -1, -1, -57, -57, -57, -2, -3,
261
+ -4, -57, -57, -7, -57, -9, -10, -11, -57, -57,
262
+ -31, -35, -57, 113, -5, -57, -57, -57, -57, -57,
263
+ -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
264
+ -57, -6, -12, -40, -57, -16, -17, -34, -57, -57,
265
+ -46, -47, -57, -57, -15, -18, -19, -20, -21, -22,
266
+ -23, -24, -25, -26, -27, -28, -29, -30, -41, -43,
267
+ -40, -40, -57, -38, -57, -8, -35, -32, -45, -57,
268
+ -48, -1, -13, -14, -57, -44, -37, -36, -40, -33,
269
+ -50, -57, -42, -39, -57, -49, -57, -57, -51, -57,
270
+ -52, -1, -57, -57, -57, -54, -1, -57, -56, -57,
271
+ -53, -57, -55 ]
272
+
273
+ racc_goto_table = [
274
+ 1, 11, 8, 9, 10, 48, 68, 100, 42, 50,
275
+ 44, 72, 105, 73, 45, 46, 12, 80, 49, nil,
276
+ nil, 53, nil, 55, 56, 57, 58, 59, 60, 61,
277
+ 62, 63, 64, 65, 66, 67, 78, nil, nil, 71,
278
+ 85, 86, 95, nil, nil, nil, nil, nil, 79, 83,
279
+ 92, nil, 108, nil, nil, 110, nil, nil, 93, 112,
280
+ 89, nil, nil, nil, nil, nil, 90, nil, nil, nil,
281
+ 88, nil, nil, nil, nil, nil, nil, nil, nil, nil,
282
+ nil, 91, nil, nil, nil, nil, nil, nil, nil, nil,
283
+ nil, nil, nil, 99, nil, nil, nil, nil, 104, nil,
284
+ nil, 103, nil, nil, nil, nil, 109 ]
285
+
286
+ racc_goto_check = [
287
+ 1, 4, 1, 1, 1, 9, 12, 17, 8, 14,
288
+ 4, 10, 18, 11, 4, 4, 5, 15, 4, nil,
289
+ nil, 4, nil, 4, 4, 4, 4, 4, 4, 4,
290
+ 4, 4, 4, 4, 4, 4, 14, nil, nil, 4,
291
+ 11, 11, 16, nil, nil, nil, nil, nil, 4, 8,
292
+ 12, nil, 16, nil, nil, 16, nil, nil, 11, 16,
293
+ 9, nil, nil, nil, nil, nil, 14, nil, nil, nil,
294
+ 4, nil, nil, nil, nil, nil, nil, nil, nil, nil,
295
+ nil, 1, nil, nil, nil, nil, nil, nil, nil, nil,
296
+ nil, nil, nil, 4, nil, nil, nil, nil, 4, nil,
297
+ nil, 1, nil, nil, nil, nil, 1 ]
298
+
299
+ racc_goto_pointer = [
300
+ nil, 0, nil, nil, -4, 11, nil, nil, -5, -16,
301
+ -32, -30, -34, nil, -13, -35, -52, -90, -90 ]
302
+
303
+ racc_goto_default = [
304
+ nil, nil, 3, 4, 47, nil, 20, 17, nil, nil,
305
+ nil, nil, nil, 69, nil, nil, nil, nil, nil ]
306
+
307
+ racc_reduce_table = [
308
+ 0, 0, :racc_error,
309
+ 0, 37, :_reduce_1,
310
+ 2, 37, :_reduce_2,
311
+ 2, 37, :_reduce_3,
312
+ 2, 37, :_reduce_4,
313
+ 3, 38, :_reduce_5,
314
+ 3, 38, :_reduce_6,
315
+ 1, 42, :_reduce_none,
316
+ 3, 42, :_reduce_8,
317
+ 1, 40, :_reduce_none,
318
+ 1, 40, :_reduce_none,
319
+ 1, 40, :_reduce_none,
320
+ 2, 40, :_reduce_12,
321
+ 4, 40, :_reduce_13,
322
+ 4, 40, :_reduce_14,
323
+ 3, 40, :_reduce_15,
324
+ 2, 40, :_reduce_16,
325
+ 2, 40, :_reduce_17,
326
+ 3, 40, :_reduce_18,
327
+ 3, 40, :_reduce_19,
328
+ 3, 40, :_reduce_20,
329
+ 3, 40, :_reduce_21,
330
+ 3, 40, :_reduce_22,
331
+ 3, 40, :_reduce_23,
332
+ 3, 40, :_reduce_24,
333
+ 3, 40, :_reduce_25,
334
+ 3, 40, :_reduce_26,
335
+ 3, 40, :_reduce_27,
336
+ 3, 40, :_reduce_28,
337
+ 3, 40, :_reduce_29,
338
+ 3, 40, :_reduce_30,
339
+ 1, 40, :_reduce_none,
340
+ 3, 43, :_reduce_32,
341
+ 3, 45, :_reduce_33,
342
+ 1, 45, :_reduce_34,
343
+ 0, 45, :_reduce_35,
344
+ 3, 44, :_reduce_36,
345
+ 2, 46, :_reduce_37,
346
+ 1, 46, :_reduce_38,
347
+ 3, 47, :_reduce_39,
348
+ 0, 47, :_reduce_40,
349
+ 3, 41, :_reduce_41,
350
+ 3, 48, :_reduce_42,
351
+ 1, 48, :_reduce_43,
352
+ 2, 49, :_reduce_44,
353
+ 4, 39, :_reduce_45,
354
+ 3, 39, :_reduce_46,
355
+ 1, 50, :_reduce_47,
356
+ 2, 50, :_reduce_48,
357
+ 4, 51, :_reduce_49,
358
+ 2, 51, :_reduce_50,
359
+ 2, 52, :_reduce_51,
360
+ 2, 52, :_reduce_52,
361
+ 4, 53, :_reduce_53,
362
+ 3, 53, :_reduce_54,
363
+ 4, 54, :_reduce_55,
364
+ 2, 54, :_reduce_56 ]
365
+
366
+ racc_reduce_n = 57
367
+
368
+ racc_shift_n = 113
369
+
370
+ racc_token_table = {
371
+ false => 0,
372
+ :error => 1,
373
+ :comma => 2,
374
+ :dot => 3,
375
+ :endtag => 4,
376
+ :ident => 5,
377
+ :integer => 6,
378
+ :keyword => 7,
379
+ :lblock => 8,
380
+ :lblock2 => 9,
381
+ :lbracket => 10,
382
+ :linterp => 11,
383
+ :lparen => 12,
384
+ :op_div => 13,
385
+ :op_eq => 14,
386
+ :op_gt => 15,
387
+ :op_geq => 16,
388
+ :op_lt => 17,
389
+ :op_leq => 18,
390
+ :op_minus => 19,
391
+ :op_mod => 20,
392
+ :op_mul => 21,
393
+ :op_neq => 22,
394
+ :op_not => 23,
395
+ :op_plus => 24,
396
+ :pipe => 25,
397
+ :plaintext => 26,
398
+ :rblock => 27,
399
+ :rbracket => 28,
400
+ :rinterp => 29,
401
+ :rparen => 30,
402
+ :string => 31,
403
+ :tag_ident => 32,
404
+ :op_uminus => 33,
405
+ :op_and => 34,
406
+ :op_or => 35 }
407
+
408
+ racc_nt_base = 36
409
+
410
+ racc_use_result_var = true
411
+
412
+ Racc_arg = [
413
+ racc_action_table,
414
+ racc_action_check,
415
+ racc_action_default,
416
+ racc_action_pointer,
417
+ racc_goto_table,
418
+ racc_goto_check,
419
+ racc_goto_default,
420
+ racc_goto_pointer,
421
+ racc_nt_base,
422
+ racc_reduce_table,
423
+ racc_token_table,
424
+ racc_shift_n,
425
+ racc_reduce_n,
426
+ racc_use_result_var ]
427
+
428
+ Racc_token_to_s_table = [
429
+ "$end",
430
+ "error",
431
+ "comma",
432
+ "dot",
433
+ "endtag",
434
+ "ident",
435
+ "integer",
436
+ "keyword",
437
+ "lblock",
438
+ "lblock2",
439
+ "lbracket",
440
+ "linterp",
441
+ "lparen",
442
+ "op_div",
443
+ "op_eq",
444
+ "op_gt",
445
+ "op_geq",
446
+ "op_lt",
447
+ "op_leq",
448
+ "op_minus",
449
+ "op_mod",
450
+ "op_mul",
451
+ "op_neq",
452
+ "op_not",
453
+ "op_plus",
454
+ "pipe",
455
+ "plaintext",
456
+ "rblock",
457
+ "rbracket",
458
+ "rinterp",
459
+ "rparen",
460
+ "string",
461
+ "tag_ident",
462
+ "op_uminus",
463
+ "op_and",
464
+ "op_or",
465
+ "$start",
466
+ "block",
467
+ "interp",
468
+ "tag",
469
+ "expr",
470
+ "filter_chain",
471
+ "primary_expr",
472
+ "tuple",
473
+ "function_args",
474
+ "tuple_content",
475
+ "function_args_inside",
476
+ "function_keywords",
477
+ "filter_chain_cont",
478
+ "filter_call",
479
+ "tag_first_cont",
480
+ "tag_first_cont2",
481
+ "tag_next_cont",
482
+ "tag_next_cont2",
483
+ "tag_next_cont3" ]
484
+
485
+ Racc_debug_parser = false
486
+
487
+ ##### State transition tables end #####
488
+
489
+ # reduce 0 omitted
490
+
491
+ module_eval(<<'.,.,', 'liquor.y', 47)
492
+ def _reduce_1(val, _values, result)
493
+ result = []
494
+ result
495
+ end
496
+ .,.,
497
+
498
+ module_eval(<<'.,.,', 'liquor.y', 49)
499
+ def _reduce_2(val, _values, result)
500
+ result = [ val[0], *val[1] ]
501
+ result
502
+ end
503
+ .,.,
504
+
505
+ module_eval(<<'.,.,', 'liquor.y', 51)
506
+ def _reduce_3(val, _values, result)
507
+ result = [ val[0], *val[1] ]
508
+ result
509
+ end
510
+ .,.,
511
+
512
+ module_eval(<<'.,.,', 'liquor.y', 53)
513
+ def _reduce_4(val, _values, result)
514
+ result = [ val[0], *val[1] ]
515
+ result
516
+ end
517
+ .,.,
518
+
519
+ module_eval(<<'.,.,', 'liquor.y', 57)
520
+ def _reduce_5(val, _values, result)
521
+ result = [ :interp, retag(val), val[1] ]
522
+ result
523
+ end
524
+ .,.,
525
+
526
+ module_eval(<<'.,.,', 'liquor.y', 59)
527
+ def _reduce_6(val, _values, result)
528
+ result = [ :interp, retag(val), val[1] ]
529
+ result
530
+ end
531
+ .,.,
532
+
533
+ # reduce 7 omitted
534
+
535
+ module_eval(<<'.,.,', 'liquor.y', 64)
536
+ def _reduce_8(val, _values, result)
537
+ result = [ val[1][0], retag(val), *val[1][2..-1] ]
538
+ result
539
+ end
540
+ .,.,
541
+
542
+ # reduce 9 omitted
543
+
544
+ # reduce 10 omitted
545
+
546
+ # reduce 11 omitted
547
+
548
+ module_eval(<<'.,.,', 'liquor.y', 71)
549
+ def _reduce_12(val, _values, result)
550
+ result = [ :call, retag(val), val[0], val[1] ]
551
+ result
552
+ end
553
+ .,.,
554
+
555
+ module_eval(<<'.,.,', 'liquor.y', 73)
556
+ def _reduce_13(val, _values, result)
557
+ result = [ :index, retag(val), val[0], val[2] ]
558
+ result
559
+ end
560
+ .,.,
561
+
562
+ module_eval(<<'.,.,', 'liquor.y', 75)
563
+ def _reduce_14(val, _values, result)
564
+ result = [ :external, retag(val), val[0], val[2], val[3] ]
565
+ result
566
+ end
567
+ .,.,
568
+
569
+ module_eval(<<'.,.,', 'liquor.y', 77)
570
+ def _reduce_15(val, _values, result)
571
+ result = [ :external, retag(val), val[0], val[2], nil ]
572
+ result
573
+ end
574
+ .,.,
575
+
576
+ module_eval(<<'.,.,', 'liquor.y', 79)
577
+ def _reduce_16(val, _values, result)
578
+ result = [ :uminus, retag(val), val[1] ]
579
+ result
580
+ end
581
+ .,.,
582
+
583
+ module_eval(<<'.,.,', 'liquor.y', 81)
584
+ def _reduce_17(val, _values, result)
585
+ result = [ :not, retag(val), val[1] ]
586
+ result
587
+ end
588
+ .,.,
589
+
590
+ module_eval(<<'.,.,', 'liquor.y', 83)
591
+ def _reduce_18(val, _values, result)
592
+ result = [ :mul, retag(val), val[0], val[2] ]
593
+ result
594
+ end
595
+ .,.,
596
+
597
+ module_eval(<<'.,.,', 'liquor.y', 85)
598
+ def _reduce_19(val, _values, result)
599
+ result = [ :div, retag(val), val[0], val[2] ]
600
+ result
601
+ end
602
+ .,.,
603
+
604
+ module_eval(<<'.,.,', 'liquor.y', 87)
605
+ def _reduce_20(val, _values, result)
606
+ result = [ :mod, retag(val), val[0], val[2] ]
607
+ result
608
+ end
609
+ .,.,
610
+
611
+ module_eval(<<'.,.,', 'liquor.y', 89)
612
+ def _reduce_21(val, _values, result)
613
+ result = [ :plus, retag(val), val[0], val[2] ]
614
+ result
615
+ end
616
+ .,.,
617
+
618
+ module_eval(<<'.,.,', 'liquor.y', 91)
619
+ def _reduce_22(val, _values, result)
620
+ result = [ :minus, retag(val), val[0], val[2] ]
621
+ result
622
+ end
623
+ .,.,
624
+
625
+ module_eval(<<'.,.,', 'liquor.y', 93)
626
+ def _reduce_23(val, _values, result)
627
+ result = [ :eq, retag(val), val[0], val[2] ]
628
+ result
629
+ end
630
+ .,.,
631
+
632
+ module_eval(<<'.,.,', 'liquor.y', 95)
633
+ def _reduce_24(val, _values, result)
634
+ result = [ :neq, retag(val), val[0], val[2] ]
635
+ result
636
+ end
637
+ .,.,
638
+
639
+ module_eval(<<'.,.,', 'liquor.y', 97)
640
+ def _reduce_25(val, _values, result)
641
+ result = [ :lt, retag(val), val[0], val[2] ]
642
+ result
643
+ end
644
+ .,.,
645
+
646
+ module_eval(<<'.,.,', 'liquor.y', 99)
647
+ def _reduce_26(val, _values, result)
648
+ result = [ :leq, retag(val), val[0], val[2] ]
649
+ result
650
+ end
651
+ .,.,
652
+
653
+ module_eval(<<'.,.,', 'liquor.y', 101)
654
+ def _reduce_27(val, _values, result)
655
+ result = [ :gt, retag(val), val[0], val[2] ]
656
+ result
657
+ end
658
+ .,.,
659
+
660
+ module_eval(<<'.,.,', 'liquor.y', 103)
661
+ def _reduce_28(val, _values, result)
662
+ result = [ :geq, retag(val), val[0], val[2] ]
663
+ result
664
+ end
665
+ .,.,
666
+
667
+ module_eval(<<'.,.,', 'liquor.y', 105)
668
+ def _reduce_29(val, _values, result)
669
+ result = [ :and, retag(val), val[0], val[2] ]
670
+ result
671
+ end
672
+ .,.,
673
+
674
+ module_eval(<<'.,.,', 'liquor.y', 107)
675
+ def _reduce_30(val, _values, result)
676
+ result = [ :or, retag(val), val[0], val[2] ]
677
+ result
678
+ end
679
+ .,.,
680
+
681
+ # reduce 31 omitted
682
+
683
+ module_eval(<<'.,.,', 'liquor.y', 112)
684
+ def _reduce_32(val, _values, result)
685
+ result = [ :tuple, retag(val), val[1].compact ]
686
+ result
687
+ end
688
+ .,.,
689
+
690
+ module_eval(<<'.,.,', 'liquor.y', 116)
691
+ def _reduce_33(val, _values, result)
692
+ result = [ val[0], *val[2] ]
693
+ result
694
+ end
695
+ .,.,
696
+
697
+ module_eval(<<'.,.,', 'liquor.y', 118)
698
+ def _reduce_34(val, _values, result)
699
+ result = [ val[0] ]
700
+ result
701
+ end
702
+ .,.,
703
+
704
+ module_eval(<<'.,.,', 'liquor.y', 120)
705
+ def _reduce_35(val, _values, result)
706
+ result = [ ]
707
+ result
708
+ end
709
+ .,.,
710
+
711
+ module_eval(<<'.,.,', 'liquor.y', 124)
712
+ def _reduce_36(val, _values, result)
713
+ result = [ :args, retag(val), *val[1] ]
714
+ result
715
+ end
716
+ .,.,
717
+
718
+ module_eval(<<'.,.,', 'liquor.y', 128)
719
+ def _reduce_37(val, _values, result)
720
+ result = [ val[0], val[1][2] ]
721
+ result
722
+ end
723
+ .,.,
724
+
725
+ module_eval(<<'.,.,', 'liquor.y', 130)
726
+ def _reduce_38(val, _values, result)
727
+ result = [ nil, val[0][2] ]
728
+ result
729
+ end
730
+ .,.,
731
+
732
+ module_eval(<<'.,.,', 'liquor.y', 134)
733
+ def _reduce_39(val, _values, result)
734
+ name = val[0][2].to_sym
735
+ tail = val[2][2]
736
+ loc = retag([ val[0], val[1] ])
737
+
738
+ if tail.include? name
739
+ @errors << SyntaxError.new("duplicate keyword argument `#{val[0][2]}'",
740
+ tail[name][1])
741
+ end
742
+
743
+ hash = {
744
+ name => [ val[1][0], loc, *val[1][2..-1] ]
745
+ }.merge(tail)
746
+
747
+ result = [ :keywords, retag([ loc, val[2] ]), hash ]
748
+
749
+ result
750
+ end
751
+ .,.,
752
+
753
+ module_eval(<<'.,.,', 'liquor.y', 150)
754
+ def _reduce_40(val, _values, result)
755
+ result = [ :keywords, nil, {} ]
756
+ result
757
+ end
758
+ .,.,
759
+
760
+ module_eval(<<'.,.,', 'liquor.y', 154)
761
+ def _reduce_41(val, _values, result)
762
+ result = [ val[0], *val[2] ].
763
+ reduce { |tree, node| node[3][2] = tree; node }
764
+
765
+ result
766
+ end
767
+ .,.,
768
+
769
+ module_eval(<<'.,.,', 'liquor.y', 160)
770
+ def _reduce_42(val, _values, result)
771
+ result = [ val[0], *val[2] ]
772
+ result
773
+ end
774
+ .,.,
775
+
776
+ module_eval(<<'.,.,', 'liquor.y', 162)
777
+ def _reduce_43(val, _values, result)
778
+ result = [ val[0] ]
779
+ result
780
+ end
781
+ .,.,
782
+
783
+ module_eval(<<'.,.,', 'liquor.y', 166)
784
+ def _reduce_44(val, _values, result)
785
+ ident_loc = val[0][1]
786
+ empty_args_loc = { line: ident_loc[:line],
787
+ start: ident_loc[:end] + 1,
788
+ end: ident_loc[:end] + 1, }
789
+ result = [ :call, val[0][1], val[0],
790
+ [ :args, val[1][1] || empty_args_loc, nil, val[1][2] ] ]
791
+
792
+ result
793
+ end
794
+ .,.,
795
+
796
+ module_eval(<<'.,.,', 'liquor.y', 176)
797
+ def _reduce_45(val, _values, result)
798
+ result = [ :tag, retag(val), val[1], val[2], *reduce_tag_args(val[3][2]) ]
799
+ result
800
+ end
801
+ .,.,
802
+
803
+ module_eval(<<'.,.,', 'liquor.y', 178)
804
+ def _reduce_46(val, _values, result)
805
+ result = [ :tag, retag(val), val[1], nil, *reduce_tag_args(val[2][2]) ]
806
+ result
807
+ end
808
+ .,.,
809
+
810
+ module_eval(<<'.,.,', 'liquor.y', 186)
811
+ def _reduce_47(val, _values, result)
812
+ result = [ :cont, retag(val), [] ]
813
+ result
814
+ end
815
+ .,.,
816
+
817
+ module_eval(<<'.,.,', 'liquor.y', 188)
818
+ def _reduce_48(val, _values, result)
819
+ result = [ :cont, retag(val), [ val[0], *val[1][2] ] ]
820
+ result
821
+ end
822
+ .,.,
823
+
824
+ module_eval(<<'.,.,', 'liquor.y', 192)
825
+ def _reduce_49(val, _values, result)
826
+ result = [ :cont2, val[0][1], [ [:block, val[0][1], val[1] ], *val[3] ] ]
827
+ result
828
+ end
829
+ .,.,
830
+
831
+ module_eval(<<'.,.,', 'liquor.y', 194)
832
+ def _reduce_50(val, _values, result)
833
+ result = [ :cont2, retag(val), [ val[0], *val[1][2] ] ]
834
+ result
835
+ end
836
+ .,.,
837
+
838
+ module_eval(<<'.,.,', 'liquor.y', 198)
839
+ def _reduce_51(val, _values, result)
840
+ result = []
841
+ result
842
+ end
843
+ .,.,
844
+
845
+ module_eval(<<'.,.,', 'liquor.y', 200)
846
+ def _reduce_52(val, _values, result)
847
+ result = [ val[0], *val[1] ]
848
+ result
849
+ end
850
+ .,.,
851
+
852
+ module_eval(<<'.,.,', 'liquor.y', 204)
853
+ def _reduce_53(val, _values, result)
854
+ result = [ [:block, val[0][1], val[1] ], *val[3] ]
855
+ result
856
+ end
857
+ .,.,
858
+
859
+ module_eval(<<'.,.,', 'liquor.y', 206)
860
+ def _reduce_54(val, _values, result)
861
+ result = [ val[0], val[1], *val[2] ]
862
+ result
863
+ end
864
+ .,.,
865
+
866
+ module_eval(<<'.,.,', 'liquor.y', 210)
867
+ def _reduce_55(val, _values, result)
868
+ result = [ [:block, val[0][1], val[1] ], *val[3] ]
869
+ result
870
+ end
871
+ .,.,
872
+
873
+ module_eval(<<'.,.,', 'liquor.y', 212)
874
+ def _reduce_56(val, _values, result)
875
+ result = [ val[0], *val[1] ]
876
+ result
877
+ end
878
+ .,.,
879
+
880
+ def _reduce_none(val, _values, result)
881
+ val[0]
882
+ end
883
+
884
+ end # class Parser
885
+ end # module Liquor