haparanda 0.0.1

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.
@@ -0,0 +1,880 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # DO NOT MODIFY!!!!
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "handlebars_parser.y".
6
+ #
7
+
8
+ require 'racc/parser.rb'
9
+
10
+ require "sexp"
11
+
12
+ module Haparanda
13
+ class HandlebarsParser < Racc::Parser
14
+
15
+ module_eval(<<'...end handlebars_parser.y/module_eval...', 'handlebars_parser.y', 231)
16
+ attr_reader :lexer
17
+
18
+ def parse(str)
19
+ @lexer = HandlebarsLexer.new
20
+ lexer.scan_setup(str)
21
+ do_parse
22
+ end
23
+
24
+ def next_token
25
+ lexer.next_token
26
+ end
27
+
28
+ # Use pure ruby racc imlementation for debugging
29
+ def do_parse
30
+ _racc_do_parse_rb(_racc_setup(), false)
31
+ end
32
+
33
+ def process_number(str)
34
+ if str =~ /\./
35
+ str.to_f
36
+ else
37
+ str.to_i
38
+ end
39
+ end
40
+
41
+ def strip_flags(start, finish)
42
+ s(:strip, start[2] == "~", finish[-3] == "~")
43
+ end
44
+
45
+ def strip_comment(comment)
46
+ comment.sub(/^\{\{~?!-?-?/, "").sub(/-?-?~?\}\}$/, "")
47
+ end
48
+
49
+ def id(val)
50
+ if (match = /\A\[(.*)\]\Z/.match val)
51
+ # TODO: Mark as having had square brackets
52
+ s(:id, match[1])
53
+ else
54
+ s(:id, val)
55
+ end
56
+ end
57
+
58
+ def interpret_open_token(open)
59
+ marker = open[2..-1][-1]
60
+ decorator = marker == "*"
61
+ escaped = !["{", "&"].include?(marker)
62
+ return decorator, escaped
63
+ end
64
+
65
+ def prepare_path(data, sexpr, parts, loc)
66
+ tail = []
67
+ parts.each_slice(2) do |part, sep|
68
+ if ["..", ".", "this"].include? part[1]
69
+ unless tail.empty?
70
+ path = tail.map { _1[1] }.join + part[1]
71
+ # TODO: keep track of the position in the line as well
72
+ raise ParseError, "Invalid path: #{path} - #{loc}"
73
+ end
74
+ next
75
+ end
76
+
77
+ tail << part
78
+ tail << sep if sep
79
+ end
80
+ # TODO: Handle sexpr
81
+ s(:path, data, *parts).line loc
82
+ end
83
+
84
+ def prepare_mustache(open, path, params, hash, close)
85
+ decorator, escaped = interpret_open_token(open)
86
+ type = decorator ? :directive : :mustache
87
+ s(type, path, params, hash, escaped, strip_flags(open, close)).line(self.lexer.lineno)
88
+ end
89
+
90
+ def prepare_partial_block(open, program, close)
91
+ _, name, params, hash, open_strip = *open
92
+ _, close_name, close_strip = *close
93
+
94
+ validate_close(name, close_name)
95
+
96
+ s(:partial_block, name, params, hash, program, open_strip, close_strip)
97
+ .line(self.lexer.lineno)
98
+ end
99
+
100
+ def prepare_raw_block(open, contents, close)
101
+ _open_type, path, params, hash, open_strip = *open
102
+ name = path[2][1]
103
+ validate_close(name, close)
104
+ close_strip = strip_flags(close, close)
105
+ s(:block, path, params, hash, contents, nil, open_strip, close_strip).line(self.lexer.lineno)
106
+ end
107
+
108
+ def prepare_block(open, program, inverse_chain, close, inverted)
109
+ open_type, name, params, hash, block_params, open_strip = *open
110
+ directive = open_type == :open_directive
111
+
112
+ raise ParseError, "Unexpected inverse" if directive && inverse_chain
113
+
114
+ if close
115
+ _, close_name, close_strip = *close
116
+ validate_close(name, close_name)
117
+ end
118
+
119
+ # TODO: Get close_strip from inverse_chain if close is nil
120
+
121
+ if inverted
122
+ raise NotImplementedError if inverse_chain
123
+ inverse_chain = s(:inverse, block_params, program, open_strip, close_strip)
124
+ program = nil
125
+ else
126
+ program = s(:program, block_params, program)
127
+ end
128
+
129
+ type = directive ? :directive_block : :block
130
+ s(type, name, params, hash, program, inverse_chain, open_strip, close_strip)
131
+ .line(self.lexer.lineno)
132
+ end
133
+
134
+ def validate_close(name, close_name)
135
+ unless name == close_name
136
+ raise ParseError, "#{name[2][1]} doesn't match #{close_name[2][1]}"
137
+ end
138
+ end
139
+
140
+ def on_error(t, val, vstack)
141
+ raise ParseError, sprintf("Parse error on line %i on value %s (%s) at %s",
142
+ self.lexer.lineno, val.inspect, token_to_str(t) || '?', vstack.inspect)
143
+ end
144
+ ...end handlebars_parser.y/module_eval...
145
+ ##### State transition tables begin ###
146
+
147
+ racc_action_table = [
148
+ 13, 14, 26, 16, 14, 19, 56, 20, 68, 69,
149
+ 57, 21, 22, 58, 23, 25, 13, 14, 44, 16,
150
+ 65, 19, 66, 20, 68, 69, 69, 21, 22, 65,
151
+ 23, 25, 13, 14, 81, 16, 88, 19, 66, 20,
152
+ 127, 128, 44, 21, 22, 92, 23, 25, 13, 14,
153
+ 81, 16, 81, 19, 88, 20, 88, 88, 88, 21,
154
+ 22, 88, 23, 25, 13, 14, 88, 16, 105, 19,
155
+ 88, 20, 88, 66, 113, 21, 22, 113, 23, 25,
156
+ 13, 14, 115, 16, 116, 19, 117, 20, 118, 119,
157
+ 120, 21, 22, 88, 23, 25, 13, 14, 122, 16,
158
+ 124, 19, 125, 20, 113, 129, nil, 21, 22, 33,
159
+ 23, 25, nil, nil, 44, 36, 37, 38, 39, 40,
160
+ 41, 33, nil, nil, nil, nil, 44, 36, 37, 38,
161
+ 39, 40, 41, 33, nil, nil, nil, nil, 44, 36,
162
+ 37, 38, 39, 40, 41, 33, nil, nil, nil, nil,
163
+ 44, 36, 37, 38, 39, 40, 41, 33, nil, nil,
164
+ nil, nil, 44, 36, 37, 38, 39, 40, 41, 33,
165
+ nil, nil, nil, nil, 44, 36, 37, 38, 39, 40,
166
+ 41, 33, nil, nil, nil, nil, 44, 36, 37, 38,
167
+ 39, 40, 41, 33, nil, nil, nil, nil, 44, 36,
168
+ 37, 38, 39, 40, 41, 33, nil, nil, nil, nil,
169
+ 44, 36, 37, 38, 39, 40, 41, 33, nil, nil,
170
+ nil, nil, 44, 36, 37, 38, 39, 40, 41, 33,
171
+ nil, nil, nil, nil, 44, 36, 37, 38, 39, 40,
172
+ 41, 33, nil, nil, nil, nil, 44, 36, 37, 38,
173
+ 39, 40, 41, 33, nil, nil, nil, nil, 44, 36,
174
+ 37, 38, 39, 40, 41, 33, nil, nil, nil, nil,
175
+ 44, 36, 37, 38, 39, 40, 41, 33, nil, nil,
176
+ nil, nil, 44, 36, 37, 38, 39, 40, 41, 33,
177
+ nil, nil, nil, nil, 44, 36, 37, 38, 39, 40,
178
+ 41, 33, nil, nil, nil, nil, 44, 36, 37, 38,
179
+ 39, 40, 41, 33, nil, nil, nil, nil, 44, 36,
180
+ 37, 38, 39, 40, 41, 33, nil, nil, nil, nil,
181
+ 44, 36, 37, 38, 39, 40, 41, 33, nil, nil,
182
+ nil, nil, 44, 36, 37, 38, 39, 40, 41, 33,
183
+ nil, nil, nil, nil, 44, 36, 37, 38, 39, 40,
184
+ 41 ]
185
+
186
+ racc_action_check = [
187
+ 0, 0, 1, 0, 15, 0, 26, 0, 45, 45,
188
+ 29, 0, 0, 31, 0, 0, 5, 5, 41, 5,
189
+ 42, 5, 43, 5, 96, 96, 46, 5, 5, 51,
190
+ 5, 5, 17, 17, 54, 17, 59, 17, 64, 17,
191
+ 123, 123, 65, 17, 17, 66, 17, 17, 18, 18,
192
+ 67, 18, 73, 18, 76, 18, 77, 78, 79, 18,
193
+ 18, 80, 18, 18, 24, 24, 83, 24, 84, 24,
194
+ 86, 24, 90, 91, 98, 24, 24, 99, 24, 24,
195
+ 69, 69, 100, 69, 101, 69, 102, 69, 103, 104,
196
+ 108, 69, 69, 109, 69, 69, 71, 71, 111, 71,
197
+ 113, 71, 114, 71, 121, 126, nil, 71, 71, 16,
198
+ 71, 71, nil, nil, 16, 16, 16, 16, 16, 16,
199
+ 16, 19, nil, nil, nil, nil, 19, 19, 19, 19,
200
+ 19, 19, 19, 20, nil, nil, nil, nil, 20, 20,
201
+ 20, 20, 20, 20, 20, 21, nil, nil, nil, nil,
202
+ 21, 21, 21, 21, 21, 21, 21, 22, nil, nil,
203
+ nil, nil, 22, 22, 22, 22, 22, 22, 22, 23,
204
+ nil, nil, nil, nil, 23, 23, 23, 23, 23, 23,
205
+ 23, 25, nil, nil, nil, nil, 25, 25, 25, 25,
206
+ 25, 25, 25, 32, nil, nil, nil, nil, 32, 32,
207
+ 32, 32, 32, 32, 32, 33, nil, nil, nil, nil,
208
+ 33, 33, 33, 33, 33, 33, 33, 47, nil, nil,
209
+ nil, nil, 47, 47, 47, 47, 47, 47, 47, 48,
210
+ nil, nil, nil, nil, 48, 48, 48, 48, 48, 48,
211
+ 48, 49, nil, nil, nil, nil, 49, 49, 49, 49,
212
+ 49, 49, 49, 52, nil, nil, nil, nil, 52, 52,
213
+ 52, 52, 52, 52, 52, 53, nil, nil, nil, nil,
214
+ 53, 53, 53, 53, 53, 53, 53, 55, nil, nil,
215
+ nil, nil, 55, 55, 55, 55, 55, 55, 55, 61,
216
+ nil, nil, nil, nil, 61, 61, 61, 61, 61, 61,
217
+ 61, 63, nil, nil, nil, nil, 63, 63, 63, 63,
218
+ 63, 63, 63, 68, nil, nil, nil, nil, 68, 68,
219
+ 68, 68, 68, 68, 68, 81, nil, nil, nil, nil,
220
+ 81, 81, 81, 81, 81, 81, 81, 88, nil, nil,
221
+ nil, nil, 88, 88, 88, 88, 88, 88, 88, 94,
222
+ nil, nil, nil, nil, 94, 94, 94, 94, 94, 94,
223
+ 94 ]
224
+
225
+ racc_action_pointer = [
226
+ -2, 2, nil, nil, nil, 14, nil, nil, nil, nil,
227
+ nil, nil, nil, nil, nil, 1, 91, 30, 46, 103,
228
+ 115, 127, 139, 151, 62, 163, 6, nil, nil, 7,
229
+ nil, 9, 175, 187, nil, nil, nil, nil, nil, nil,
230
+ nil, -5, -10, -8, nil, -2, 15, 199, 211, 223,
231
+ nil, -1, 235, 247, 22, 259, nil, nil, nil, 16,
232
+ nil, 271, nil, 283, 8, 19, 22, 38, 295, 78,
233
+ nil, 94, nil, 40, nil, nil, 34, 36, 37, 38,
234
+ 41, 307, nil, 46, 62, nil, 50, nil, 319, nil,
235
+ 52, 43, nil, nil, 331, nil, 14, nil, 53, 56,
236
+ 74, 69, 78, 80, 81, nil, nil, nil, 71, 73,
237
+ nil, 90, nil, 77, 94, nil, nil, nil, nil, nil,
238
+ nil, 83, nil, 18, nil, nil, 97, nil, nil, nil ]
239
+
240
+ racc_action_default = [
241
+ -66, -67, -1, -2, -3, -4, -5, -7, -8, -9,
242
+ -10, -11, -12, -13, -14, -66, -67, -66, -66, -67,
243
+ -67, -67, -67, -67, -66, -67, -67, -6, -15, -16,
244
+ -17, -67, -66, -67, -54, -55, -56, -57, -58, -59,
245
+ -60, -67, -67, -63, -65, -66, -66, -66, -66, -66,
246
+ -38, -39, -66, -66, -67, -66, 130, -18, -19, -66,
247
+ -40, -41, -42, -66, -61, -67, -67, -67, -67, -66,
248
+ -29, -66, -31, -67, -26, -27, -66, -66, -66, -66,
249
+ -66, -67, -36, -66, -67, -45, -46, -47, -67, -43,
250
+ -66, -62, -64, -21, -66, -28, -66, -22, -66, -66,
251
+ -67, -67, -67, -67, -67, -20, -48, -49, -67, -66,
252
+ -30, -67, -50, -67, -67, -33, -34, -35, -32, -37,
253
+ -44, -66, -23, -67, -52, -24, -67, -51, -53, -25 ]
254
+
255
+ racc_goto_table = [
256
+ 4, 32, 64, 3, 47, 48, 67, 1, 42, 2,
257
+ 27, 42, 42, 111, 114, 28, 30, 4, 4, 31,
258
+ 45, 46, 82, 29, 4, 73, 91, 54, 49, 52,
259
+ 53, 84, 55, 75, 106, 93, 126, 123, nil, nil,
260
+ 63, 97, nil, nil, nil, 70, 74, nil, 98, 99,
261
+ 100, 101, 102, 94, nil, 104, nil, 110, nil, 85,
262
+ 42, nil, 108, nil, nil, nil, 103, nil, 89, 4,
263
+ nil, 4, 95, 42, 96, nil, 85, 85, 85, 85,
264
+ 85, 121, nil, 85, nil, 59, nil, nil, nil, nil,
265
+ 85, nil, nil, nil, nil, 107, 70, nil, 112, 112,
266
+ 76, 77, 78, nil, nil, 79, 80, nil, 83, 85,
267
+ nil, nil, nil, nil, nil, nil, 90, nil, nil, nil,
268
+ nil, 112, nil, nil, nil, nil, nil, nil, nil, nil,
269
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
270
+ nil, nil, nil, nil, nil, nil, nil, 109 ]
271
+
272
+ racc_goto_check = [
273
+ 4, 16, 36, 3, 16, 16, 20, 1, 29, 2,
274
+ 6, 29, 29, 24, 24, 4, 12, 4, 4, 13,
275
+ 3, 3, 21, 14, 4, 23, 36, 3, 27, 27,
276
+ 27, 18, 27, 26, 32, 21, 24, 33, nil, nil,
277
+ 27, 21, nil, nil, nil, 4, 4, nil, 18, 18,
278
+ 18, 18, 18, 16, nil, 18, nil, 20, nil, 4,
279
+ 29, nil, 18, nil, nil, nil, 16, nil, 27, 4,
280
+ nil, 4, 3, 29, 3, nil, 4, 4, 4, 4,
281
+ 4, 18, nil, 4, nil, 17, nil, nil, nil, nil,
282
+ 4, nil, nil, nil, nil, 27, 4, nil, 4, 4,
283
+ 17, 17, 17, nil, nil, 17, 17, nil, 17, 4,
284
+ nil, nil, nil, nil, nil, nil, 17, nil, nil, nil,
285
+ nil, 4, nil, nil, nil, nil, nil, nil, nil, nil,
286
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
287
+ nil, nil, nil, nil, nil, nil, nil, 17 ]
288
+
289
+ racc_goto_pointer = [
290
+ nil, 7, 9, 3, 0, nil, 5, nil, nil, nil,
291
+ nil, nil, 1, 4, 8, nil, -15, 53, -28, nil,
292
+ -39, -32, nil, -21, -85, nil, -13, 7, nil, -8,
293
+ nil, nil, -52, -76, nil, nil, -39 ]
294
+
295
+ racc_goto_default = [
296
+ nil, nil, nil, nil, 60, 5, 6, 7, 8, 9,
297
+ 10, 11, 12, nil, nil, 15, 50, nil, nil, 17,
298
+ nil, nil, 18, nil, nil, 71, 72, 62, 24, 51,
299
+ 61, 86, 87, nil, 34, 35, 43 ]
300
+
301
+ racc_reduce_table = [
302
+ 0, 0, :racc_error,
303
+ 1, 32, :_reduce_none,
304
+ 1, 33, :_reduce_2,
305
+ 1, 34, :_reduce_none,
306
+ 1, 34, :_reduce_none,
307
+ 1, 36, :_reduce_5,
308
+ 2, 36, :_reduce_6,
309
+ 1, 37, :_reduce_none,
310
+ 1, 37, :_reduce_none,
311
+ 1, 37, :_reduce_none,
312
+ 1, 37, :_reduce_none,
313
+ 1, 37, :_reduce_none,
314
+ 1, 37, :_reduce_none,
315
+ 1, 37, :_reduce_13,
316
+ 1, 43, :_reduce_14,
317
+ 1, 44, :_reduce_15,
318
+ 1, 44, :_reduce_none,
319
+ 1, 45, :_reduce_none,
320
+ 2, 45, :_reduce_18,
321
+ 3, 40, :_reduce_19,
322
+ 5, 46, :_reduce_20,
323
+ 4, 39, :_reduce_21,
324
+ 4, 39, :_reduce_22,
325
+ 6, 50, :_reduce_23,
326
+ 6, 53, :_reduce_24,
327
+ 6, 56, :_reduce_25,
328
+ 1, 54, :_reduce_none,
329
+ 1, 54, :_reduce_none,
330
+ 2, 57, :_reduce_28,
331
+ 1, 51, :_reduce_none,
332
+ 3, 51, :_reduce_30,
333
+ 1, 51, :_reduce_none,
334
+ 3, 52, :_reduce_32,
335
+ 5, 38, :_reduce_33,
336
+ 5, 38, :_reduce_34,
337
+ 5, 41, :_reduce_35,
338
+ 3, 42, :_reduce_36,
339
+ 5, 59, :_reduce_37,
340
+ 1, 58, :_reduce_none,
341
+ 1, 58, :_reduce_none,
342
+ 1, 48, :_reduce_40,
343
+ 1, 48, :_reduce_none,
344
+ 1, 61, :_reduce_42,
345
+ 2, 61, :_reduce_43,
346
+ 5, 60, :_reduce_44,
347
+ 1, 49, :_reduce_none,
348
+ 1, 49, :_reduce_46,
349
+ 1, 62, :_reduce_47,
350
+ 2, 62, :_reduce_48,
351
+ 2, 63, :_reduce_49,
352
+ 1, 55, :_reduce_none,
353
+ 3, 55, :_reduce_51,
354
+ 1, 64, :_reduce_52,
355
+ 2, 64, :_reduce_53,
356
+ 1, 47, :_reduce_none,
357
+ 1, 47, :_reduce_none,
358
+ 1, 47, :_reduce_56,
359
+ 1, 47, :_reduce_57,
360
+ 1, 47, :_reduce_58,
361
+ 1, 47, :_reduce_59,
362
+ 1, 47, :_reduce_60,
363
+ 2, 66, :_reduce_61,
364
+ 3, 65, :_reduce_62,
365
+ 1, 65, :_reduce_63,
366
+ 3, 67, :_reduce_64,
367
+ 1, 67, :_reduce_65,
368
+ 0, 35, :_reduce_66 ]
369
+
370
+ racc_reduce_n = 67
371
+
372
+ racc_shift_n = 130
373
+
374
+ racc_token_table = {
375
+ false => 0,
376
+ :error => 1,
377
+ :COMMENT => 2,
378
+ :CONTENT => 3,
379
+ :END_RAW_BLOCK => 4,
380
+ :OPEN_RAW_BLOCK => 5,
381
+ :CLOSE_RAW_BLOCK => 6,
382
+ :OPEN_BLOCK => 7,
383
+ :CLOSE => 8,
384
+ :OPEN_INVERSE => 9,
385
+ :OPEN_INVERSE_CHAIN => 10,
386
+ :INVERSE => 11,
387
+ :OPEN_ENDBLOCK => 12,
388
+ :OPEN => 13,
389
+ :OPEN_UNESCAPED => 14,
390
+ :CLOSE_UNESCAPED => 15,
391
+ :OPEN_PARTIAL => 16,
392
+ :OPEN_PARTIAL_BLOCK => 17,
393
+ :OPEN_SEXPR => 18,
394
+ :CLOSE_SEXPR => 19,
395
+ :KEY_ASSIGN => 20,
396
+ :OPEN_BLOCK_PARAMS => 21,
397
+ :CLOSE_BLOCK_PARAMS => 22,
398
+ :ID => 23,
399
+ :STRING => 24,
400
+ :NUMBER => 25,
401
+ :BOOLEAN => 26,
402
+ :UNDEFINED => 27,
403
+ :NULL => 28,
404
+ :DATA => 29,
405
+ :SEP => 30 }
406
+
407
+ racc_nt_base = 31
408
+
409
+ racc_use_result_var = true
410
+
411
+ Racc_arg = [
412
+ racc_action_table,
413
+ racc_action_check,
414
+ racc_action_default,
415
+ racc_action_pointer,
416
+ racc_goto_table,
417
+ racc_goto_check,
418
+ racc_goto_default,
419
+ racc_goto_pointer,
420
+ racc_nt_base,
421
+ racc_reduce_table,
422
+ racc_token_table,
423
+ racc_shift_n,
424
+ racc_reduce_n,
425
+ racc_use_result_var ]
426
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
427
+
428
+ Racc_token_to_s_table = [
429
+ "$end",
430
+ "error",
431
+ "COMMENT",
432
+ "CONTENT",
433
+ "END_RAW_BLOCK",
434
+ "OPEN_RAW_BLOCK",
435
+ "CLOSE_RAW_BLOCK",
436
+ "OPEN_BLOCK",
437
+ "CLOSE",
438
+ "OPEN_INVERSE",
439
+ "OPEN_INVERSE_CHAIN",
440
+ "INVERSE",
441
+ "OPEN_ENDBLOCK",
442
+ "OPEN",
443
+ "OPEN_UNESCAPED",
444
+ "CLOSE_UNESCAPED",
445
+ "OPEN_PARTIAL",
446
+ "OPEN_PARTIAL_BLOCK",
447
+ "OPEN_SEXPR",
448
+ "CLOSE_SEXPR",
449
+ "KEY_ASSIGN",
450
+ "OPEN_BLOCK_PARAMS",
451
+ "CLOSE_BLOCK_PARAMS",
452
+ "ID",
453
+ "STRING",
454
+ "NUMBER",
455
+ "BOOLEAN",
456
+ "UNDEFINED",
457
+ "NULL",
458
+ "DATA",
459
+ "SEP",
460
+ "$start",
461
+ "start",
462
+ "root",
463
+ "program",
464
+ "none",
465
+ "statements",
466
+ "statement",
467
+ "mustache",
468
+ "block",
469
+ "rawBlock",
470
+ "partial",
471
+ "partialBlock",
472
+ "content",
473
+ "contents",
474
+ "contentList",
475
+ "openRawBlock",
476
+ "helperName",
477
+ "exprs",
478
+ "hash",
479
+ "openBlock",
480
+ "inverseChain",
481
+ "closeBlock",
482
+ "openInverse",
483
+ "optInverseAndProgram",
484
+ "blockParams",
485
+ "openInverseChain",
486
+ "inverseAndProgram",
487
+ "expr",
488
+ "openPartialBlock",
489
+ "sexpr",
490
+ "exprList",
491
+ "hashSegments",
492
+ "hashSegment",
493
+ "idSequence",
494
+ "path",
495
+ "dataName",
496
+ "pathSegments" ]
497
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
498
+
499
+ Racc_debug_parser = false
500
+
501
+ ##### State transition tables end #####
502
+
503
+ # reduce 0 omitted
504
+
505
+ # reduce 1 omitted
506
+
507
+ module_eval(<<'.,.,', 'handlebars_parser.y', 22)
508
+ def _reduce_2(val, _values, result)
509
+ result = s(:root, val[0])
510
+ result
511
+ end
512
+ .,.,
513
+
514
+ # reduce 3 omitted
515
+
516
+ # reduce 4 omitted
517
+
518
+ module_eval(<<'.,.,', 'handlebars_parser.y', 32)
519
+ def _reduce_5(val, _values, result)
520
+ result = s(:statements, val[0])
521
+ result
522
+ end
523
+ .,.,
524
+
525
+ module_eval(<<'.,.,', 'handlebars_parser.y', 33)
526
+ def _reduce_6(val, _values, result)
527
+ result << val[1]
528
+ result
529
+ end
530
+ .,.,
531
+
532
+ # reduce 7 omitted
533
+
534
+ # reduce 8 omitted
535
+
536
+ # reduce 9 omitted
537
+
538
+ # reduce 10 omitted
539
+
540
+ # reduce 11 omitted
541
+
542
+ # reduce 12 omitted
543
+
544
+ module_eval(<<'.,.,', 'handlebars_parser.y', 44)
545
+ def _reduce_13(val, _values, result)
546
+ result = s(:comment, strip_comment(val[0]), strip_flags(val[0], val[0]))
547
+ .line(self.lexer.lineno)
548
+
549
+ result
550
+ end
551
+ .,.,
552
+
553
+ module_eval(<<'.,.,', 'handlebars_parser.y', 50)
554
+ def _reduce_14(val, _values, result)
555
+ result = s(:content, val[0])
556
+ result.line = self.lexer.lineno
557
+
558
+ result
559
+ end
560
+ .,.,
561
+
562
+ module_eval(<<'.,.,', 'handlebars_parser.y', 58)
563
+ def _reduce_15(val, _values, result)
564
+ result = s(:content, "")
565
+ result.line = self.lexer.lineno
566
+
567
+ result
568
+ end
569
+ .,.,
570
+
571
+ # reduce 16 omitted
572
+
573
+ # reduce 17 omitted
574
+
575
+ module_eval(<<'.,.,', 'handlebars_parser.y', 68)
576
+ def _reduce_18(val, _values, result)
577
+ result[1] += val[1]
578
+
579
+ result
580
+ end
581
+ .,.,
582
+
583
+ module_eval(<<'.,.,', 'handlebars_parser.y', 73)
584
+ def _reduce_19(val, _values, result)
585
+ result = prepare_raw_block(val[0], val[1], val[2])
586
+ result
587
+ end
588
+ .,.,
589
+
590
+ module_eval(<<'.,.,', 'handlebars_parser.y', 78)
591
+ def _reduce_20(val, _values, result)
592
+ result = s(:open_raw, *val[1..3], strip_flags(val[0], val[4])).line(self.lexer.lineno)
593
+
594
+ result
595
+ end
596
+ .,.,
597
+
598
+ module_eval(<<'.,.,', 'handlebars_parser.y', 83)
599
+ def _reduce_21(val, _values, result)
600
+ result = prepare_block(val[0], val[1], val[2], val[3], false)
601
+ result
602
+ end
603
+ .,.,
604
+
605
+ module_eval(<<'.,.,', 'handlebars_parser.y', 84)
606
+ def _reduce_22(val, _values, result)
607
+ result = prepare_block(val[0], val[1], val[2], val[3], true)
608
+ result
609
+ end
610
+ .,.,
611
+
612
+ module_eval(<<'.,.,', 'handlebars_parser.y', 89)
613
+ def _reduce_23(val, _values, result)
614
+ decorator, _escaped = interpret_open_token(val[0])
615
+ type = decorator ? :open_directive : :open
616
+ result = s(type, *val[1..4], strip_flags(val[0], val[5]))
617
+
618
+ result
619
+ end
620
+ .,.,
621
+
622
+ module_eval(<<'.,.,', 'handlebars_parser.y', 96)
623
+ def _reduce_24(val, _values, result)
624
+ result = s(:open, val[1], val[2], val[3], val[4], strip_flags(val[0], val[5]))
625
+ result
626
+ end
627
+ .,.,
628
+
629
+ module_eval(<<'.,.,', 'handlebars_parser.y', 100)
630
+ def _reduce_25(val, _values, result)
631
+ result = s(:open, val[1], val[2], val[3], val[4], strip_flags(val[0], val[5]))
632
+ result
633
+ end
634
+ .,.,
635
+
636
+ # reduce 26 omitted
637
+
638
+ # reduce 27 omitted
639
+
640
+ module_eval(<<'.,.,', 'handlebars_parser.y', 110)
641
+ def _reduce_28(val, _values, result)
642
+ result = s(:inverse, nil, val[1], strip_flags(val[0], val[0]), nil)
643
+ result
644
+ end
645
+ .,.,
646
+
647
+ # reduce 29 omitted
648
+
649
+ module_eval(<<'.,.,', 'handlebars_parser.y', 116)
650
+ def _reduce_30(val, _values, result)
651
+ block = prepare_block(val[0], val[1], val[2], nil, false)
652
+ result = s(:inverse, nil, block, nil, nil)
653
+
654
+ result
655
+ end
656
+ .,.,
657
+
658
+ # reduce 31 omitted
659
+
660
+ module_eval(<<'.,.,', 'handlebars_parser.y', 123)
661
+ def _reduce_32(val, _values, result)
662
+ result = s(:close, val[1], strip_flags(val[0], val[2]))
663
+ result
664
+ end
665
+ .,.,
666
+
667
+ module_eval(<<'.,.,', 'handlebars_parser.y', 127)
668
+ def _reduce_33(val, _values, result)
669
+ result = prepare_mustache(*val)
670
+ result
671
+ end
672
+ .,.,
673
+
674
+ module_eval(<<'.,.,', 'handlebars_parser.y', 128)
675
+ def _reduce_34(val, _values, result)
676
+ result = prepare_mustache(*val)
677
+ result
678
+ end
679
+ .,.,
680
+
681
+ module_eval(<<'.,.,', 'handlebars_parser.y', 133)
682
+ def _reduce_35(val, _values, result)
683
+ result = s(:partial, val[1], val[2], val[3], strip_flags(val[0], val[4]))
684
+ .line(self.lexer.lineno)
685
+
686
+ result
687
+ end
688
+ .,.,
689
+
690
+ module_eval(<<'.,.,', 'handlebars_parser.y', 139)
691
+ def _reduce_36(val, _values, result)
692
+ result = prepare_partial_block(*val)
693
+ result
694
+ end
695
+ .,.,
696
+
697
+ module_eval(<<'.,.,', 'handlebars_parser.y', 143)
698
+ def _reduce_37(val, _values, result)
699
+ result = s(:open_partial, val[1], val[2], val[3], strip_flags(val[0], val[4]))
700
+ result
701
+ end
702
+ .,.,
703
+
704
+ # reduce 38 omitted
705
+
706
+ # reduce 39 omitted
707
+
708
+ module_eval(<<'.,.,', 'handlebars_parser.y', 153)
709
+ def _reduce_40(val, _values, result)
710
+ result = s(:exprs)
711
+ result
712
+ end
713
+ .,.,
714
+
715
+ # reduce 41 omitted
716
+
717
+ module_eval(<<'.,.,', 'handlebars_parser.y', 159)
718
+ def _reduce_42(val, _values, result)
719
+ result = s(:exprs, val[0])
720
+ result
721
+ end
722
+ .,.,
723
+
724
+ module_eval(<<'.,.,', 'handlebars_parser.y', 160)
725
+ def _reduce_43(val, _values, result)
726
+ result.push(val[1])
727
+ result
728
+ end
729
+ .,.,
730
+
731
+ module_eval(<<'.,.,', 'handlebars_parser.y', 165)
732
+ def _reduce_44(val, _values, result)
733
+ result = s(:sub_expression, val[1], val[2], val[3]).line self.lexer.lineno
734
+
735
+ result
736
+ end
737
+ .,.,
738
+
739
+ # reduce 45 omitted
740
+
741
+ module_eval(<<'.,.,', 'handlebars_parser.y', 170)
742
+ def _reduce_46(val, _values, result)
743
+ result = result.line(self.lexer.lineno)
744
+ result
745
+ end
746
+ .,.,
747
+
748
+ module_eval(<<'.,.,', 'handlebars_parser.y', 175)
749
+ def _reduce_47(val, _values, result)
750
+ result = s(:hash, val[0])
751
+ result
752
+ end
753
+ .,.,
754
+
755
+ module_eval(<<'.,.,', 'handlebars_parser.y', 176)
756
+ def _reduce_48(val, _values, result)
757
+ result.push(val[1])
758
+ result
759
+ end
760
+ .,.,
761
+
762
+ module_eval(<<'.,.,', 'handlebars_parser.y', 180)
763
+ def _reduce_49(val, _values, result)
764
+ result = s(:hash_pair, val[0], val[1]).line(self.lexer.lineno)
765
+ result
766
+ end
767
+ .,.,
768
+
769
+ # reduce 50 omitted
770
+
771
+ module_eval(<<'.,.,', 'handlebars_parser.y', 185)
772
+ def _reduce_51(val, _values, result)
773
+ result = s(:block_params, *val[1])
774
+ result
775
+ end
776
+ .,.,
777
+
778
+ module_eval(<<'.,.,', 'handlebars_parser.y', 190)
779
+ def _reduce_52(val, _values, result)
780
+ result = [id(val[0])]
781
+ result
782
+ end
783
+ .,.,
784
+
785
+ module_eval(<<'.,.,', 'handlebars_parser.y', 191)
786
+ def _reduce_53(val, _values, result)
787
+ result << id(val[1])
788
+ result
789
+ end
790
+ .,.,
791
+
792
+ # reduce 54 omitted
793
+
794
+ # reduce 55 omitted
795
+
796
+ module_eval(<<'.,.,', 'handlebars_parser.y', 197)
797
+ def _reduce_56(val, _values, result)
798
+ result = s(:string, val[0]).line(self.lexer.lineno)
799
+ result
800
+ end
801
+ .,.,
802
+
803
+ module_eval(<<'.,.,', 'handlebars_parser.y', 198)
804
+ def _reduce_57(val, _values, result)
805
+ result = s(:number, process_number(val[0])).line(self.lexer.lineno)
806
+ result
807
+ end
808
+ .,.,
809
+
810
+ module_eval(<<'.,.,', 'handlebars_parser.y', 199)
811
+ def _reduce_58(val, _values, result)
812
+ result = s(:boolean, val[0] == "true").line(self.lexer.lineno)
813
+ result
814
+ end
815
+ .,.,
816
+
817
+ module_eval(<<'.,.,', 'handlebars_parser.y', 200)
818
+ def _reduce_59(val, _values, result)
819
+ result = s(:undefined).line(self.lexer.lineno)
820
+ result
821
+ end
822
+ .,.,
823
+
824
+ module_eval(<<'.,.,', 'handlebars_parser.y', 201)
825
+ def _reduce_60(val, _values, result)
826
+ result = s(:null).line(self.lexer.lineno)
827
+ result
828
+ end
829
+ .,.,
830
+
831
+ module_eval(<<'.,.,', 'handlebars_parser.y', 205)
832
+ def _reduce_61(val, _values, result)
833
+ result = prepare_path(true, false, val[1], self.lexer.lineno)
834
+ result
835
+ end
836
+ .,.,
837
+
838
+ module_eval(<<'.,.,', 'handlebars_parser.y', 210)
839
+ def _reduce_62(val, _values, result)
840
+ # NOTE: Separator is always parsed as '/'
841
+ result = prepare_path(false, false, [val[0], s(:sep, "/"), *val[2]], self.lexer.lineno)
842
+
843
+ result
844
+ end
845
+ .,.,
846
+
847
+ module_eval(<<'.,.,', 'handlebars_parser.y', 213)
848
+ def _reduce_63(val, _values, result)
849
+ result = prepare_path(false, false, val[0], self.lexer.lineno)
850
+ result
851
+ end
852
+ .,.,
853
+
854
+ module_eval(<<'.,.,', 'handlebars_parser.y', 217)
855
+ def _reduce_64(val, _values, result)
856
+ result.push(s(:sep, val[1]), id(val[2]))
857
+ result
858
+ end
859
+ .,.,
860
+
861
+ module_eval(<<'.,.,', 'handlebars_parser.y', 218)
862
+ def _reduce_65(val, _values, result)
863
+ result = [id(val[0])]
864
+ result
865
+ end
866
+ .,.,
867
+
868
+ module_eval(<<'.,.,', 'handlebars_parser.y', 223)
869
+ def _reduce_66(val, _values, result)
870
+ result = nil
871
+ result
872
+ end
873
+ .,.,
874
+
875
+ def _reduce_none(val, _values, result)
876
+ val[0]
877
+ end
878
+
879
+ end # class HandlebarsParser
880
+ end # module Haparanda