packcr 0.0.7 → 0.1.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.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +73 -0
- data/lib/packcr/context.rb +15 -6
- data/lib/packcr/generated/context.rb +290 -143
- data/lib/packcr/generated/node/action_node.rb +19 -2
- data/lib/packcr/generated/node/alternate_node.rb +54 -8
- data/lib/packcr/generated/node/capture_node.rb +16 -1
- data/lib/packcr/generated/node/charclass_node.rb +76 -9
- data/lib/packcr/generated/node/eof_node.rb +8 -1
- data/lib/packcr/generated/node/error_node.rb +9 -2
- data/lib/packcr/generated/node/expand_node.rb +9 -2
- data/lib/packcr/generated/node/predicate_node.rb +35 -2
- data/lib/packcr/generated/node/quantity_node.rb +84 -31
- data/lib/packcr/generated/node/reference_node.rb +16 -2
- data/lib/packcr/generated/node/rule_node.rb +38 -7
- data/lib/packcr/generated/node/sequence_node.rb +18 -0
- data/lib/packcr/generated/node/string_node.rb +28 -4
- data/lib/packcr/node/reference_node.rb +1 -0
- data/lib/packcr/node/rule_node.rb +2 -1
- data/lib/packcr/parser.rb +993 -838
- data/lib/packcr/stream.rb +1 -1
- data/lib/packcr/templates/context/header.c.erb +3 -3
- data/lib/packcr/templates/context/source.c.erb +438 -420
- data/lib/packcr/templates/context/source.rb.erb +185 -167
- data/lib/packcr/templates/context/source.rs.erb +625 -0
- data/lib/packcr/templates/node/action.c.erb +2 -2
- data/lib/packcr/templates/node/action.rs.erb +6 -0
- data/lib/packcr/templates/node/alternate.c.erb +2 -2
- data/lib/packcr/templates/node/alternate.rs.erb +39 -0
- data/lib/packcr/templates/node/capture.c.erb +2 -2
- data/lib/packcr/templates/node/capture.rs.erb +13 -0
- data/lib/packcr/templates/node/charclass.c.erb +4 -4
- data/lib/packcr/templates/node/charclass_any.c.erb +2 -2
- data/lib/packcr/templates/node/charclass_one.c.erb +4 -4
- data/lib/packcr/templates/node/charclass_utf8.c.erb +2 -2
- data/lib/packcr/templates/node/charclass_utf8.rs.erb +41 -0
- data/lib/packcr/templates/node/eof.c.erb +1 -1
- data/lib/packcr/templates/node/error.c.erb +4 -4
- data/lib/packcr/templates/node/expand.c.erb +2 -2
- data/lib/packcr/templates/node/predicate.c.erb +1 -1
- data/lib/packcr/templates/node/predicate_neg.c.erb +1 -1
- data/lib/packcr/templates/node/predicate_neg.rs.erb +24 -0
- data/lib/packcr/templates/node/quantity_many.c.erb +9 -7
- data/lib/packcr/templates/node/quantity_many.rs.erb +50 -0
- data/lib/packcr/templates/node/quantity_one.c.erb +9 -7
- data/lib/packcr/templates/node/quantity_one.rb.erb +4 -4
- data/lib/packcr/templates/node/reference.c.erb +6 -6
- data/lib/packcr/templates/node/reference.rs.erb +3 -0
- data/lib/packcr/templates/node/rule.c.erb +9 -9
- data/lib/packcr/templates/node/rule.rs.erb +34 -0
- data/lib/packcr/templates/node/sequence.rs.erb +12 -0
- data/lib/packcr/templates/node/string_many.c.erb +2 -2
- data/lib/packcr/templates/node/string_many.rs.erb +10 -0
- data/lib/packcr/templates/node/string_one.c.erb +2 -2
- data/lib/packcr/templates/node/string_one.rs.erb +9 -0
- data/lib/packcr/util.rb +10 -1
- data/lib/packcr/version.rb +1 -1
- metadata +18 -65
data/lib/packcr/parser.rb
CHANGED
@@ -1,7 +1,154 @@
|
|
1
|
-
# A packrat parser generated by PackCR 0.0
|
1
|
+
# A packrat parser generated by PackCR 0.1.0
|
2
2
|
|
3
3
|
class Packcr
|
4
4
|
class Parser
|
5
|
+
class Location
|
6
|
+
attr_reader :charnum, :linenum
|
7
|
+
|
8
|
+
def initialize(charnum = 0, linenum = 0)
|
9
|
+
@charnum = charnum
|
10
|
+
@linenum = linenum
|
11
|
+
end
|
12
|
+
|
13
|
+
def +(other)
|
14
|
+
if other.linenum.zero?
|
15
|
+
Location.new(@charnum + other.charnum, @linenum + other.linenum)
|
16
|
+
else
|
17
|
+
Location.new( other.charnum, @linenum + other.linenum)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def -(other)
|
22
|
+
raise "unexpected location #{inspect} - #{other.inspect}" unless other.linenum == linenum || other.charnum.zero?
|
23
|
+
|
24
|
+
Location.new(@charnum - other.charnum, @linenum - other.linenum)
|
25
|
+
end
|
26
|
+
|
27
|
+
def forward(buffer, cur, n)
|
28
|
+
Location.new(@charnum, @linenum).forward!(buffer, cur, n)
|
29
|
+
end
|
30
|
+
|
31
|
+
def forward!(buffer, cur, n)
|
32
|
+
buffer[cur, n].scan(/(.*)(\n)?/) do
|
33
|
+
if Regexp.last_match[2]
|
34
|
+
@linenum += 1
|
35
|
+
@charnum = 0
|
36
|
+
else
|
37
|
+
@charnum += Regexp.last_match[1].length
|
38
|
+
end
|
39
|
+
end
|
40
|
+
self
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class LrMemoTable
|
45
|
+
def initialize
|
46
|
+
@memos = {}
|
47
|
+
end
|
48
|
+
|
49
|
+
def clear
|
50
|
+
@memos.clear
|
51
|
+
end
|
52
|
+
|
53
|
+
def []=(index, rule_name, memo)
|
54
|
+
entry = @memos[index] ||= {}
|
55
|
+
entry[rule_name] = memo
|
56
|
+
end
|
57
|
+
|
58
|
+
def [](index, rule_name)
|
59
|
+
@memos.dig(index, rule_name)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
class LrMemo
|
64
|
+
attr_accessor :grow, :answer, :offset, :fail, :offset_loc
|
65
|
+
|
66
|
+
def initialize(offset, offset_loc)
|
67
|
+
@offset = offset
|
68
|
+
@offset_loc = offset_loc
|
69
|
+
@fail = true
|
70
|
+
@grow = false
|
71
|
+
end
|
72
|
+
|
73
|
+
def answer=(answer)
|
74
|
+
@fail = nil
|
75
|
+
@answer = answer
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
class ThunkChunk
|
80
|
+
attr_accessor :thunks, :capts, :pos, :values, :pos_loc
|
81
|
+
|
82
|
+
def initialize
|
83
|
+
super
|
84
|
+
@thunks = []
|
85
|
+
@capts = {}
|
86
|
+
@pos = 0
|
87
|
+
@values = {}
|
88
|
+
end
|
89
|
+
|
90
|
+
def resize_captures(len)
|
91
|
+
len.times do |i|
|
92
|
+
@capts[i] = Capture.new
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
class ThunkLeaf
|
98
|
+
attr_accessor :capt0, :capts, :value_refs, :action
|
99
|
+
|
100
|
+
def initialize(action, capt0 = Capture.new, value_refs = {}, capts = {})
|
101
|
+
@value_refs = value_refs
|
102
|
+
@capts = capts
|
103
|
+
@capt0 = capt0
|
104
|
+
@action = action
|
105
|
+
end
|
106
|
+
|
107
|
+
def do_action(ctx, values, index)
|
108
|
+
ctx.public_send(action, self, values, index)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class ThunkNode
|
113
|
+
attr_accessor :thunks, :values, :index
|
114
|
+
|
115
|
+
def initialize(thunks, values, index)
|
116
|
+
@thunks = thunks
|
117
|
+
@values = values
|
118
|
+
@index = index
|
119
|
+
values[index] ||= Value.new if values
|
120
|
+
end
|
121
|
+
|
122
|
+
def do_action(ctx, _values, _index)
|
123
|
+
@thunks.each do |thunk|
|
124
|
+
thunk.do_action(ctx, @values, @index)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def clear
|
129
|
+
@thunks.clear
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
class Capture
|
134
|
+
attr_accessor :range_start, :range_end, :start_loc, :end_loc
|
135
|
+
|
136
|
+
def initialize(range_start = 0, range_end = 0, start_loc = nil, end_loc = nil)
|
137
|
+
@range_start = range_start
|
138
|
+
@range_end = range_end
|
139
|
+
@start_loc = start_loc || Location.new
|
140
|
+
@end_loc = end_loc || Location.new
|
141
|
+
end
|
142
|
+
|
143
|
+
def capture_string(buffer)
|
144
|
+
@capture_string ||= buffer[@range_start, @range_end - @range_start]
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
class Value
|
149
|
+
attr_accessor :value
|
150
|
+
end
|
151
|
+
|
5
152
|
def initialize(ctx = nil, ifile = nil, debug: false)
|
6
153
|
@buffer = +""
|
7
154
|
|
@@ -69,811 +216,911 @@ class Packcr
|
|
69
216
|
nil while parse
|
70
217
|
end
|
71
218
|
|
72
|
-
def
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
219
|
+
def grow_lr(rule, offset, offset_loc)
|
220
|
+
while true
|
221
|
+
old_offset = @position_offset
|
222
|
+
@position_offset = offset
|
223
|
+
@position_offset_loc = offset_loc
|
224
|
+
answer = public_send(rule, offset, offset_loc, limits: { rule => true })
|
225
|
+
if !answer || @position_offset <= old_offset
|
226
|
+
break
|
227
|
+
end
|
228
|
+
|
229
|
+
memo = @memos[offset, rule]
|
230
|
+
memo.answer = answer
|
231
|
+
memo.offset = @position_offset
|
232
|
+
memo.offset_loc = @position_offset_loc
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
def rule_answer(rule)
|
237
|
+
offset = @position_offset
|
238
|
+
offset_loc = @position_offset_loc
|
239
|
+
memo = @memos[offset, rule]
|
240
|
+
|
241
|
+
if !memo
|
242
|
+
memo = LrMemo.new(offset, offset_loc)
|
243
|
+
@memos[offset, rule] = memo
|
244
|
+
answer = public_send(rule, offset, offset_loc)
|
245
|
+
memo.answer = answer
|
246
|
+
memo.offset = @position_offset
|
247
|
+
memo.offset_loc = @position_offset_loc
|
248
|
+
if memo.grow
|
249
|
+
grow_lr(rule, offset, offset_loc)
|
250
|
+
memo.grow = false
|
251
|
+
answer = memo.answer
|
252
|
+
@position_offset = memo.offset
|
253
|
+
@position_offset_loc = memo.offset_loc
|
254
|
+
end
|
255
|
+
answer
|
256
|
+
elsif memo.fail
|
257
|
+
memo.answer = nil
|
258
|
+
memo.grow = true
|
259
|
+
nil
|
260
|
+
else
|
261
|
+
@position_offset = memo.offset
|
262
|
+
@position_offset_loc = memo.offset_loc
|
263
|
+
memo.answer
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
def apply_rule(rule, thunks, values, index, offset, offset_loc, limits: nil)
|
268
|
+
if limits
|
269
|
+
limits = limits.merge(rule => true)
|
270
|
+
answer = public_send(rule, offset, offset_loc, limits: limits)
|
271
|
+
memo = @memos[offset, rule]
|
272
|
+
if !answer || @position_offset <= memo.offset
|
273
|
+
if memo
|
274
|
+
answer = memo.answer
|
275
|
+
@position_offset = memo.offset
|
276
|
+
@position_offset_loc = memo.offset_loc
|
277
|
+
end
|
278
|
+
else
|
279
|
+
memo.answer = answer
|
280
|
+
memo.offset = @position_offset
|
281
|
+
memo.offset_loc = @position_offset_loc
|
282
|
+
end
|
283
|
+
else
|
284
|
+
answer = rule_answer(rule)
|
285
|
+
end
|
286
|
+
|
287
|
+
if !answer
|
288
|
+
return false
|
289
|
+
end
|
290
|
+
|
291
|
+
values ||= @global_values
|
292
|
+
thunks << ThunkNode.new(answer.thunks, values, index)
|
293
|
+
true
|
294
|
+
end
|
295
|
+
|
296
|
+
def do_action(thunks, values, index)
|
297
|
+
thunks.each do |thunk|
|
298
|
+
thunk.do_action(self, values, index)
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
def action_statement_0(__packcr_in, __packcr_vars, __packcr_index)
|
303
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
304
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
305
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
306
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
307
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
308
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
79
309
|
@ctx.error __0sl.linenum + 1, __0sl.charnum + 1, "Illegal syntax"
|
80
310
|
|
81
|
-
|
311
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
82
312
|
end
|
83
313
|
|
84
|
-
def action_supported_language_0(
|
85
|
-
____ = (
|
86
|
-
__0 =
|
87
|
-
__0s = @buffer_start_position +
|
88
|
-
__0e = @buffer_start_position +
|
89
|
-
__0sl = @buffer_start_position_loc +
|
90
|
-
__0el = @buffer_start_position_loc +
|
314
|
+
def action_supported_language_0(__packcr_in, __packcr_vars, __packcr_index)
|
315
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
316
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
317
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
318
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
319
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
320
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
91
321
|
@ctx.error __0sl.linenum + 1, __0sl.charnum + 1, "Not supported language: #{__0}"
|
92
322
|
|
93
|
-
|
323
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
94
324
|
end
|
95
325
|
|
96
|
-
def action_directive_include_0(
|
97
|
-
____ = (
|
98
|
-
blocks = (
|
99
|
-
__0 =
|
100
|
-
__0s = @buffer_start_position +
|
101
|
-
__0e = @buffer_start_position +
|
102
|
-
__0sl = @buffer_start_position_loc +
|
103
|
-
__0el = @buffer_start_position_loc +
|
326
|
+
def action_directive_include_0(__packcr_in, __packcr_vars, __packcr_index)
|
327
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
328
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
329
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
330
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
331
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
332
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
333
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
104
334
|
blocks.each { |b| @ctx.code(:esource) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
105
335
|
|
106
|
-
|
336
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
107
337
|
end
|
108
338
|
|
109
|
-
def action_directive_include_1(
|
110
|
-
____ = (
|
111
|
-
blocks = (
|
112
|
-
__0 =
|
113
|
-
__0s = @buffer_start_position +
|
114
|
-
__0e = @buffer_start_position +
|
115
|
-
__0sl = @buffer_start_position_loc +
|
116
|
-
__0el = @buffer_start_position_loc +
|
339
|
+
def action_directive_include_1(__packcr_in, __packcr_vars, __packcr_index)
|
340
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
341
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
342
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
343
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
344
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
345
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
346
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
117
347
|
blocks.each { |b| @ctx.code(:source) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
118
348
|
|
119
|
-
|
349
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
120
350
|
end
|
121
351
|
|
122
|
-
def action_directive_include_2(
|
123
|
-
____ = (
|
124
|
-
blocks = (
|
125
|
-
__0 =
|
126
|
-
__0s = @buffer_start_position +
|
127
|
-
__0e = @buffer_start_position +
|
128
|
-
__0sl = @buffer_start_position_loc +
|
129
|
-
__0el = @buffer_start_position_loc +
|
352
|
+
def action_directive_include_2(__packcr_in, __packcr_vars, __packcr_index)
|
353
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
354
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
355
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
356
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
357
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
358
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
359
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
130
360
|
blocks.each { |b| @ctx.code(:lheader) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
131
361
|
|
132
|
-
|
362
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
133
363
|
end
|
134
364
|
|
135
|
-
def action_directive_include_3(
|
136
|
-
____ = (
|
137
|
-
blocks = (
|
138
|
-
__0 =
|
139
|
-
__0s = @buffer_start_position +
|
140
|
-
__0e = @buffer_start_position +
|
141
|
-
__0sl = @buffer_start_position_loc +
|
142
|
-
__0el = @buffer_start_position_loc +
|
365
|
+
def action_directive_include_3(__packcr_in, __packcr_vars, __packcr_index)
|
366
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
367
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
368
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
369
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
370
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
371
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
372
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
143
373
|
blocks.each { |b| @ctx.code(:lsource) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
144
374
|
|
145
|
-
|
375
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
146
376
|
end
|
147
377
|
|
148
|
-
def action_directive_include_4(
|
149
|
-
____ = (
|
150
|
-
blocks = (
|
151
|
-
__0 =
|
152
|
-
__0s = @buffer_start_position +
|
153
|
-
__0e = @buffer_start_position +
|
154
|
-
__0sl = @buffer_start_position_loc +
|
155
|
-
__0el = @buffer_start_position_loc +
|
378
|
+
def action_directive_include_4(__packcr_in, __packcr_vars, __packcr_index)
|
379
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
380
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
381
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
382
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
383
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
384
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
385
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
156
386
|
blocks.each { |b| @ctx.code(:header) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
157
387
|
|
158
|
-
|
388
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
159
389
|
end
|
160
390
|
|
161
|
-
def action_directive_include_5(
|
162
|
-
____ = (
|
163
|
-
blocks = (
|
164
|
-
__0 =
|
165
|
-
__0s = @buffer_start_position +
|
166
|
-
__0e = @buffer_start_position +
|
167
|
-
__0sl = @buffer_start_position_loc +
|
168
|
-
__0el = @buffer_start_position_loc +
|
391
|
+
def action_directive_include_5(__packcr_in, __packcr_vars, __packcr_index)
|
392
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
393
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
394
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
395
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
396
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
397
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
398
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
169
399
|
blocks.each { |b| @ctx.code(:location) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
170
400
|
|
171
|
-
|
401
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
172
402
|
end
|
173
403
|
|
174
|
-
def action_directive_include_6(
|
175
|
-
____ = (
|
176
|
-
blocks = (
|
177
|
-
__0 =
|
178
|
-
__0s = @buffer_start_position +
|
179
|
-
__0e = @buffer_start_position +
|
180
|
-
__0sl = @buffer_start_position_loc +
|
181
|
-
__0el = @buffer_start_position_loc +
|
404
|
+
def action_directive_include_6(__packcr_in, __packcr_vars, __packcr_index)
|
405
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
406
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
407
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
408
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
409
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
410
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
411
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
182
412
|
blocks.each { |b| @ctx.code(:init) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
183
413
|
|
184
|
-
|
414
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
185
415
|
end
|
186
416
|
|
187
|
-
def action_directive_include_7(
|
188
|
-
____ = (
|
189
|
-
blocks = (
|
190
|
-
__0 =
|
191
|
-
__0s = @buffer_start_position +
|
192
|
-
__0e = @buffer_start_position +
|
193
|
-
__0sl = @buffer_start_position_loc +
|
194
|
-
__0el = @buffer_start_position_loc +
|
417
|
+
def action_directive_include_7(__packcr_in, __packcr_vars, __packcr_index)
|
418
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
419
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
420
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
421
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
422
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
423
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
424
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
195
425
|
blocks.each { |b| Packcr::BroadCast.new(@ctx.code(:eheader), @ctx.code(:esource)) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
196
426
|
|
197
|
-
|
427
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
198
428
|
end
|
199
429
|
|
200
|
-
def action_directive_include_8(
|
201
|
-
____ = (
|
202
|
-
blocks = (
|
203
|
-
__0 =
|
204
|
-
__0s = @buffer_start_position +
|
205
|
-
__0e = @buffer_start_position +
|
206
|
-
__0sl = @buffer_start_position_loc +
|
207
|
-
__0el = @buffer_start_position_loc +
|
430
|
+
def action_directive_include_8(__packcr_in, __packcr_vars, __packcr_index)
|
431
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
432
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
433
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
434
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
435
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
436
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
437
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
208
438
|
blocks.each { |b| Packcr::BroadCast.new(@ctx.code(:header), @ctx.code(:source)) << Packcr::CodeBlock.new(b, __0sl.linenum, __0sl.charnum) }
|
209
439
|
|
210
|
-
|
440
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
211
441
|
end
|
212
442
|
|
213
|
-
def action_directive_include_9(
|
214
|
-
____ = (
|
215
|
-
blocks = (
|
216
|
-
__0 =
|
217
|
-
__0s = @buffer_start_position +
|
218
|
-
__0e = @buffer_start_position +
|
219
|
-
__0sl = @buffer_start_position_loc +
|
220
|
-
__0el = @buffer_start_position_loc +
|
221
|
-
__1 =
|
222
|
-
__1s = @buffer_start_position +
|
223
|
-
__1e = @buffer_start_position +
|
224
|
-
__1sl = @buffer_start_position_loc +
|
225
|
-
__1el = @buffer_start_position_loc +
|
443
|
+
def action_directive_include_9(__packcr_in, __packcr_vars, __packcr_index)
|
444
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
445
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
446
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
447
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
448
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
449
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
450
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
451
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
452
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
453
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
454
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
455
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
226
456
|
blocks.each { @ctx.error __0sl.linenum + 1, __0sl.charnum + 1, "Invalid directive: #{__1}" }
|
227
457
|
|
228
|
-
|
458
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
229
459
|
end
|
230
460
|
|
231
|
-
def action_code_blocks_0(
|
232
|
-
____ = (
|
233
|
-
blocks = (
|
234
|
-
block = (
|
235
|
-
__0 =
|
236
|
-
__0s = @buffer_start_position +
|
237
|
-
__0e = @buffer_start_position +
|
238
|
-
__0sl = @buffer_start_position_loc +
|
239
|
-
__0el = @buffer_start_position_loc +
|
461
|
+
def action_code_blocks_0(__packcr_in, __packcr_vars, __packcr_index)
|
462
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
463
|
+
blocks = (__packcr_in.value_refs[0] ||= Value.new).value
|
464
|
+
block = (__packcr_in.value_refs[1] ||= Value.new).value
|
465
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
466
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
467
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
468
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
469
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
240
470
|
blocks.push(block) if block; ____ = blocks
|
241
471
|
|
242
|
-
|
472
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
243
473
|
end
|
244
474
|
|
245
|
-
def action_code_blocks_1(
|
246
|
-
____ = (
|
247
|
-
block = (
|
248
|
-
__0 =
|
249
|
-
__0s = @buffer_start_position +
|
250
|
-
__0e = @buffer_start_position +
|
251
|
-
__0sl = @buffer_start_position_loc +
|
252
|
-
__0el = @buffer_start_position_loc +
|
475
|
+
def action_code_blocks_1(__packcr_in, __packcr_vars, __packcr_index)
|
476
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
477
|
+
block = (__packcr_in.value_refs[1] ||= Value.new).value
|
478
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
479
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
480
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
481
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
482
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
253
483
|
____ = block ? [block] : []
|
254
484
|
|
255
|
-
|
485
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
256
486
|
end
|
257
487
|
|
258
|
-
def action_directive_string_0(
|
259
|
-
____ = (
|
260
|
-
strings = (
|
261
|
-
__0 =
|
262
|
-
__0s = @buffer_start_position +
|
263
|
-
__0e = @buffer_start_position +
|
264
|
-
__0sl = @buffer_start_position_loc +
|
265
|
-
__0el = @buffer_start_position_loc +
|
488
|
+
def action_directive_string_0(__packcr_in, __packcr_vars, __packcr_index)
|
489
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
490
|
+
strings = (__packcr_in.value_refs[0] ||= Value.new).value
|
491
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
492
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
493
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
494
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
495
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
266
496
|
strings.each { |str| @ctx.value_type = str }
|
267
497
|
|
268
|
-
|
498
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
269
499
|
end
|
270
500
|
|
271
|
-
def action_directive_string_1(
|
272
|
-
____ = (
|
273
|
-
strings = (
|
274
|
-
__0 =
|
275
|
-
__0s = @buffer_start_position +
|
276
|
-
__0e = @buffer_start_position +
|
277
|
-
__0sl = @buffer_start_position_loc +
|
278
|
-
__0el = @buffer_start_position_loc +
|
501
|
+
def action_directive_string_1(__packcr_in, __packcr_vars, __packcr_index)
|
502
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
503
|
+
strings = (__packcr_in.value_refs[0] ||= Value.new).value
|
504
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
505
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
506
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
507
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
508
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
279
509
|
strings.each { |str| @ctx.auxil_type = str }
|
280
510
|
|
281
|
-
|
511
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
282
512
|
end
|
283
513
|
|
284
|
-
def action_directive_string_2(
|
285
|
-
____ = (
|
286
|
-
strings = (
|
287
|
-
__0 =
|
288
|
-
__0s = @buffer_start_position +
|
289
|
-
__0e = @buffer_start_position +
|
290
|
-
__0sl = @buffer_start_position_loc +
|
291
|
-
__0el = @buffer_start_position_loc +
|
514
|
+
def action_directive_string_2(__packcr_in, __packcr_vars, __packcr_index)
|
515
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
516
|
+
strings = (__packcr_in.value_refs[0] ||= Value.new).value
|
517
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
518
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
519
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
520
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
521
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
292
522
|
strings.each { |str| @ctx.prefix = str }
|
293
523
|
|
294
|
-
|
524
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
295
525
|
end
|
296
526
|
|
297
|
-
def action_directive_string_3(
|
298
|
-
____ = (
|
299
|
-
str = (
|
300
|
-
__0 =
|
301
|
-
__0s = @buffer_start_position +
|
302
|
-
__0e = @buffer_start_position +
|
303
|
-
__0sl = @buffer_start_position_loc +
|
304
|
-
__0el = @buffer_start_position_loc +
|
305
|
-
__1 =
|
306
|
-
__1s = @buffer_start_position +
|
307
|
-
__1e = @buffer_start_position +
|
308
|
-
__1sl = @buffer_start_position_loc +
|
309
|
-
__1el = @buffer_start_position_loc +
|
527
|
+
def action_directive_string_3(__packcr_in, __packcr_vars, __packcr_index)
|
528
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
529
|
+
str = (__packcr_in.value_refs[1] ||= Value.new).value
|
530
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
531
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
532
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
533
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
534
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
535
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
536
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
537
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
538
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
539
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
310
540
|
@ctx.error __0sl.linenum + 1, __0sl.charnum + 1, "Invalid directive: #{__1}"
|
311
541
|
|
312
|
-
|
542
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
313
543
|
end
|
314
544
|
|
315
|
-
def action_directive_value_0(
|
316
|
-
____ = (
|
317
|
-
__0 =
|
318
|
-
__0s = @buffer_start_position +
|
319
|
-
__0e = @buffer_start_position +
|
320
|
-
__0sl = @buffer_start_position_loc +
|
321
|
-
__0el = @buffer_start_position_loc +
|
545
|
+
def action_directive_value_0(__packcr_in, __packcr_vars, __packcr_index)
|
546
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
547
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
548
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
549
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
550
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
551
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
322
552
|
@ctx.capture_in_code = true
|
323
553
|
|
324
|
-
|
554
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
555
|
+
end
|
556
|
+
|
557
|
+
def action_directive_comment_0(__packcr_in, __packcr_vars, __packcr_index)
|
558
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
559
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
560
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
561
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
562
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
563
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
564
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
565
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
566
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
567
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
568
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
569
|
+
Packcr::BroadCast.new(@ctx.code(:eheader), @ctx.code(:esource)) << Packcr::CodeBlock.new(@ctx.line_comment_code(__1), __0sl.linenum, __0sl.charnum)
|
570
|
+
|
571
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
325
572
|
end
|
326
573
|
|
327
|
-
def action_lang_strings_0(
|
328
|
-
____ = (
|
329
|
-
strings = (
|
330
|
-
string = (
|
331
|
-
__0 =
|
332
|
-
__0s = @buffer_start_position +
|
333
|
-
__0e = @buffer_start_position +
|
334
|
-
__0sl = @buffer_start_position_loc +
|
335
|
-
__0el = @buffer_start_position_loc +
|
574
|
+
def action_lang_strings_0(__packcr_in, __packcr_vars, __packcr_index)
|
575
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
576
|
+
strings = (__packcr_in.value_refs[0] ||= Value.new).value
|
577
|
+
string = (__packcr_in.value_refs[1] ||= Value.new).value
|
578
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
579
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
580
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
581
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
582
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
336
583
|
strings.push(string) if string; ____ = strings
|
337
584
|
|
338
|
-
|
585
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
339
586
|
end
|
340
587
|
|
341
|
-
def action_lang_strings_1(
|
342
|
-
____ = (
|
343
|
-
string = (
|
344
|
-
__0 =
|
345
|
-
__0s = @buffer_start_position +
|
346
|
-
__0e = @buffer_start_position +
|
347
|
-
__0sl = @buffer_start_position_loc +
|
348
|
-
__0el = @buffer_start_position_loc +
|
588
|
+
def action_lang_strings_1(__packcr_in, __packcr_vars, __packcr_index)
|
589
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
590
|
+
string = (__packcr_in.value_refs[1] ||= Value.new).value
|
591
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
592
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
593
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
594
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
595
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
349
596
|
____ = string ? [string] : []
|
350
597
|
|
351
|
-
|
598
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
352
599
|
end
|
353
600
|
|
354
|
-
def action_lang_string_0(
|
355
|
-
____ = (
|
356
|
-
string = (
|
357
|
-
__0 =
|
358
|
-
__0s = @buffer_start_position +
|
359
|
-
__0e = @buffer_start_position +
|
360
|
-
__0sl = @buffer_start_position_loc +
|
361
|
-
__0el = @buffer_start_position_loc +
|
601
|
+
def action_lang_string_0(__packcr_in, __packcr_vars, __packcr_index)
|
602
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
603
|
+
string = (__packcr_in.value_refs[0] ||= Value.new).value
|
604
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
605
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
606
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
607
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
608
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
362
609
|
____ = string
|
363
610
|
|
364
|
-
|
611
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
365
612
|
end
|
366
613
|
|
367
|
-
def action_lang_string_1(
|
368
|
-
____ = (
|
369
|
-
string = (
|
370
|
-
__0 =
|
371
|
-
__0s = @buffer_start_position +
|
372
|
-
__0e = @buffer_start_position +
|
373
|
-
__0sl = @buffer_start_position_loc +
|
374
|
-
__0el = @buffer_start_position_loc +
|
375
|
-
__1 =
|
376
|
-
__1s = @buffer_start_position +
|
377
|
-
__1e = @buffer_start_position +
|
378
|
-
__1sl = @buffer_start_position_loc +
|
379
|
-
__1el = @buffer_start_position_loc +
|
614
|
+
def action_lang_string_1(__packcr_in, __packcr_vars, __packcr_index)
|
615
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
616
|
+
string = (__packcr_in.value_refs[0] ||= Value.new).value
|
617
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
618
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
619
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
620
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
621
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
622
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
623
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
624
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
625
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
626
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
380
627
|
____ = @ctx.lang == __1.to_sym ? string : nil
|
381
628
|
|
382
|
-
|
629
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
383
630
|
end
|
384
631
|
|
385
|
-
def action_rule_0(
|
386
|
-
____ = (
|
387
|
-
name = (
|
388
|
-
expr = (
|
389
|
-
__0 =
|
390
|
-
__0s = @buffer_start_position +
|
391
|
-
__0e = @buffer_start_position +
|
392
|
-
__0sl = @buffer_start_position_loc +
|
393
|
-
__0el = @buffer_start_position_loc +
|
632
|
+
def action_rule_0(__packcr_in, __packcr_vars, __packcr_index)
|
633
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
634
|
+
name = (__packcr_in.value_refs[0] ||= Value.new).value
|
635
|
+
expr = (__packcr_in.value_refs[1] ||= Value.new).value
|
636
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
637
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
638
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
639
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
640
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
394
641
|
return unless expr
|
395
642
|
|
396
643
|
rule = Packcr::Node::RuleNode.new(expr, name, __0sl.linenum, __0sl.charnum)
|
397
644
|
@ctx.root.rules << rule
|
398
645
|
|
399
|
-
|
646
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
400
647
|
end
|
401
648
|
|
402
|
-
def action_expression_0(
|
403
|
-
____ = (
|
404
|
-
expr = (
|
405
|
-
seq = (
|
406
|
-
__0 =
|
407
|
-
__0s = @buffer_start_position +
|
408
|
-
__0e = @buffer_start_position +
|
409
|
-
__0sl = @buffer_start_position_loc +
|
410
|
-
__0el = @buffer_start_position_loc +
|
649
|
+
def action_expression_0(__packcr_in, __packcr_vars, __packcr_index)
|
650
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
651
|
+
expr = (__packcr_in.value_refs[0] ||= Value.new).value
|
652
|
+
seq = (__packcr_in.value_refs[1] ||= Value.new).value
|
653
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
654
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
655
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
656
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
657
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
411
658
|
____ = expr.alt(seq)
|
412
659
|
|
413
|
-
|
660
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
414
661
|
end
|
415
662
|
|
416
|
-
def action_expression_1(
|
417
|
-
____ = (
|
418
|
-
seq = (
|
419
|
-
__0 =
|
420
|
-
__0s = @buffer_start_position +
|
421
|
-
__0e = @buffer_start_position +
|
422
|
-
__0sl = @buffer_start_position_loc +
|
423
|
-
__0el = @buffer_start_position_loc +
|
663
|
+
def action_expression_1(__packcr_in, __packcr_vars, __packcr_index)
|
664
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
665
|
+
seq = (__packcr_in.value_refs[1] ||= Value.new).value
|
666
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
667
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
668
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
669
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
670
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
424
671
|
____ = seq
|
425
672
|
|
426
|
-
|
673
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
427
674
|
end
|
428
675
|
|
429
|
-
def action_sequence_0(
|
430
|
-
____ = (
|
431
|
-
seq = (
|
432
|
-
expr = (
|
433
|
-
__0 =
|
434
|
-
__0s = @buffer_start_position +
|
435
|
-
__0e = @buffer_start_position +
|
436
|
-
__0sl = @buffer_start_position_loc +
|
437
|
-
__0el = @buffer_start_position_loc +
|
676
|
+
def action_sequence_0(__packcr_in, __packcr_vars, __packcr_index)
|
677
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
678
|
+
seq = (__packcr_in.value_refs[0] ||= Value.new).value
|
679
|
+
expr = (__packcr_in.value_refs[1] ||= Value.new).value
|
680
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
681
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
682
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
683
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
684
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
438
685
|
____ = seq.seq(expr, cut: true)
|
439
686
|
|
440
|
-
|
687
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
441
688
|
end
|
442
689
|
|
443
|
-
def action_sequence_1(
|
444
|
-
____ = (
|
445
|
-
seq = (
|
446
|
-
code = (
|
447
|
-
__0 =
|
448
|
-
__0s = @buffer_start_position +
|
449
|
-
__0e = @buffer_start_position +
|
450
|
-
__0sl = @buffer_start_position_loc +
|
451
|
-
__0el = @buffer_start_position_loc +
|
690
|
+
def action_sequence_1(__packcr_in, __packcr_vars, __packcr_index)
|
691
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
692
|
+
seq = (__packcr_in.value_refs[0] ||= Value.new).value
|
693
|
+
code = (__packcr_in.value_refs[2] ||= Value.new).value
|
694
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
695
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
696
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
697
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
698
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
452
699
|
____ = code ? Packcr::Node::ErrorNode.new(seq, Packcr::CodeBlock.new(code, __0sl.linenum, __0sl.charnum)) : seq
|
453
700
|
|
454
|
-
|
701
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
455
702
|
end
|
456
703
|
|
457
|
-
def action_sequence_2(
|
458
|
-
____ = (
|
459
|
-
seq = (
|
460
|
-
expr = (
|
461
|
-
__0 =
|
462
|
-
__0s = @buffer_start_position +
|
463
|
-
__0e = @buffer_start_position +
|
464
|
-
__0sl = @buffer_start_position_loc +
|
465
|
-
__0el = @buffer_start_position_loc +
|
466
|
-
____ = seq
|
467
|
-
|
468
|
-
|
704
|
+
def action_sequence_2(__packcr_in, __packcr_vars, __packcr_index)
|
705
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
706
|
+
seq = (__packcr_in.value_refs[0] ||= Value.new).value
|
707
|
+
expr = (__packcr_in.value_refs[1] ||= Value.new).value
|
708
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
709
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
710
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
711
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
712
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
713
|
+
____ = seq&.seq(expr) || expr
|
714
|
+
|
715
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
469
716
|
end
|
470
717
|
|
471
|
-
def action_sequence_3(
|
472
|
-
____ = (
|
473
|
-
expr = (
|
474
|
-
__0 =
|
475
|
-
__0s = @buffer_start_position +
|
476
|
-
__0e = @buffer_start_position +
|
477
|
-
__0sl = @buffer_start_position_loc +
|
478
|
-
__0el = @buffer_start_position_loc +
|
718
|
+
def action_sequence_3(__packcr_in, __packcr_vars, __packcr_index)
|
719
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
720
|
+
expr = (__packcr_in.value_refs[1] ||= Value.new).value
|
721
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
722
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
723
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
724
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
725
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
479
726
|
____ = expr
|
480
727
|
|
481
|
-
|
728
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
482
729
|
end
|
483
730
|
|
484
|
-
def action_term_0(
|
485
|
-
____ = (
|
486
|
-
node = (
|
487
|
-
__0 =
|
488
|
-
__0s = @buffer_start_position +
|
489
|
-
__0e = @buffer_start_position +
|
490
|
-
__0sl = @buffer_start_position_loc +
|
491
|
-
__0el = @buffer_start_position_loc +
|
731
|
+
def action_term_0(__packcr_in, __packcr_vars, __packcr_index)
|
732
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
733
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
734
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
735
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
736
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
737
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
738
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
492
739
|
____ = Packcr::Node::PredicateNode.new(node)
|
493
740
|
|
494
|
-
|
741
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
495
742
|
end
|
496
743
|
|
497
|
-
def action_term_1(
|
498
|
-
____ = (
|
499
|
-
node = (
|
500
|
-
__0 =
|
501
|
-
__0s = @buffer_start_position +
|
502
|
-
__0e = @buffer_start_position +
|
503
|
-
__0sl = @buffer_start_position_loc +
|
504
|
-
__0el = @buffer_start_position_loc +
|
744
|
+
def action_term_1(__packcr_in, __packcr_vars, __packcr_index)
|
745
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
746
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
747
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
748
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
749
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
750
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
751
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
505
752
|
____ = Packcr::Node::PredicateNode.new(node, true)
|
506
753
|
|
507
|
-
|
754
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
508
755
|
end
|
509
756
|
|
510
|
-
def action_term_2(
|
511
|
-
____ = (
|
512
|
-
node = (
|
513
|
-
__0 =
|
514
|
-
__0s = @buffer_start_position +
|
515
|
-
__0e = @buffer_start_position +
|
516
|
-
__0sl = @buffer_start_position_loc +
|
517
|
-
__0el = @buffer_start_position_loc +
|
757
|
+
def action_term_2(__packcr_in, __packcr_vars, __packcr_index)
|
758
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
759
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
760
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
761
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
762
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
763
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
764
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
518
765
|
____ = node
|
519
766
|
|
520
|
-
|
767
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
521
768
|
end
|
522
769
|
|
523
|
-
def action_quantity_0(
|
524
|
-
____ = (
|
525
|
-
node = (
|
526
|
-
__0 =
|
527
|
-
__0s = @buffer_start_position +
|
528
|
-
__0e = @buffer_start_position +
|
529
|
-
__0sl = @buffer_start_position_loc +
|
530
|
-
__0el = @buffer_start_position_loc +
|
770
|
+
def action_quantity_0(__packcr_in, __packcr_vars, __packcr_index)
|
771
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
772
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
773
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
774
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
775
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
776
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
777
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
531
778
|
____ = Packcr::Node::QuantityNode.new(node, 0, -1)
|
532
779
|
|
533
|
-
|
780
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
534
781
|
end
|
535
782
|
|
536
|
-
def action_quantity_1(
|
537
|
-
____ = (
|
538
|
-
node = (
|
539
|
-
__0 =
|
540
|
-
__0s = @buffer_start_position +
|
541
|
-
__0e = @buffer_start_position +
|
542
|
-
__0sl = @buffer_start_position_loc +
|
543
|
-
__0el = @buffer_start_position_loc +
|
783
|
+
def action_quantity_1(__packcr_in, __packcr_vars, __packcr_index)
|
784
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
785
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
786
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
787
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
788
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
789
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
790
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
544
791
|
____ = Packcr::Node::QuantityNode.new(node, 1, -1)
|
545
792
|
|
546
|
-
|
793
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
547
794
|
end
|
548
795
|
|
549
|
-
def action_quantity_2(
|
550
|
-
____ = (
|
551
|
-
node = (
|
552
|
-
__0 =
|
553
|
-
__0s = @buffer_start_position +
|
554
|
-
__0e = @buffer_start_position +
|
555
|
-
__0sl = @buffer_start_position_loc +
|
556
|
-
__0el = @buffer_start_position_loc +
|
796
|
+
def action_quantity_2(__packcr_in, __packcr_vars, __packcr_index)
|
797
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
798
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
799
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
800
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
801
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
802
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
803
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
557
804
|
____ = Packcr::Node::QuantityNode.new(node, 0, 1)
|
558
805
|
|
559
|
-
|
806
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
560
807
|
end
|
561
808
|
|
562
|
-
def action_quantity_3(
|
563
|
-
____ = (
|
564
|
-
node = (
|
565
|
-
__0 =
|
566
|
-
__0s = @buffer_start_position +
|
567
|
-
__0e = @buffer_start_position +
|
568
|
-
__0sl = @buffer_start_position_loc +
|
569
|
-
__0el = @buffer_start_position_loc +
|
809
|
+
def action_quantity_3(__packcr_in, __packcr_vars, __packcr_index)
|
810
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
811
|
+
node = (__packcr_in.value_refs[0] ||= Value.new).value
|
812
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
813
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
814
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
815
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
816
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
570
817
|
____ = node
|
571
818
|
|
572
|
-
|
819
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
573
820
|
end
|
574
821
|
|
575
|
-
def action_primary_0(
|
576
|
-
____ = (
|
577
|
-
code = (
|
578
|
-
__0 =
|
579
|
-
__0s = @buffer_start_position +
|
580
|
-
__0e = @buffer_start_position +
|
581
|
-
__0sl = @buffer_start_position_loc +
|
582
|
-
__0el = @buffer_start_position_loc +
|
822
|
+
def action_primary_0(__packcr_in, __packcr_vars, __packcr_index)
|
823
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
824
|
+
code = (__packcr_in.value_refs[0] ||= Value.new).value
|
825
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
826
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
827
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
828
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
829
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
583
830
|
____ = code && Packcr::Node::ActionNode.new(Packcr::CodeBlock.new(code, __0sl.linenum, __0sl.charnum))
|
584
831
|
|
585
|
-
|
832
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
586
833
|
end
|
587
834
|
|
588
|
-
def action_primary_1(
|
589
|
-
____ = (
|
590
|
-
var_name = (
|
591
|
-
name = (
|
592
|
-
__0 =
|
593
|
-
__0s = @buffer_start_position +
|
594
|
-
__0e = @buffer_start_position +
|
595
|
-
__0sl = @buffer_start_position_loc +
|
596
|
-
__0el = @buffer_start_position_loc +
|
835
|
+
def action_primary_1(__packcr_in, __packcr_vars, __packcr_index)
|
836
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
837
|
+
var_name = (__packcr_in.value_refs[1] ||= Value.new).value
|
838
|
+
name = (__packcr_in.value_refs[2] ||= Value.new).value
|
839
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
840
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
841
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
842
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
843
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
597
844
|
____ = Packcr::Node::ReferenceNode.new(name, var_name, __0sl.linenum, __0sl.charnum)
|
598
845
|
|
599
|
-
|
846
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
600
847
|
end
|
601
848
|
|
602
|
-
def action_primary_2(
|
603
|
-
____ = (
|
604
|
-
name = (
|
605
|
-
__0 =
|
606
|
-
__0s = @buffer_start_position +
|
607
|
-
__0e = @buffer_start_position +
|
608
|
-
__0sl = @buffer_start_position_loc +
|
609
|
-
__0el = @buffer_start_position_loc +
|
849
|
+
def action_primary_2(__packcr_in, __packcr_vars, __packcr_index)
|
850
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
851
|
+
name = (__packcr_in.value_refs[2] ||= Value.new).value
|
852
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
853
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
854
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
855
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
856
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
610
857
|
ref = Packcr::Node::ReferenceNode.new(name, "_out", __0sl.linenum, __0sl.charnum)
|
611
858
|
code = @ctx.pass_value_code("_out")
|
612
859
|
act = Packcr::Node::ActionNode.new(Packcr::CodeBlock.new(code, __0sl.linenum, __0sl.charnum))
|
613
860
|
____ = ref.seq(act)
|
614
861
|
|
615
|
-
|
862
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
616
863
|
end
|
617
864
|
|
618
|
-
def action_primary_3(
|
619
|
-
____ = (
|
620
|
-
name = (
|
621
|
-
__0 =
|
622
|
-
__0s = @buffer_start_position +
|
623
|
-
__0e = @buffer_start_position +
|
624
|
-
__0sl = @buffer_start_position_loc +
|
625
|
-
__0el = @buffer_start_position_loc +
|
865
|
+
def action_primary_3(__packcr_in, __packcr_vars, __packcr_index)
|
866
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
867
|
+
name = (__packcr_in.value_refs[2] ||= Value.new).value
|
868
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
869
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
870
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
871
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
872
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
626
873
|
____ = Packcr::Node::ReferenceNode.new(name, nil, __0sl.linenum, __0sl.charnum)
|
627
874
|
|
628
|
-
|
875
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
629
876
|
end
|
630
877
|
|
631
|
-
def action_primary_4(
|
632
|
-
____ = (
|
633
|
-
expr = (
|
634
|
-
__0 =
|
635
|
-
__0s = @buffer_start_position +
|
636
|
-
__0e = @buffer_start_position +
|
637
|
-
__0sl = @buffer_start_position_loc +
|
638
|
-
__0el = @buffer_start_position_loc +
|
878
|
+
def action_primary_4(__packcr_in, __packcr_vars, __packcr_index)
|
879
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
880
|
+
expr = (__packcr_in.value_refs[3] ||= Value.new).value
|
881
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
882
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
883
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
884
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
885
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
639
886
|
____ = expr
|
640
887
|
|
641
|
-
|
888
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
642
889
|
end
|
643
890
|
|
644
|
-
def action_primary_5(
|
645
|
-
____ = (
|
646
|
-
expr = (
|
647
|
-
__0 =
|
648
|
-
__0s = @buffer_start_position +
|
649
|
-
__0e = @buffer_start_position +
|
650
|
-
__0sl = @buffer_start_position_loc +
|
651
|
-
__0el = @buffer_start_position_loc +
|
891
|
+
def action_primary_5(__packcr_in, __packcr_vars, __packcr_index)
|
892
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
893
|
+
expr = (__packcr_in.value_refs[3] ||= Value.new).value
|
894
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
895
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
896
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
897
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
898
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
652
899
|
____ = Packcr::Node::CaptureNode.new(expr)
|
653
900
|
|
654
|
-
|
901
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
655
902
|
end
|
656
903
|
|
657
|
-
def action_primary_6(
|
658
|
-
____ = (
|
659
|
-
__0 =
|
660
|
-
__0s = @buffer_start_position +
|
661
|
-
__0e = @buffer_start_position +
|
662
|
-
__0sl = @buffer_start_position_loc +
|
663
|
-
__0el = @buffer_start_position_loc +
|
664
|
-
__1 =
|
665
|
-
__1s = @buffer_start_position +
|
666
|
-
__1e = @buffer_start_position +
|
667
|
-
__1sl = @buffer_start_position_loc +
|
668
|
-
__1el = @buffer_start_position_loc +
|
904
|
+
def action_primary_6(__packcr_in, __packcr_vars, __packcr_index)
|
905
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
906
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
907
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
908
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
909
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
910
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
911
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
912
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
913
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
914
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
915
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
669
916
|
____ = Packcr::Node::ExpandNode.new(__1.to_i - 1, __0sl.linenum, __0sl.charnum)
|
670
917
|
|
671
|
-
|
918
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
672
919
|
end
|
673
920
|
|
674
|
-
def action_primary_7(
|
675
|
-
____ = (
|
676
|
-
__0 =
|
677
|
-
__0s = @buffer_start_position +
|
678
|
-
__0e = @buffer_start_position +
|
679
|
-
__0sl = @buffer_start_position_loc +
|
680
|
-
__0el = @buffer_start_position_loc +
|
921
|
+
def action_primary_7(__packcr_in, __packcr_vars, __packcr_index)
|
922
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
923
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
924
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
925
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
926
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
927
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
681
928
|
____ = Packcr::Node::CharclassNode.new
|
682
929
|
|
683
|
-
|
930
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
684
931
|
end
|
685
932
|
|
686
|
-
def action_primary_8(
|
687
|
-
____ = (
|
688
|
-
str = (
|
689
|
-
__0 =
|
690
|
-
__0s = @buffer_start_position +
|
691
|
-
__0e = @buffer_start_position +
|
692
|
-
__0sl = @buffer_start_position_loc +
|
693
|
-
__0el = @buffer_start_position_loc +
|
933
|
+
def action_primary_8(__packcr_in, __packcr_vars, __packcr_index)
|
934
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
935
|
+
str = (__packcr_in.value_refs[4] ||= Value.new).value
|
936
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
937
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
938
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
939
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
940
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
694
941
|
____ = Packcr::Node::CharclassNode.new(Packcr.unescape_string(str, true))
|
695
942
|
|
696
|
-
|
943
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
697
944
|
end
|
698
945
|
|
699
|
-
def action_primary_9(
|
700
|
-
____ = (
|
701
|
-
str = (
|
702
|
-
__0 =
|
703
|
-
__0s = @buffer_start_position +
|
704
|
-
__0e = @buffer_start_position +
|
705
|
-
__0sl = @buffer_start_position_loc +
|
706
|
-
__0el = @buffer_start_position_loc +
|
946
|
+
def action_primary_9(__packcr_in, __packcr_vars, __packcr_index)
|
947
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
948
|
+
str = (__packcr_in.value_refs[4] ||= Value.new).value
|
949
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
950
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
951
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
952
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
953
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
707
954
|
____ = Packcr::Node::StringNode.new(Packcr.unescape_string(str, false))
|
708
955
|
|
709
|
-
|
956
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
710
957
|
end
|
711
958
|
|
712
|
-
def action_primary_10(
|
713
|
-
____ = (
|
714
|
-
str = (
|
715
|
-
__0 =
|
716
|
-
__0s = @buffer_start_position +
|
717
|
-
__0e = @buffer_start_position +
|
718
|
-
__0sl = @buffer_start_position_loc +
|
719
|
-
__0el = @buffer_start_position_loc +
|
959
|
+
def action_primary_10(__packcr_in, __packcr_vars, __packcr_index)
|
960
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
961
|
+
str = (__packcr_in.value_refs[4] ||= Value.new).value
|
962
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
963
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
964
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
965
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
966
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
720
967
|
____ = Packcr::Node::StringNode.new(Packcr.unescape_string(str, false))
|
721
968
|
|
722
|
-
|
969
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
723
970
|
end
|
724
971
|
|
725
|
-
def action_character_class_0(
|
726
|
-
____ = (
|
727
|
-
__0 =
|
728
|
-
__0s = @buffer_start_position +
|
729
|
-
__0e = @buffer_start_position +
|
730
|
-
__0sl = @buffer_start_position_loc +
|
731
|
-
__0el = @buffer_start_position_loc +
|
732
|
-
__1 =
|
733
|
-
__1s = @buffer_start_position +
|
734
|
-
__1e = @buffer_start_position +
|
735
|
-
__1sl = @buffer_start_position_loc +
|
736
|
-
__1el = @buffer_start_position_loc +
|
972
|
+
def action_character_class_0(__packcr_in, __packcr_vars, __packcr_index)
|
973
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
974
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
975
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
976
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
977
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
978
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
979
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
980
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
981
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
982
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
983
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
737
984
|
____ = __1
|
738
985
|
|
739
|
-
|
986
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
740
987
|
end
|
741
988
|
|
742
|
-
def action_lang_code_block_0(
|
743
|
-
____ = (
|
744
|
-
code = (
|
745
|
-
__0 =
|
746
|
-
__0s = @buffer_start_position +
|
747
|
-
__0e = @buffer_start_position +
|
748
|
-
__0sl = @buffer_start_position_loc +
|
749
|
-
__0el = @buffer_start_position_loc +
|
989
|
+
def action_lang_code_block_0(__packcr_in, __packcr_vars, __packcr_index)
|
990
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
991
|
+
code = (__packcr_in.value_refs[0] ||= Value.new).value
|
992
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
993
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
994
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
995
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
996
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
750
997
|
____ = code
|
751
998
|
|
752
|
-
|
999
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
753
1000
|
end
|
754
1001
|
|
755
|
-
def action_lang_code_block_1(
|
756
|
-
____ = (
|
757
|
-
code = (
|
758
|
-
__0 =
|
759
|
-
__0s = @buffer_start_position +
|
760
|
-
__0e = @buffer_start_position +
|
761
|
-
__0sl = @buffer_start_position_loc +
|
762
|
-
__0el = @buffer_start_position_loc +
|
763
|
-
__1 =
|
764
|
-
__1s = @buffer_start_position +
|
765
|
-
__1e = @buffer_start_position +
|
766
|
-
__1sl = @buffer_start_position_loc +
|
767
|
-
__1el = @buffer_start_position_loc +
|
1002
|
+
def action_lang_code_block_1(__packcr_in, __packcr_vars, __packcr_index)
|
1003
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1004
|
+
code = (__packcr_in.value_refs[0] ||= Value.new).value
|
1005
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1006
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1007
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1008
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1009
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
1010
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
1011
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
1012
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
1013
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
1014
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
768
1015
|
____ = @ctx.lang == __1.to_sym ? code : nil
|
769
1016
|
|
770
|
-
|
1017
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
771
1018
|
end
|
772
1019
|
|
773
|
-
def action_code_block_0(
|
774
|
-
____ = (
|
775
|
-
code = (
|
776
|
-
__0 =
|
777
|
-
__0s = @buffer_start_position +
|
778
|
-
__0e = @buffer_start_position +
|
779
|
-
__0sl = @buffer_start_position_loc +
|
780
|
-
__0el = @buffer_start_position_loc +
|
1020
|
+
def action_code_block_0(__packcr_in, __packcr_vars, __packcr_index)
|
1021
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1022
|
+
code = (__packcr_in.value_refs[0] ||= Value.new).value
|
1023
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1024
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1025
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1026
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1027
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
781
1028
|
____ = code
|
782
1029
|
|
783
|
-
|
1030
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
784
1031
|
end
|
785
1032
|
|
786
|
-
def action_code_block_1(
|
787
|
-
____ = (
|
788
|
-
code = (
|
789
|
-
__0 =
|
790
|
-
__0s = @buffer_start_position +
|
791
|
-
__0e = @buffer_start_position +
|
792
|
-
__0sl = @buffer_start_position_loc +
|
793
|
-
__0el = @buffer_start_position_loc +
|
794
|
-
____ =
|
795
|
-
|
796
|
-
|
1033
|
+
def action_code_block_1(__packcr_in, __packcr_vars, __packcr_index)
|
1034
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1035
|
+
code = (__packcr_in.value_refs[0] ||= Value.new).value
|
1036
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1037
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1038
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1039
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1040
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
1041
|
+
____ = Packcr.escape_varriables(code, @ctx.lang)
|
1042
|
+
|
1043
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
797
1044
|
end
|
798
1045
|
|
799
|
-
def action_plain_code_block_0(
|
800
|
-
____ = (
|
801
|
-
__0 =
|
802
|
-
__0s = @buffer_start_position +
|
803
|
-
__0e = @buffer_start_position +
|
804
|
-
__0sl = @buffer_start_position_loc +
|
805
|
-
__0el = @buffer_start_position_loc +
|
806
|
-
__1 =
|
807
|
-
__1s = @buffer_start_position +
|
808
|
-
__1e = @buffer_start_position +
|
809
|
-
__1sl = @buffer_start_position_loc +
|
810
|
-
__1el = @buffer_start_position_loc +
|
1046
|
+
def action_plain_code_block_0(__packcr_in, __packcr_vars, __packcr_index)
|
1047
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1048
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1049
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1050
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1051
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1052
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
1053
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
1054
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
1055
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
1056
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
1057
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
811
1058
|
____ = __1
|
812
1059
|
|
813
|
-
|
1060
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
814
1061
|
end
|
815
1062
|
|
816
|
-
def action_quotation_single_0(
|
817
|
-
____ = (
|
818
|
-
__0 =
|
819
|
-
__0s = @buffer_start_position +
|
820
|
-
__0e = @buffer_start_position +
|
821
|
-
__0sl = @buffer_start_position_loc +
|
822
|
-
__0el = @buffer_start_position_loc +
|
823
|
-
__1 =
|
824
|
-
__1s = @buffer_start_position +
|
825
|
-
__1e = @buffer_start_position +
|
826
|
-
__1sl = @buffer_start_position_loc +
|
827
|
-
__1el = @buffer_start_position_loc +
|
1063
|
+
def action_quotation_single_0(__packcr_in, __packcr_vars, __packcr_index)
|
1064
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1065
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1066
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1067
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1068
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1069
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
1070
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
1071
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
1072
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
1073
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
1074
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
828
1075
|
____ = __1
|
829
1076
|
|
830
|
-
|
1077
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
831
1078
|
end
|
832
1079
|
|
833
|
-
def action_quotation_double_0(
|
834
|
-
____ = (
|
835
|
-
__0 =
|
836
|
-
__0s = @buffer_start_position +
|
837
|
-
__0e = @buffer_start_position +
|
838
|
-
__0sl = @buffer_start_position_loc +
|
839
|
-
__0el = @buffer_start_position_loc +
|
840
|
-
__1 =
|
841
|
-
__1s = @buffer_start_position +
|
842
|
-
__1e = @buffer_start_position +
|
843
|
-
__1sl = @buffer_start_position_loc +
|
844
|
-
__1el = @buffer_start_position_loc +
|
1080
|
+
def action_quotation_double_0(__packcr_in, __packcr_vars, __packcr_index)
|
1081
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1082
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1083
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1084
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1085
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1086
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
1087
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
1088
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
1089
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
1090
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
1091
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
845
1092
|
____ = __1
|
846
1093
|
|
847
|
-
|
1094
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
848
1095
|
end
|
849
1096
|
|
850
|
-
def action_identifier_0(
|
851
|
-
____ = (
|
852
|
-
__0 =
|
853
|
-
__0s = @buffer_start_position +
|
854
|
-
__0e = @buffer_start_position +
|
855
|
-
__0sl = @buffer_start_position_loc +
|
856
|
-
__0el = @buffer_start_position_loc +
|
1097
|
+
def action_identifier_0(__packcr_in, __packcr_vars, __packcr_index)
|
1098
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1099
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1100
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1101
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1102
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1103
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
857
1104
|
____ = __0
|
858
1105
|
|
859
|
-
|
1106
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
860
1107
|
end
|
861
1108
|
|
862
|
-
def action_footer_0(
|
863
|
-
____ = (
|
864
|
-
__0 =
|
865
|
-
__0s = @buffer_start_position +
|
866
|
-
__0e = @buffer_start_position +
|
867
|
-
__0sl = @buffer_start_position_loc +
|
868
|
-
__0el = @buffer_start_position_loc +
|
869
|
-
__1 =
|
870
|
-
__1s = @buffer_start_position +
|
871
|
-
__1e = @buffer_start_position +
|
872
|
-
__1sl = @buffer_start_position_loc +
|
873
|
-
__1el = @buffer_start_position_loc +
|
1109
|
+
def action_footer_0(__packcr_in, __packcr_vars, __packcr_index)
|
1110
|
+
____ = (__packcr_vars[__packcr_index] ||= Value.new).value if __packcr_vars
|
1111
|
+
__0 = __packcr_in.capt0.capture_string(@buffer)
|
1112
|
+
__0s = @buffer_start_position + __packcr_in.capt0.range_start
|
1113
|
+
__0e = @buffer_start_position + __packcr_in.capt0.range_end
|
1114
|
+
__0sl = @buffer_start_position_loc + __packcr_in.capt0.start_loc
|
1115
|
+
__0el = @buffer_start_position_loc + __packcr_in.capt0.end_loc
|
1116
|
+
__1 = __packcr_in.capts[0].capture_string(@buffer)
|
1117
|
+
__1s = @buffer_start_position + __packcr_in.capts[0].range_start
|
1118
|
+
__1e = @buffer_start_position + __packcr_in.capts[0].range_end
|
1119
|
+
__1sl = @buffer_start_position_loc + __packcr_in.capts[0].start_loc
|
1120
|
+
__1el = @buffer_start_position_loc + __packcr_in.capts[0].end_loc
|
874
1121
|
@ctx.code(:lsource) << Packcr::CodeBlock.new(__1, __1sl.linenum, __1sl.charnum)
|
875
1122
|
|
876
|
-
|
1123
|
+
__packcr_vars[__packcr_index].value = ____ if __packcr_vars
|
877
1124
|
end
|
878
1125
|
|
879
1126
|
def evaluate_rule_statement(offset, offset_loc, limits: nil)
|
@@ -938,6 +1185,16 @@ class Packcr
|
|
938
1185
|
@position_offset = pos2
|
939
1186
|
@position_offset_loc = p_loc2
|
940
1187
|
answer.thunks[n2..-1] = []
|
1188
|
+
if limits && @position_offset == offset && !limits[:evaluate_rule_directive_comment]
|
1189
|
+
if apply_rule(:evaluate_rule_directive_comment, answer.thunks, nil, 0, offset, offset_loc, limits: limits)
|
1190
|
+
throw(1)
|
1191
|
+
end
|
1192
|
+
elsif apply_rule(:evaluate_rule_directive_comment, answer.thunks, nil, 0, offset, offset_loc)
|
1193
|
+
throw(1)
|
1194
|
+
end
|
1195
|
+
@position_offset = pos2
|
1196
|
+
@position_offset_loc = p_loc2
|
1197
|
+
answer.thunks[n2..-1] = []
|
941
1198
|
if limits && @position_offset == offset && !limits[:evaluate_rule_rule]
|
942
1199
|
if apply_rule(:evaluate_rule_rule, answer.thunks, nil, 0, offset, offset_loc, limits: limits)
|
943
1200
|
throw(1)
|
@@ -1042,12 +1299,25 @@ class Packcr
|
|
1042
1299
|
@position_offset_loc = p_loc2
|
1043
1300
|
answer.thunks[n2..-1] = []
|
1044
1301
|
catch(4) do
|
1302
|
+
if refill_buffer(2) < 2 ||
|
1303
|
+
@buffer[@position_offset, 2] != "rs"
|
1304
|
+
|
1305
|
+
throw(4)
|
1306
|
+
end
|
1307
|
+
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 2)
|
1308
|
+
@position_offset += 2
|
1309
|
+
throw(1)
|
1310
|
+
end
|
1311
|
+
@position_offset = pos2
|
1312
|
+
@position_offset_loc = p_loc2
|
1313
|
+
answer.thunks[n2..-1] = []
|
1314
|
+
catch(5) do
|
1045
1315
|
if limits && @position_offset == offset && !limits[:evaluate_rule_identifier]
|
1046
1316
|
if !apply_rule(:evaluate_rule_identifier, answer.thunks, nil, 0, offset, offset_loc, limits: limits)
|
1047
|
-
throw(
|
1317
|
+
throw(5)
|
1048
1318
|
end
|
1049
1319
|
elsif !apply_rule(:evaluate_rule_identifier, answer.thunks, nil, 0, offset, offset_loc)
|
1050
|
-
throw(
|
1320
|
+
throw(5)
|
1051
1321
|
end
|
1052
1322
|
answer.thunks.push(
|
1053
1323
|
ThunkLeaf.new(
|
@@ -1885,22 +2155,139 @@ class Packcr
|
|
1885
2155
|
|
1886
2156
|
throw(2)
|
1887
2157
|
end
|
1888
|
-
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 2)
|
1889
|
-
@position_offset += 2
|
1890
|
-
throw(1)
|
2158
|
+
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 2)
|
2159
|
+
@position_offset += 2
|
2160
|
+
throw(1)
|
2161
|
+
end
|
2162
|
+
@position_offset = pos3
|
2163
|
+
@position_offset_loc = p_loc3
|
2164
|
+
answer.thunks[n3..-1] = []
|
2165
|
+
catch(3) do
|
2166
|
+
if refill_buffer(4) < 4 ||
|
2167
|
+
@buffer[@position_offset, 4] != "true"
|
2168
|
+
|
2169
|
+
throw(3)
|
2170
|
+
end
|
2171
|
+
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 4)
|
2172
|
+
@position_offset += 4
|
2173
|
+
throw(1)
|
2174
|
+
end
|
2175
|
+
@position_offset = pos3
|
2176
|
+
@position_offset_loc = p_loc3
|
2177
|
+
answer.thunks[n3..-1] = []
|
2178
|
+
throw(0)
|
2179
|
+
end
|
2180
|
+
answer.thunks.push(
|
2181
|
+
ThunkLeaf.new(
|
2182
|
+
:action_directive_value_0,
|
2183
|
+
Capture.new(
|
2184
|
+
answer.pos, @position_offset,
|
2185
|
+
answer.pos_loc, @position_offset_loc,
|
2186
|
+
),
|
2187
|
+
{},
|
2188
|
+
{},
|
2189
|
+
),
|
2190
|
+
)
|
2191
|
+
@level -= 1
|
2192
|
+
debug { warn "#{" " * @level}MATCH directive_value #{answer.pos} #{@buffer[answer.pos...@position_offset].inspect}" }
|
2193
|
+
return answer
|
2194
|
+
end
|
2195
|
+
@level -= 1
|
2196
|
+
debug { warn "#{" " * @level}NOMATCH directive_value #{answer.pos} #{@buffer[answer.pos...@position_offset].inspect}" }
|
2197
|
+
nil
|
2198
|
+
end
|
2199
|
+
|
2200
|
+
def evaluate_rule_directive_comment(offset, offset_loc, limits: nil)
|
2201
|
+
answer = ThunkChunk.new
|
2202
|
+
answer.pos = @position_offset
|
2203
|
+
answer.pos_loc = @position_offset_loc
|
2204
|
+
debug { warn "#{" " * @level}EVAL directive_comment #{answer.pos} #{@buffer[answer.pos..-1].inspect}" }
|
2205
|
+
@level += 1
|
2206
|
+
answer.resize_captures(1)
|
2207
|
+
catch(0) do
|
2208
|
+
if refill_buffer(2) < 2 ||
|
2209
|
+
@buffer[@position_offset, 2] != "%#"
|
2210
|
+
|
2211
|
+
throw(0)
|
2212
|
+
end
|
2213
|
+
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 2)
|
2214
|
+
@position_offset += 2
|
2215
|
+
pos3 = @position_offset
|
2216
|
+
p_loc3 = @position_offset_loc
|
2217
|
+
n3 = answer.thunks.length
|
2218
|
+
catch(2) do
|
2219
|
+
catch(1) do
|
2220
|
+
if limits && @position_offset == offset && !limits[:evaluate_rule_spaces]
|
2221
|
+
if !apply_rule(:evaluate_rule_spaces, answer.thunks, nil, 0, offset, offset_loc, limits: limits)
|
2222
|
+
throw(1)
|
2223
|
+
end
|
2224
|
+
elsif !apply_rule(:evaluate_rule_spaces, answer.thunks, nil, 0, offset, offset_loc)
|
2225
|
+
throw(1)
|
2226
|
+
end
|
2227
|
+
throw(2)
|
2228
|
+
end
|
2229
|
+
@position_offset_loc = p_loc3
|
2230
|
+
@position_offset = pos3
|
2231
|
+
answer.thunks[n3..-1] = []
|
2232
|
+
end
|
2233
|
+
pos3 = @position_offset
|
2234
|
+
p_loc3 = @position_offset_loc
|
2235
|
+
i4 = 0
|
2236
|
+
pos4 = nil
|
2237
|
+
p_loc4 = nil
|
2238
|
+
n4 = nil
|
2239
|
+
catch(3) do
|
2240
|
+
pos4 = @position_offset
|
2241
|
+
p_loc4 = @position_offset_loc
|
2242
|
+
n4 = answer.thunks.length
|
2243
|
+
if refill_buffer(1) < 1
|
2244
|
+
throw(3)
|
2245
|
+
end
|
2246
|
+
u5 = @buffer[@position_offset]
|
2247
|
+
if u5 == "\n"
|
2248
|
+
|
2249
|
+
throw(3)
|
2250
|
+
end
|
2251
|
+
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 1)
|
2252
|
+
@position_offset += 1
|
2253
|
+
i4 += 1
|
2254
|
+
if @position_offset != pos4
|
2255
|
+
redo
|
2256
|
+
end
|
2257
|
+
pos4 = nil
|
2258
|
+
end
|
2259
|
+
if pos4
|
2260
|
+
@position_offset = pos4
|
2261
|
+
@position_offset_loc = p_loc4
|
2262
|
+
answer.thunks[n4..-1] = []
|
2263
|
+
end
|
2264
|
+
q3 = @position_offset
|
2265
|
+
capt3 = answer.capts[0]
|
2266
|
+
capt3.range_start = pos3
|
2267
|
+
capt3.range_end = q3
|
2268
|
+
q_loc3 = @position_offset_loc
|
2269
|
+
capt3.start_loc = p_loc3
|
2270
|
+
capt3.end_loc = q_loc3
|
2271
|
+
catch(4) do
|
2272
|
+
pos3 = @position_offset
|
2273
|
+
p_loc3 = @position_offset_loc
|
2274
|
+
n3 = answer.thunks.length
|
2275
|
+
if limits && @position_offset == offset && !limits[:evaluate_rule_lf]
|
2276
|
+
if apply_rule(:evaluate_rule_lf, answer.thunks, nil, 0, offset, offset_loc, limits: limits)
|
2277
|
+
throw(4)
|
2278
|
+
end
|
2279
|
+
elsif apply_rule(:evaluate_rule_lf, answer.thunks, nil, 0, offset, offset_loc)
|
2280
|
+
throw(4)
|
1891
2281
|
end
|
1892
2282
|
@position_offset = pos3
|
1893
2283
|
@position_offset_loc = p_loc3
|
1894
2284
|
answer.thunks[n3..-1] = []
|
1895
|
-
|
1896
|
-
if
|
1897
|
-
|
1898
|
-
|
1899
|
-
throw(3)
|
2285
|
+
if limits && @position_offset == offset && !limits[:evaluate_rule_EOF]
|
2286
|
+
if apply_rule(:evaluate_rule_EOF, answer.thunks, nil, 0, offset, offset_loc, limits: limits)
|
2287
|
+
throw(4)
|
1900
2288
|
end
|
1901
|
-
|
1902
|
-
|
1903
|
-
throw(1)
|
2289
|
+
elsif apply_rule(:evaluate_rule_EOF, answer.thunks, nil, 0, offset, offset_loc)
|
2290
|
+
throw(4)
|
1904
2291
|
end
|
1905
2292
|
@position_offset = pos3
|
1906
2293
|
@position_offset_loc = p_loc3
|
@@ -1909,21 +2296,21 @@ class Packcr
|
|
1909
2296
|
end
|
1910
2297
|
answer.thunks.push(
|
1911
2298
|
ThunkLeaf.new(
|
1912
|
-
:
|
2299
|
+
:action_directive_comment_0,
|
1913
2300
|
Capture.new(
|
1914
2301
|
answer.pos, @position_offset,
|
1915
2302
|
answer.pos_loc, @position_offset_loc,
|
1916
2303
|
),
|
1917
2304
|
{},
|
1918
|
-
|
2305
|
+
answer.capts.slice(0),
|
1919
2306
|
),
|
1920
2307
|
)
|
1921
2308
|
@level -= 1
|
1922
|
-
debug { warn "#{" " * @level}MATCH
|
2309
|
+
debug { warn "#{" " * @level}MATCH directive_comment #{answer.pos} #{@buffer[answer.pos...@position_offset].inspect}" }
|
1923
2310
|
return answer
|
1924
2311
|
end
|
1925
2312
|
@level -= 1
|
1926
|
-
debug { warn "#{" " * @level}NOMATCH
|
2313
|
+
debug { warn "#{" " * @level}NOMATCH directive_comment #{answer.pos} #{@buffer[answer.pos...@position_offset].inspect}" }
|
1927
2314
|
nil
|
1928
2315
|
end
|
1929
2316
|
|
@@ -2850,8 +3237,7 @@ class Packcr
|
|
2850
3237
|
throw(5)
|
2851
3238
|
end
|
2852
3239
|
u8 = @buffer[@position_offset]
|
2853
|
-
if !
|
2854
|
-
[" ", "\t", "\v", "\f", "\r", "\n"].include?(u8)
|
3240
|
+
if ![" ", "\t", "\v", "\f", "\r", "\n"].include?(u8)
|
2855
3241
|
|
2856
3242
|
throw(5)
|
2857
3243
|
end
|
@@ -2948,8 +3334,7 @@ class Packcr
|
|
2948
3334
|
throw(8)
|
2949
3335
|
end
|
2950
3336
|
u8 = @buffer[@position_offset]
|
2951
|
-
if !
|
2952
|
-
[" ", "\t", "\v", "\f", "\r", "\n"].include?(u8)
|
3337
|
+
if ![" ", "\t", "\v", "\f", "\r", "\n"].include?(u8)
|
2953
3338
|
|
2954
3339
|
throw(8)
|
2955
3340
|
end
|
@@ -3018,8 +3403,7 @@ class Packcr
|
|
3018
3403
|
throw(11)
|
3019
3404
|
end
|
3020
3405
|
u8 = @buffer[@position_offset]
|
3021
|
-
if !
|
3022
|
-
[" ", "\t", "\v", "\f", "\r", "\n"].include?(u8)
|
3406
|
+
if ![" ", "\t", "\v", "\f", "\r", "\n"].include?(u8)
|
3023
3407
|
|
3024
3408
|
throw(11)
|
3025
3409
|
end
|
@@ -3183,9 +3567,8 @@ class Packcr
|
|
3183
3567
|
throw(14)
|
3184
3568
|
end
|
3185
3569
|
u6 = @buffer[@position_offset]
|
3186
|
-
if !(
|
3187
|
-
|
3188
|
-
)
|
3570
|
+
if !u6.between?("1", "9")
|
3571
|
+
|
3189
3572
|
throw(14)
|
3190
3573
|
end
|
3191
3574
|
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 1)
|
@@ -3202,9 +3585,8 @@ class Packcr
|
|
3202
3585
|
throw(15)
|
3203
3586
|
end
|
3204
3587
|
u7 = @buffer[@position_offset]
|
3205
|
-
if !(
|
3206
|
-
|
3207
|
-
)
|
3588
|
+
if !u7.between?("0", "9")
|
3589
|
+
|
3208
3590
|
throw(15)
|
3209
3591
|
end
|
3210
3592
|
@position_offset_loc = @position_offset_loc.forward(@buffer, @position_offset, 1)
|
@@ -3694,8 +4076,7 @@ class Packcr
|
|
3694
4076
|
throw(1)
|
3695
4077
|
end
|
3696
4078
|
u6 = @buffer[@position_offset]
|
3697
|
-
if !
|
3698
|
-
[" ", "\t", "\v", "\f", "\r", "\n"].include?(u6)
|
4079
|
+
if ![" ", "\t", "\v", "\f", "\r", "\n"].include?(u6)
|
3699
4080
|
|
3700
4081
|
throw(1)
|
3701
4082
|
end
|
@@ -3787,8 +4168,7 @@ class Packcr
|
|
3787
4168
|
throw(2)
|
3788
4169
|
end
|
3789
4170
|
u5 = @buffer[@position_offset]
|
3790
|
-
if !
|
3791
|
-
[" ", "\t", "\v", "\f", "\r", "\n"].include?(u5)
|
4171
|
+
if ![" ", "\t", "\v", "\f", "\r", "\n"].include?(u5)
|
3792
4172
|
|
3793
4173
|
throw(2)
|
3794
4174
|
end
|
@@ -4325,8 +4705,8 @@ class Packcr
|
|
4325
4705
|
end
|
4326
4706
|
u3 = @buffer[@position_offset]
|
4327
4707
|
if !(
|
4328
|
-
(
|
4329
|
-
(
|
4708
|
+
u3.between?("a", "z") ||
|
4709
|
+
u3.between?("A", "Z") ||
|
4330
4710
|
u3 == "_"
|
4331
4711
|
)
|
4332
4712
|
throw(0)
|
@@ -4346,10 +4726,10 @@ class Packcr
|
|
4346
4726
|
end
|
4347
4727
|
u4 = @buffer[@position_offset]
|
4348
4728
|
if !(
|
4349
|
-
(
|
4350
|
-
(
|
4729
|
+
u4.between?("a", "z") ||
|
4730
|
+
u4.between?("A", "Z") ||
|
4351
4731
|
u4 == "_" ||
|
4352
|
-
(
|
4732
|
+
u4.between?("0", "9")
|
4353
4733
|
)
|
4354
4734
|
throw(1)
|
4355
4735
|
end
|
@@ -4409,8 +4789,7 @@ class Packcr
|
|
4409
4789
|
throw(1)
|
4410
4790
|
end
|
4411
4791
|
u3 = @buffer[@position_offset]
|
4412
|
-
if !
|
4413
|
-
[" ", "\t", "\v", "\f", "\r", "\n"].include?(u3)
|
4792
|
+
if ![" ", "\t", "\v", "\f", "\r", "\n"].include?(u3)
|
4414
4793
|
|
4415
4794
|
throw(1)
|
4416
4795
|
end
|
@@ -4655,230 +5034,6 @@ class Packcr
|
|
4655
5034
|
debug { warn "#{" " * @level}NOMATCH EOF #{answer.pos} #{@buffer[answer.pos...@position_offset].inspect}" }
|
4656
5035
|
nil
|
4657
5036
|
end
|
4658
|
-
|
4659
|
-
def grow_lr(rule, offset, offset_loc)
|
4660
|
-
while true
|
4661
|
-
old_offset = @position_offset
|
4662
|
-
@position_offset = offset
|
4663
|
-
@position_offset_loc = offset_loc
|
4664
|
-
answer = public_send(rule, offset, offset_loc, limits: { rule => true })
|
4665
|
-
if !answer || @position_offset <= old_offset
|
4666
|
-
break
|
4667
|
-
end
|
4668
|
-
|
4669
|
-
memo = @memos[offset, rule]
|
4670
|
-
memo.answer = answer
|
4671
|
-
memo.offset = @position_offset
|
4672
|
-
memo.offset_loc = @position_offset_loc
|
4673
|
-
end
|
4674
|
-
end
|
4675
|
-
|
4676
|
-
def rule_answer(rule)
|
4677
|
-
offset = @position_offset
|
4678
|
-
offset_loc = @position_offset_loc
|
4679
|
-
memo = @memos[offset, rule]
|
4680
|
-
|
4681
|
-
if !memo
|
4682
|
-
memo = LrMemo.new(offset, offset_loc)
|
4683
|
-
@memos[offset, rule] = memo
|
4684
|
-
answer = public_send(rule, offset, offset_loc)
|
4685
|
-
memo.answer = answer
|
4686
|
-
memo.offset = @position_offset
|
4687
|
-
memo.offset_loc = @position_offset_loc
|
4688
|
-
if memo.grow
|
4689
|
-
grow_lr(rule, offset, offset_loc)
|
4690
|
-
memo.grow = false
|
4691
|
-
answer = memo.answer
|
4692
|
-
@position_offset = memo.offset
|
4693
|
-
end
|
4694
|
-
answer
|
4695
|
-
elsif memo.fail
|
4696
|
-
memo.answer = nil
|
4697
|
-
memo.grow = true
|
4698
|
-
nil
|
4699
|
-
else
|
4700
|
-
@position_offset = memo.offset
|
4701
|
-
memo.answer
|
4702
|
-
end
|
4703
|
-
end
|
4704
|
-
|
4705
|
-
def apply_rule(rule, thunks, values, index, offset, offset_loc, limits: nil)
|
4706
|
-
if limits
|
4707
|
-
limits = limits.merge(rule => true)
|
4708
|
-
answer = public_send(rule, offset, offset_loc, limits: limits)
|
4709
|
-
memo = @memos[offset, rule]
|
4710
|
-
if !answer || @position_offset <= memo.offset
|
4711
|
-
answer = memo.answer
|
4712
|
-
@position_offset = memo.offset
|
4713
|
-
else
|
4714
|
-
memo.answer = answer
|
4715
|
-
memo.offset = @position_offset
|
4716
|
-
end
|
4717
|
-
else
|
4718
|
-
answer = rule_answer(rule)
|
4719
|
-
end
|
4720
|
-
|
4721
|
-
if !answer
|
4722
|
-
return false
|
4723
|
-
end
|
4724
|
-
|
4725
|
-
values ||= @global_values
|
4726
|
-
thunks << ThunkNode.new(answer.thunks, values, index)
|
4727
|
-
true
|
4728
|
-
end
|
4729
|
-
|
4730
|
-
def do_action(thunks, values, index)
|
4731
|
-
thunks.each do |thunk|
|
4732
|
-
thunk.do_action(self, values, index)
|
4733
|
-
end
|
4734
|
-
end
|
4735
|
-
|
4736
|
-
class Location
|
4737
|
-
attr_reader :charnum, :linenum
|
4738
|
-
|
4739
|
-
def initialize(charnum = 0, linenum = 0)
|
4740
|
-
@charnum = charnum
|
4741
|
-
@linenum = linenum
|
4742
|
-
end
|
4743
|
-
|
4744
|
-
def +(other)
|
4745
|
-
if other.linenum.zero?
|
4746
|
-
Location.new(@charnum + other.charnum, @linenum + other.linenum)
|
4747
|
-
else
|
4748
|
-
Location.new( other.charnum, @linenum + other.linenum)
|
4749
|
-
end
|
4750
|
-
end
|
4751
|
-
|
4752
|
-
def -(other)
|
4753
|
-
raise "unexpected location #{inspect} - #{other.inspect}" unless other.linenum == linenum || other.charnum.zero?
|
4754
|
-
|
4755
|
-
Location.new(@charnum - other.charnum, @linenum - other.linenum)
|
4756
|
-
end
|
4757
|
-
|
4758
|
-
def forward(buffer, cur, n)
|
4759
|
-
Location.new(@charnum, @linenum).forward!(buffer, cur, n)
|
4760
|
-
end
|
4761
|
-
|
4762
|
-
def forward!(buffer, cur, n)
|
4763
|
-
buffer[cur, n].scan(/(.*)(\n)?/) do
|
4764
|
-
if Regexp.last_match[2]
|
4765
|
-
@linenum += 1
|
4766
|
-
@charnum = 0
|
4767
|
-
else
|
4768
|
-
@charnum += Regexp.last_match[1].length
|
4769
|
-
end
|
4770
|
-
end
|
4771
|
-
self
|
4772
|
-
end
|
4773
|
-
end
|
4774
|
-
|
4775
|
-
class LrMemoTable
|
4776
|
-
def initialize
|
4777
|
-
@memos = {}
|
4778
|
-
end
|
4779
|
-
|
4780
|
-
def clear
|
4781
|
-
@memos.clear
|
4782
|
-
end
|
4783
|
-
|
4784
|
-
def []=(index, rule_name, memo)
|
4785
|
-
entry = @memos[index] ||= {}
|
4786
|
-
entry[rule_name] = memo
|
4787
|
-
end
|
4788
|
-
|
4789
|
-
def [](index, rule_name)
|
4790
|
-
@memos.dig(index, rule_name)
|
4791
|
-
end
|
4792
|
-
end
|
4793
|
-
|
4794
|
-
class LrMemo
|
4795
|
-
attr_accessor :grow, :answer, :offset, :fail, :offset_loc
|
4796
|
-
|
4797
|
-
def initialize(offset, offset_loc)
|
4798
|
-
@offset = offset
|
4799
|
-
@offset_loc = offset_loc
|
4800
|
-
@fail = true
|
4801
|
-
@grow = false
|
4802
|
-
end
|
4803
|
-
|
4804
|
-
def answer=(answer)
|
4805
|
-
@fail = nil
|
4806
|
-
@answer = answer
|
4807
|
-
end
|
4808
|
-
end
|
4809
|
-
|
4810
|
-
class ThunkChunk
|
4811
|
-
attr_accessor :thunks, :capts, :pos, :values, :pos_loc
|
4812
|
-
|
4813
|
-
def initialize
|
4814
|
-
super
|
4815
|
-
@thunks = []
|
4816
|
-
@capts = {}
|
4817
|
-
@pos = 0
|
4818
|
-
@values = {}
|
4819
|
-
end
|
4820
|
-
|
4821
|
-
def resize_captures(len)
|
4822
|
-
len.times do |i|
|
4823
|
-
@capts[i] = Capture.new
|
4824
|
-
end
|
4825
|
-
end
|
4826
|
-
end
|
4827
|
-
|
4828
|
-
class ThunkLeaf
|
4829
|
-
attr_accessor :capt0, :capts, :value_refs, :action
|
4830
|
-
|
4831
|
-
def initialize(action, capt0 = Capture.new, value_refs = {}, capts = {})
|
4832
|
-
@value_refs = value_refs
|
4833
|
-
@capts = capts
|
4834
|
-
@capt0 = capt0
|
4835
|
-
@action = action
|
4836
|
-
end
|
4837
|
-
|
4838
|
-
def do_action(ctx, values, index)
|
4839
|
-
ctx.public_send(action, self, values, index)
|
4840
|
-
end
|
4841
|
-
end
|
4842
|
-
|
4843
|
-
class ThunkNode
|
4844
|
-
attr_accessor :thunks, :values, :index
|
4845
|
-
|
4846
|
-
def initialize(thunks, values, index)
|
4847
|
-
@thunks = thunks
|
4848
|
-
@values = values
|
4849
|
-
@index = index
|
4850
|
-
values[index] ||= Value.new if values
|
4851
|
-
end
|
4852
|
-
|
4853
|
-
def do_action(ctx, _values, _index)
|
4854
|
-
@thunks.each do |thunk|
|
4855
|
-
thunk.do_action(ctx, @values, @index)
|
4856
|
-
end
|
4857
|
-
end
|
4858
|
-
|
4859
|
-
def clear
|
4860
|
-
@thunks.clear
|
4861
|
-
end
|
4862
|
-
end
|
4863
|
-
|
4864
|
-
class Capture
|
4865
|
-
attr_accessor :range_start, :range_end, :start_loc, :end_loc
|
4866
|
-
|
4867
|
-
def initialize(range_start = 0, range_end = 0, start_loc = nil, end_loc = nil)
|
4868
|
-
@range_start = range_start
|
4869
|
-
@range_end = range_end
|
4870
|
-
@start_loc = start_loc || Location.new
|
4871
|
-
@end_loc = end_loc || Location.new
|
4872
|
-
end
|
4873
|
-
|
4874
|
-
def capture_string(buffer)
|
4875
|
-
@capture_string ||= buffer[@range_start, @range_end - @range_start]
|
4876
|
-
end
|
4877
|
-
end
|
4878
|
-
|
4879
|
-
class Value
|
4880
|
-
attr_accessor :value
|
4881
|
-
end
|
4882
5037
|
end
|
4883
5038
|
|
4884
5039
|
class Parser
|