trenni 3.8.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +6 -0
- data/ext/trenni/markup.c +85 -85
- data/ext/trenni/markup.rl +11 -11
- data/ext/trenni/query.c +619 -0
- data/ext/trenni/query.h +6 -0
- data/ext/trenni/query.rl +82 -0
- data/ext/trenni/tag.c +8 -6
- data/ext/trenni/template.c +57 -57
- data/ext/trenni/template.rl +4 -4
- data/ext/trenni/trenni.c +9 -1
- data/ext/trenni/trenni.h +8 -3
- data/lib/trenni.rb +2 -0
- data/lib/trenni/{parse_error.rb → error.rb} +4 -1
- data/lib/trenni/fallback/markup.rb +1622 -1576
- data/lib/trenni/fallback/markup.rl +2 -2
- data/lib/trenni/fallback/query.rb +565 -0
- data/lib/trenni/fallback/query.rl +105 -0
- data/lib/trenni/fallback/template.rb +756 -748
- data/lib/trenni/fallback/template.rl +1 -1
- data/lib/trenni/native.rb +1 -1
- data/lib/trenni/parsers.rb +1 -0
- data/lib/trenni/query.rb +94 -0
- data/lib/trenni/reference.rb +125 -0
- data/lib/trenni/strings.rb +15 -4
- data/lib/trenni/uri.rb +1 -0
- data/lib/trenni/version.rb +1 -1
- data/parsers/trenni/query.rl +23 -0
- data/spec/trenni/markup_performance_spec.rb +14 -2
- data/spec/trenni/parsers_performance_spec.rb +31 -0
- data/spec/trenni/query_spec.rb +51 -0
- data/spec/trenni/reference_spec.rb +87 -0
- data/trenni.gemspec +2 -0
- metadata +32 -5
- data/.simplecov +0 -9
@@ -0,0 +1,105 @@
|
|
1
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
20
|
+
|
21
|
+
%%{
|
22
|
+
machine query;
|
23
|
+
|
24
|
+
action string_begin {
|
25
|
+
string_begin = p
|
26
|
+
}
|
27
|
+
|
28
|
+
action string_end {
|
29
|
+
string_end = p
|
30
|
+
|
31
|
+
delegate.string(data.byteslice(string_begin...string_end), encoded)
|
32
|
+
|
33
|
+
encoded = false
|
34
|
+
}
|
35
|
+
|
36
|
+
action integer_begin {
|
37
|
+
integer_begin = p
|
38
|
+
}
|
39
|
+
|
40
|
+
action integer_end {
|
41
|
+
integer_end = p
|
42
|
+
|
43
|
+
delegate.integer(data.byteslice(integer_begin...integer_end))
|
44
|
+
}
|
45
|
+
|
46
|
+
action append {
|
47
|
+
delegate.append
|
48
|
+
}
|
49
|
+
|
50
|
+
action value_begin {
|
51
|
+
value_begin = p
|
52
|
+
}
|
53
|
+
|
54
|
+
action value_end {
|
55
|
+
value_end = p
|
56
|
+
|
57
|
+
delegate.assign(data.byteslice(value_begin...value_end), encoded)
|
58
|
+
|
59
|
+
encoded = false
|
60
|
+
}
|
61
|
+
|
62
|
+
action pair {
|
63
|
+
delegate.pair
|
64
|
+
}
|
65
|
+
|
66
|
+
action encoded {
|
67
|
+
encoded = 1;
|
68
|
+
}
|
69
|
+
|
70
|
+
# This magic ensures that we process bytes.
|
71
|
+
getkey bytes[p];
|
72
|
+
|
73
|
+
include query "trenni/query.rl";
|
74
|
+
}%%
|
75
|
+
|
76
|
+
require_relative '../error'
|
77
|
+
|
78
|
+
module Trenni
|
79
|
+
module Fallback
|
80
|
+
%% write data;
|
81
|
+
|
82
|
+
def self.parse_query(buffer, delegate)
|
83
|
+
data = buffer.read
|
84
|
+
bytes = data.bytes
|
85
|
+
|
86
|
+
p = 0
|
87
|
+
pe = eof = data.bytesize
|
88
|
+
stack = []
|
89
|
+
|
90
|
+
string_begin = string_end = nil
|
91
|
+
integer_begin = integer_end = nil
|
92
|
+
value_begin = value_end = nil
|
93
|
+
encoded = false
|
94
|
+
|
95
|
+
%% write init;
|
96
|
+
%% write exec;
|
97
|
+
|
98
|
+
if p != eof
|
99
|
+
raise ParseError.new("could not consume all input", buffer, p)
|
100
|
+
end
|
101
|
+
|
102
|
+
return nil
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
|
3
2
|
# line 1 "template.rl"
|
4
3
|
# Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
@@ -25,766 +24,773 @@
|
|
25
24
|
# line 68 "template.rl"
|
26
25
|
|
27
26
|
|
28
|
-
require_relative '../
|
27
|
+
require_relative '../error'
|
29
28
|
|
30
29
|
module Trenni
|
31
30
|
module Fallback
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
31
|
+
|
32
|
+
# line 33 "template.rb"
|
33
|
+
class << self
|
34
|
+
attr_accessor :_template_trans_keys
|
35
|
+
private :_template_trans_keys, :_template_trans_keys=
|
36
|
+
end
|
37
|
+
self._template_trans_keys = [
|
38
|
+
0, 0, 10, 60, 123, 123,
|
39
|
+
63, 63, 123, 123, 63,
|
40
|
+
63, 63, 63, 114, 114,
|
41
|
+
9, 32, 63, 63, 62, 62,
|
42
|
+
9, 32, 123, 123, 63,
|
43
|
+
63, 0, 127, 0, 127,
|
44
|
+
63, 63, 62, 62, 0, 127,
|
45
|
+
63, 63, 62, 62, 34,
|
46
|
+
125, 34, 35, 35, 125,
|
47
|
+
35, 125, 34, 39, 35, 125,
|
48
|
+
35, 125, 34, 123, 34,
|
49
|
+
123, 39, 39, 34, 125,
|
50
|
+
34, 125, 34, 35, 35, 125,
|
51
|
+
35, 125, 34, 39, 35,
|
52
|
+
125, 35, 125, 34, 123,
|
53
|
+
34, 123, 39, 39, 34, 125,
|
54
|
+
9, 60, 10, 60, 10,
|
55
|
+
60, 9, 60, 0, 0,
|
56
|
+
9, 32, 34, 39, 34, 35,
|
57
|
+
39, 39, 0, 0, 34,
|
58
|
+
39, 34, 35, 39, 39,
|
59
|
+
0, 0, 0
|
60
|
+
]
|
61
|
+
|
62
|
+
class << self
|
63
|
+
attr_accessor :_template_key_spans
|
64
|
+
private :_template_key_spans, :_template_key_spans=
|
65
|
+
end
|
66
|
+
self._template_key_spans = [
|
67
|
+
0, 51, 1, 1, 1, 1, 1, 1,
|
68
|
+
24, 1, 1, 24, 1, 1, 128, 128,
|
69
|
+
1, 1, 128, 1, 1, 92, 2, 91,
|
70
|
+
91, 6, 91, 91, 90, 90, 1, 92,
|
71
|
+
92, 2, 91, 91, 6, 91, 91, 90,
|
72
|
+
90, 1, 92, 52, 51, 51, 52, 0,
|
73
|
+
24, 6, 2, 1, 0, 6, 2, 1,
|
74
|
+
0
|
75
|
+
]
|
76
|
+
|
77
|
+
class << self
|
78
|
+
attr_accessor :_template_index_offsets
|
79
|
+
private :_template_index_offsets, :_template_index_offsets=
|
80
|
+
end
|
81
|
+
self._template_index_offsets = [
|
82
|
+
0, 0, 52, 54, 56, 58, 60, 62,
|
83
|
+
64, 89, 91, 93, 118, 120, 122, 251,
|
84
|
+
380, 382, 384, 513, 515, 517, 610, 613,
|
85
|
+
705, 797, 804, 896, 988, 1079, 1170, 1172,
|
86
|
+
1265, 1358, 1361, 1453, 1545, 1552, 1644, 1736,
|
87
|
+
1827, 1918, 1920, 2013, 2066, 2118, 2170, 2223,
|
88
|
+
2224, 2249, 2256, 2259, 2261, 2262, 2269, 2272,
|
89
|
+
2274
|
90
|
+
]
|
91
|
+
|
92
|
+
class << self
|
93
|
+
attr_accessor :_template_indicies
|
94
|
+
private :_template_indicies, :_template_indicies=
|
95
|
+
end
|
96
|
+
self._template_indicies = [
|
97
|
+
2, 1, 1, 1, 1, 1, 1, 1,
|
98
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
99
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
100
|
+
1, 3, 1, 1, 1, 1, 1, 1,
|
101
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
102
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
103
|
+
1, 1, 4, 1, 0, 1, 0, 1,
|
104
|
+
5, 6, 5, 6, 7, 6, 8, 5,
|
105
|
+
10, 10, 10, 10, 10, 5, 5, 5,
|
106
|
+
5, 5, 5, 5, 5, 5, 5, 5,
|
107
|
+
5, 5, 5, 5, 5, 5, 5, 10,
|
108
|
+
5, 12, 11, 13, 11, 13, 15, 13,
|
109
|
+
13, 13, 14, 14, 14, 14, 14, 14,
|
110
|
+
14, 14, 14, 14, 14, 14, 14, 14,
|
111
|
+
14, 14, 14, 14, 13, 14, 16, 6,
|
112
|
+
17, 6, 19, 19, 19, 19, 19, 19,
|
113
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
114
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
115
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
116
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
117
|
+
19, 19, 19, 19, 19, 19, 19, 18,
|
118
|
+
18, 19, 18, 18, 18, 18, 18, 18,
|
119
|
+
18, 18, 18, 18, 18, 19, 19, 19,
|
120
|
+
19, 19, 19, 18, 18, 18, 18, 18,
|
121
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
122
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
123
|
+
18, 18, 18, 18, 18, 19, 19, 19,
|
124
|
+
19, 18, 19, 18, 18, 18, 18, 18,
|
125
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
126
|
+
18, 18, 18, 18, 20, 18, 18, 18,
|
127
|
+
18, 18, 18, 18, 18, 19, 19, 19,
|
128
|
+
19, 19, 18, 19, 19, 19, 19, 19,
|
129
|
+
19, 19, 19, 19, 21, 21, 21, 21,
|
130
|
+
21, 19, 19, 19, 19, 19, 19, 19,
|
131
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
132
|
+
19, 19, 19, 21, 19, 19, 19, 19,
|
133
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
134
|
+
18, 18, 19, 18, 18, 18, 18, 18,
|
135
|
+
18, 18, 18, 18, 18, 18, 19, 19,
|
136
|
+
19, 19, 19, 19, 18, 18, 18, 18,
|
137
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
138
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
139
|
+
18, 18, 18, 18, 18, 18, 19, 19,
|
140
|
+
19, 19, 18, 19, 18, 18, 18, 18,
|
141
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
142
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
143
|
+
18, 18, 18, 18, 18, 18, 19, 19,
|
144
|
+
19, 19, 19, 18, 22, 21, 23, 21,
|
145
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
146
|
+
19, 24, 24, 24, 24, 24, 19, 19,
|
147
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
148
|
+
19, 19, 19, 19, 19, 19, 19, 19,
|
149
|
+
24, 19, 19, 19, 19, 19, 19, 19,
|
150
|
+
19, 19, 19, 19, 19, 18, 18, 19,
|
151
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
152
|
+
18, 18, 18, 19, 19, 19, 19, 19,
|
153
|
+
19, 18, 18, 18, 18, 18, 18, 18,
|
154
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
155
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
156
|
+
18, 18, 18, 19, 19, 19, 19, 18,
|
157
|
+
19, 18, 18, 18, 18, 18, 18, 18,
|
158
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
159
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
160
|
+
18, 18, 18, 19, 19, 19, 19, 19,
|
161
|
+
18, 26, 25, 27, 25, 29, 28, 28,
|
162
|
+
28, 28, 30, 28, 28, 28, 28, 28,
|
163
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
164
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
165
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
166
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
167
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
168
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
169
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
170
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
171
|
+
28, 28, 28, 28, 28, 28, 28, 28,
|
172
|
+
28, 28, 28, 28, 28, 28, 31, 28,
|
173
|
+
32, 28, 33, 34, 29, 35, 33, 33,
|
174
|
+
33, 36, 33, 33, 33, 33, 33, 33,
|
175
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
176
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
177
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
178
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
179
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
180
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
181
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
182
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
183
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
184
|
+
33, 33, 33, 33, 33, 37, 33, 38,
|
185
|
+
33, 35, 33, 33, 33, 36, 33, 33,
|
186
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
187
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
188
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
189
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
190
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
191
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
192
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
193
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
194
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
195
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
196
|
+
33, 39, 33, 38, 33, 40, 41, 36,
|
197
|
+
36, 36, 40, 36, 42, 40, 40, 40,
|
198
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
199
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
200
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
201
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
202
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
203
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
204
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
205
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
206
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
207
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
208
|
+
40, 40, 40, 40, 43, 40, 44, 40,
|
209
|
+
42, 40, 40, 40, 40, 40, 40, 40,
|
210
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
211
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
212
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
213
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
214
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
215
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
216
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
217
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
218
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
219
|
+
40, 40, 40, 40, 40, 40, 40, 40,
|
220
|
+
45, 40, 44, 40, 40, 41, 36, 36,
|
221
|
+
36, 40, 36, 36, 36, 36, 36, 36,
|
222
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
223
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
224
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
225
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
226
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
227
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
228
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
229
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
230
|
+
36, 36, 36, 36, 36, 36, 36, 36,
|
231
|
+
36, 36, 36, 36, 36, 46, 36, 33,
|
232
|
+
34, 29, 29, 29, 29, 29, 29, 29,
|
233
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
234
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
235
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
236
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
237
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
238
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
239
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
240
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
241
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
242
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
243
|
+
47, 29, 48, 30, 36, 48, 48, 48,
|
244
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
245
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
246
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
247
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
248
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
249
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
250
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
251
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
252
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
253
|
+
48, 48, 48, 48, 48, 48, 48, 48,
|
254
|
+
48, 48, 48, 48, 48, 49, 48, 50,
|
255
|
+
48, 52, 51, 51, 51, 51, 53, 51,
|
256
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
257
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
258
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
259
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
260
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
261
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
262
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
263
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
264
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
265
|
+
51, 51, 51, 51, 51, 51, 51, 51,
|
266
|
+
51, 51, 54, 51, 55, 51, 56, 57,
|
267
|
+
52, 58, 56, 56, 56, 59, 56, 56,
|
268
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
269
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
270
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
271
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
272
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
273
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
274
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
275
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
276
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
277
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
278
|
+
56, 60, 56, 61, 56, 58, 56, 56,
|
279
|
+
56, 59, 56, 56, 56, 56, 56, 56,
|
280
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
281
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
282
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
283
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
284
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
285
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
286
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
287
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
288
|
+
56, 56, 56, 56, 56, 56, 56, 56,
|
289
|
+
56, 56, 56, 56, 56, 62, 56, 61,
|
290
|
+
56, 63, 64, 59, 59, 59, 63, 59,
|
291
|
+
65, 63, 63, 63, 63, 63, 63, 63,
|
292
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
293
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
294
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
295
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
296
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
297
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
298
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
299
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
300
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
301
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
302
|
+
66, 63, 67, 63, 65, 63, 63, 63,
|
303
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
304
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
305
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
306
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
307
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
308
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
309
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
310
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
311
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
312
|
+
63, 63, 63, 63, 63, 63, 63, 63,
|
313
|
+
63, 63, 63, 63, 68, 63, 67, 63,
|
314
|
+
63, 64, 59, 59, 59, 63, 59, 59,
|
315
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
316
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
317
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
318
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
319
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
320
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
321
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
322
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
323
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
324
|
+
59, 59, 59, 59, 59, 59, 59, 59,
|
325
|
+
59, 69, 59, 56, 57, 52, 52, 52,
|
326
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
327
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
328
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
329
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
330
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
331
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
332
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
333
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
334
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
335
|
+
52, 52, 52, 52, 52, 52, 52, 52,
|
336
|
+
52, 52, 52, 52, 70, 52, 71, 53,
|
337
|
+
59, 71, 71, 71, 71, 71, 71, 71,
|
338
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
339
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
340
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
341
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
342
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
343
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
344
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
345
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
346
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
347
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
348
|
+
71, 72, 71, 73, 71, 74, 2, 74,
|
349
|
+
74, 74, 6, 6, 6, 6, 6, 6,
|
350
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
351
|
+
6, 6, 6, 6, 74, 6, 6, 75,
|
352
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
353
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
354
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
355
|
+
76, 6, 2, 6, 6, 6, 6, 6,
|
356
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
357
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
358
|
+
6, 6, 6, 78, 6, 6, 6, 6,
|
359
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
360
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
361
|
+
6, 6, 6, 6, 79, 6, 2, 1,
|
362
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
363
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
364
|
+
1, 1, 1, 1, 1, 1, 1, 3,
|
365
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
366
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
367
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
368
|
+
4, 1, 74, 2, 74, 74, 74, 6,
|
369
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
370
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
371
|
+
6, 74, 6, 6, 78, 6, 6, 6,
|
372
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
373
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
374
|
+
6, 6, 6, 6, 6, 81, 6, 82,
|
375
|
+
13, 15, 13, 13, 13, 83, 83, 83,
|
376
|
+
83, 83, 83, 83, 83, 83, 83, 83,
|
377
|
+
83, 83, 83, 83, 83, 83, 83, 13,
|
378
|
+
83, 40, 41, 36, 36, 36, 40, 36,
|
379
|
+
33, 34, 29, 48, 30, 84, 63, 64,
|
380
|
+
59, 59, 59, 63, 59, 56, 57, 52,
|
381
|
+
71, 53, 84, 0
|
382
|
+
]
|
383
|
+
|
384
|
+
class << self
|
385
|
+
attr_accessor :_template_trans_targs
|
386
|
+
private :_template_trans_targs, :_template_trans_targs=
|
387
|
+
end
|
388
|
+
self._template_trans_targs = [
|
389
|
+
43, 1, 45, 2, 3, 43, 44, 7,
|
390
|
+
8, 43, 9, 9, 10, 11, 43, 43,
|
391
|
+
47, 14, 15, 0, 18, 16, 17, 43,
|
392
|
+
19, 19, 20, 48, 21, 22, 30, 21,
|
393
|
+
52, 23, 29, 24, 25, 23, 50, 23,
|
394
|
+
26, 28, 27, 26, 49, 26, 25, 22,
|
395
|
+
31, 31, 51, 32, 33, 41, 32, 56,
|
396
|
+
34, 40, 35, 36, 34, 54, 34, 37,
|
397
|
+
39, 38, 37, 53, 37, 36, 33, 42,
|
398
|
+
42, 55, 46, 12, 13, 43, 4, 5,
|
399
|
+
43, 6, 43, 43, 0
|
400
|
+
]
|
401
|
+
|
402
|
+
class << self
|
403
|
+
attr_accessor :_template_trans_actions
|
404
|
+
private :_template_trans_actions, :_template_trans_actions=
|
405
|
+
end
|
406
|
+
self._template_trans_actions = [
|
407
|
+
1, 0, 2, 0, 0, 3, 2, 0,
|
408
|
+
0, 4, 5, 0, 6, 0, 7, 8,
|
409
|
+
0, 0, 0, 9, 0, 0, 0, 10,
|
410
|
+
5, 0, 6, 11, 0, 0, 0, 13,
|
411
|
+
14, 0, 0, 0, 0, 13, 14, 15,
|
412
|
+
0, 0, 0, 13, 14, 15, 16, 16,
|
413
|
+
0, 13, 14, 0, 0, 0, 13, 18,
|
414
|
+
0, 0, 0, 0, 13, 18, 15, 0,
|
415
|
+
0, 0, 13, 18, 15, 16, 16, 0,
|
416
|
+
13, 18, 20, 0, 0, 21, 0, 0,
|
417
|
+
22, 0, 23, 24, 0
|
418
|
+
]
|
419
|
+
|
420
|
+
class << self
|
421
|
+
attr_accessor :_template_to_state_actions
|
422
|
+
private :_template_to_state_actions, :_template_to_state_actions=
|
423
|
+
end
|
424
|
+
self._template_to_state_actions = [
|
425
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
426
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
427
|
+
0, 0, 0, 0, 0, 12, 12, 12,
|
428
|
+
0, 12, 12, 0, 0, 0, 0, 12,
|
429
|
+
12, 12, 12, 0, 12, 12, 0, 0,
|
430
|
+
0, 0, 12, 12, 0, 0, 0, 0,
|
431
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
432
|
+
0
|
433
|
+
]
|
434
|
+
|
435
|
+
class << self
|
436
|
+
attr_accessor :_template_from_state_actions
|
437
|
+
private :_template_from_state_actions, :_template_from_state_actions=
|
438
|
+
end
|
439
|
+
self._template_from_state_actions = [
|
440
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
441
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
442
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
443
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
444
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
445
|
+
0, 0, 0, 19, 0, 0, 0, 0,
|
446
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
447
|
+
0
|
448
|
+
]
|
449
|
+
|
450
|
+
class << self
|
451
|
+
attr_accessor :_template_eof_actions
|
452
|
+
private :_template_eof_actions, :_template_eof_actions=
|
453
|
+
end
|
454
|
+
self._template_eof_actions = [
|
455
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
456
|
+
0, 0, 0, 0, 0, 0, 9, 9,
|
457
|
+
9, 9, 9, 9, 9, 0, 0, 0,
|
458
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
459
|
+
17, 17, 17, 17, 17, 17, 17, 17,
|
460
|
+
17, 17, 17, 0, 0, 0, 0, 0,
|
461
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
462
|
+
0
|
463
|
+
]
|
464
|
+
|
465
|
+
class << self
|
466
|
+
attr_accessor :_template_eof_trans
|
467
|
+
private :_template_eof_trans, :_template_eof_trans=
|
468
|
+
end
|
469
|
+
self._template_eof_trans = [
|
470
|
+
0, 1, 1, 1, 6, 6, 6, 6,
|
471
|
+
10, 10, 10, 15, 0, 0, 0, 0,
|
472
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
473
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
474
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
475
|
+
0, 0, 0, 0, 78, 81, 78, 83,
|
476
|
+
84, 0, 0, 0, 0, 0, 0, 0,
|
477
|
+
0
|
478
|
+
]
|
479
|
+
|
480
|
+
class << self
|
481
|
+
attr_accessor :template_start
|
482
|
+
end
|
483
|
+
self.template_start = 43;
|
484
|
+
class << self
|
485
|
+
attr_accessor :template_first_final
|
486
|
+
end
|
487
|
+
self.template_first_final = 43;
|
488
|
+
class << self
|
489
|
+
attr_accessor :template_error
|
490
|
+
end
|
491
|
+
self.template_error = 0;
|
492
|
+
|
493
|
+
class << self
|
494
|
+
attr_accessor :template_en_parse_nested_expression
|
495
|
+
end
|
496
|
+
self.template_en_parse_nested_expression = 21;
|
497
|
+
class << self
|
498
|
+
attr_accessor :template_en_parse_expression
|
499
|
+
end
|
500
|
+
self.template_en_parse_expression = 32;
|
501
|
+
class << self
|
502
|
+
attr_accessor :template_en_main
|
503
|
+
end
|
504
|
+
self.template_en_main = 43;
|
505
|
+
|
506
|
+
|
507
|
+
# line 75 "template.rl"
|
508
|
+
|
509
|
+
def self.parse_template(buffer, delegate)
|
510
|
+
data = buffer.read
|
511
|
+
bytes = data.bytes
|
512
|
+
|
513
|
+
p = 0
|
514
|
+
pe = eof = data.bytesize
|
515
|
+
stack = []
|
516
|
+
|
517
|
+
expression_begin = expression_end = nil
|
518
|
+
instruction_begin = instruction_end = nil
|
519
|
+
|
520
|
+
|
521
|
+
# line 522 "template.rb"
|
522
|
+
begin
|
523
|
+
p ||= 0
|
524
|
+
pe ||= data.length
|
525
|
+
cs = template_start
|
526
|
+
top = 0
|
527
|
+
ts = nil
|
528
|
+
te = nil
|
529
|
+
act = 0
|
530
|
+
end
|
531
|
+
|
532
|
+
# line 88 "template.rl"
|
533
|
+
|
534
|
+
# line 535 "template.rb"
|
535
|
+
begin
|
536
|
+
testEof = false
|
537
|
+
_slen, _trans, _keys, _inds, _acts, _nacts = nil
|
538
|
+
_goto_level = 0
|
539
|
+
_resume = 10
|
540
|
+
_eof_trans = 15
|
541
|
+
_again = 20
|
542
|
+
_test_eof = 30
|
543
|
+
_out = 40
|
544
|
+
while true
|
545
|
+
if _goto_level <= 0
|
546
|
+
if p == pe
|
547
|
+
_goto_level = _test_eof
|
548
|
+
next
|
549
|
+
end
|
550
|
+
if cs == 0
|
551
|
+
_goto_level = _out
|
552
|
+
next
|
553
|
+
end
|
554
|
+
end
|
555
|
+
if _goto_level <= _resume
|
556
|
+
case _template_from_state_actions[cs]
|
557
|
+
when 19 then
|
558
|
+
# line 1 "NONE"
|
559
|
+
begin
|
560
|
+
ts = p
|
387
561
|
end
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
562
|
+
# line 563 "template.rb"
|
563
|
+
end
|
564
|
+
_keys = cs << 1
|
565
|
+
_inds = _template_index_offsets[cs]
|
566
|
+
_slen = _template_key_spans[cs]
|
567
|
+
_wide = ( bytes[p])
|
568
|
+
_trans = if ( _slen > 0 &&
|
569
|
+
_template_trans_keys[_keys] <= _wide &&
|
570
|
+
_wide <= _template_trans_keys[_keys + 1]
|
571
|
+
) then
|
572
|
+
_template_indicies[ _inds + _wide - _template_trans_keys[_keys] ]
|
573
|
+
else
|
574
|
+
_template_indicies[ _inds + _slen ]
|
575
|
+
end
|
576
|
+
end
|
577
|
+
if _goto_level <= _eof_trans
|
578
|
+
cs = _template_trans_targs[_trans]
|
579
|
+
if _template_trans_actions[_trans] != 0
|
580
|
+
case _template_trans_actions[_trans]
|
581
|
+
when 5 then
|
582
|
+
# line 24 "template.rl"
|
583
|
+
begin
|
584
|
+
|
585
|
+
instruction_begin = p
|
586
|
+
end
|
587
|
+
when 6 then
|
588
|
+
# line 28 "template.rl"
|
589
|
+
begin
|
590
|
+
|
591
|
+
instruction_end = p
|
592
|
+
end
|
593
|
+
when 9 then
|
594
|
+
# line 40 "template.rl"
|
595
|
+
begin
|
596
|
+
|
597
|
+
raise ParseError.new("failed to parse instruction", buffer, p)
|
598
|
+
end
|
599
|
+
when 16 then
|
600
|
+
# line 13 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
601
|
+
begin
|
602
|
+
begin
|
603
|
+
stack[top] = cs
|
604
|
+
top+= 1
|
605
|
+
cs = 21
|
606
|
+
_goto_level = _again
|
607
|
+
next
|
608
|
+
end
|
405
609
|
end
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
13, 18, 20, 0, 0, 21, 0, 0,
|
417
|
-
22, 0, 23, 24, 0
|
418
|
-
]
|
419
|
-
|
420
|
-
class << self
|
421
|
-
attr_accessor :_template_to_state_actions
|
422
|
-
private :_template_to_state_actions, :_template_to_state_actions=
|
610
|
+
when 13 then
|
611
|
+
# line 17 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
612
|
+
begin
|
613
|
+
begin
|
614
|
+
stack[top] = cs
|
615
|
+
top+= 1
|
616
|
+
cs = 21
|
617
|
+
_goto_level = _again
|
618
|
+
next
|
619
|
+
end
|
423
620
|
end
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
]
|
434
|
-
|
435
|
-
class << self
|
436
|
-
attr_accessor :_template_from_state_actions
|
437
|
-
private :_template_from_state_actions, :_template_from_state_actions=
|
621
|
+
when 14 then
|
622
|
+
# line 20 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
623
|
+
begin
|
624
|
+
begin
|
625
|
+
top -= 1
|
626
|
+
cs = stack[top]
|
627
|
+
_goto_level = _again
|
628
|
+
next
|
629
|
+
end
|
438
630
|
end
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
444
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
445
|
-
0, 0, 0, 19, 0, 0, 0, 0,
|
446
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
447
|
-
0
|
448
|
-
]
|
449
|
-
|
450
|
-
class << self
|
451
|
-
attr_accessor :_template_eof_actions
|
452
|
-
private :_template_eof_actions, :_template_eof_actions=
|
631
|
+
when 2 then
|
632
|
+
# line 1 "NONE"
|
633
|
+
begin
|
634
|
+
te = p+1
|
453
635
|
end
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
462
|
-
0
|
463
|
-
]
|
464
|
-
|
465
|
-
class << self
|
466
|
-
attr_accessor :_template_eof_trans
|
467
|
-
private :_template_eof_trans, :_template_eof_trans=
|
636
|
+
when 8 then
|
637
|
+
# line 36 "template.rl"
|
638
|
+
begin
|
639
|
+
te = p+1
|
640
|
+
begin
|
641
|
+
delegate.instruction(data.byteslice(instruction_begin...instruction_end), "\n")
|
642
|
+
end
|
468
643
|
end
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
84, 0, 0, 0, 0, 0, 0, 0,
|
477
|
-
0
|
478
|
-
]
|
479
|
-
|
480
|
-
class << self
|
481
|
-
attr_accessor :template_start
|
644
|
+
when 10 then
|
645
|
+
# line 60 "template.rl"
|
646
|
+
begin
|
647
|
+
te = p+1
|
648
|
+
begin
|
649
|
+
delegate.text(data.byteslice(ts...te))
|
650
|
+
end
|
482
651
|
end
|
483
|
-
|
484
|
-
|
485
|
-
|
652
|
+
when 22 then
|
653
|
+
# line 60 "template.rl"
|
654
|
+
begin
|
655
|
+
te = p
|
656
|
+
p = p - 1; begin
|
657
|
+
delegate.text(data.byteslice(ts...te))
|
658
|
+
end
|
486
659
|
end
|
487
|
-
|
488
|
-
|
489
|
-
|
660
|
+
when 24 then
|
661
|
+
# line 32 "template.rl"
|
662
|
+
begin
|
663
|
+
te = p
|
664
|
+
p = p - 1; begin
|
665
|
+
delegate.instruction(data.byteslice(instruction_begin...instruction_end))
|
666
|
+
end
|
490
667
|
end
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
668
|
+
when 21 then
|
669
|
+
# line 60 "template.rl"
|
670
|
+
begin
|
671
|
+
te = p
|
672
|
+
p = p - 1; begin
|
673
|
+
delegate.text(data.byteslice(ts...te))
|
674
|
+
end
|
495
675
|
end
|
496
|
-
|
497
|
-
|
498
|
-
|
676
|
+
when 1 then
|
677
|
+
# line 60 "template.rl"
|
678
|
+
begin
|
679
|
+
begin p = ((te))-1; end
|
680
|
+
begin
|
681
|
+
delegate.text(data.byteslice(ts...te))
|
682
|
+
end
|
499
683
|
end
|
500
|
-
|
501
|
-
|
502
|
-
|
684
|
+
when 3 then
|
685
|
+
# line 60 "template.rl"
|
686
|
+
begin
|
687
|
+
begin p = ((te))-1; end
|
688
|
+
begin
|
689
|
+
delegate.text(data.byteslice(ts...te))
|
690
|
+
end
|
503
691
|
end
|
504
|
-
|
692
|
+
when 7 then
|
693
|
+
# line 1 "NONE"
|
694
|
+
begin
|
695
|
+
case act
|
696
|
+
when 3 then
|
697
|
+
begin begin p = ((te))-1; end
|
505
698
|
|
699
|
+
delegate.instruction(data.byteslice(instruction_begin...instruction_end))
|
700
|
+
end
|
701
|
+
when 6 then
|
702
|
+
begin begin p = ((te))-1; end
|
506
703
|
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
bytes = data.bytes
|
511
|
-
p = 0
|
512
|
-
pe = eof = data.bytesize
|
513
|
-
stack = []
|
514
|
-
expression_begin = expression_end = nil
|
515
|
-
instruction_begin = instruction_end = nil
|
516
|
-
# line 522 "template.rb"
|
517
|
-
begin
|
518
|
-
p ||= 0
|
519
|
-
pe ||= data.length
|
520
|
-
cs = template_start
|
521
|
-
top = 0
|
522
|
-
ts = nil
|
523
|
-
te = nil
|
524
|
-
act = 0
|
704
|
+
delegate.text(data.byteslice(ts...te))
|
705
|
+
end
|
706
|
+
end
|
525
707
|
end
|
526
|
-
|
527
|
-
# line 88 "template.rl"
|
528
|
-
# line 535 "template.rb"
|
529
|
-
begin
|
530
|
-
testEof = false
|
531
|
-
_slen, _trans, _keys, _inds, _acts, _nacts = nil
|
532
|
-
_goto_level = 0
|
533
|
-
_resume = 10
|
534
|
-
_eof_trans = 15
|
535
|
-
_again = 20
|
536
|
-
_test_eof = 30
|
537
|
-
_out = 40
|
538
|
-
while true
|
539
|
-
if _goto_level <= 0
|
540
|
-
if p == pe
|
541
|
-
_goto_level = _test_eof
|
542
|
-
next
|
543
|
-
end
|
544
|
-
if cs == 0
|
545
|
-
_goto_level = _out
|
546
|
-
next
|
547
|
-
end
|
548
|
-
end
|
549
|
-
if _goto_level <= _resume
|
550
|
-
case _template_from_state_actions[cs]
|
551
|
-
when 19 then
|
552
|
-
# line 1 "NONE"
|
553
|
-
begin
|
554
|
-
ts = p
|
555
|
-
end
|
556
|
-
# line 563 "template.rb"
|
557
|
-
end
|
558
|
-
_keys = cs << 1
|
559
|
-
_inds = _template_index_offsets[cs]
|
560
|
-
_slen = _template_key_spans[cs]
|
561
|
-
_wide = ( bytes[p])
|
562
|
-
_trans = if ( _slen > 0 &&
|
563
|
-
_template_trans_keys[_keys] <= _wide &&
|
564
|
-
_wide <= _template_trans_keys[_keys + 1]
|
565
|
-
) then
|
566
|
-
_template_indicies[ _inds + _wide - _template_trans_keys[_keys] ]
|
567
|
-
else
|
568
|
-
_template_indicies[ _inds + _slen ]
|
569
|
-
end
|
570
|
-
end
|
571
|
-
if _goto_level <= _eof_trans
|
572
|
-
cs = _template_trans_targs[_trans]
|
573
|
-
if _template_trans_actions[_trans] != 0
|
574
|
-
case _template_trans_actions[_trans]
|
575
|
-
when 5 then
|
576
|
-
# line 24 "template.rl"
|
577
|
-
begin
|
578
|
-
|
579
|
-
instruction_begin = p
|
580
|
-
end
|
581
|
-
when 6 then
|
582
|
-
# line 28 "template.rl"
|
583
|
-
begin
|
584
|
-
|
585
|
-
instruction_end = p
|
586
|
-
end
|
587
|
-
when 9 then
|
588
|
-
# line 40 "template.rl"
|
589
|
-
begin
|
590
|
-
|
591
|
-
raise ParseError.new("failed to parse instruction", buffer, p)
|
592
|
-
end
|
593
|
-
when 16 then
|
594
|
-
# line 13 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/template.rl"
|
595
|
-
begin
|
596
|
-
begin
|
597
|
-
stack[top] = cs
|
598
|
-
top+= 1
|
599
|
-
cs = 21
|
600
|
-
_goto_level = _again
|
601
|
-
next
|
602
|
-
end
|
603
|
-
end
|
604
|
-
when 13 then
|
605
|
-
# line 17 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/template.rl"
|
606
|
-
begin
|
607
|
-
begin
|
608
|
-
stack[top] = cs
|
609
|
-
top+= 1
|
610
|
-
cs = 21
|
611
|
-
_goto_level = _again
|
612
|
-
next
|
613
|
-
end
|
614
|
-
end
|
615
|
-
when 14 then
|
616
|
-
# line 20 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/template.rl"
|
617
|
-
begin
|
618
|
-
begin
|
619
|
-
top -= 1
|
620
|
-
cs = stack[top]
|
621
|
-
_goto_level = _again
|
622
|
-
next
|
623
|
-
end
|
624
|
-
end
|
625
|
-
when 2 then
|
626
|
-
# line 1 "NONE"
|
627
|
-
begin
|
628
|
-
te = p+1
|
629
|
-
end
|
630
|
-
when 8 then
|
631
|
-
# line 36 "template.rl"
|
632
|
-
begin
|
633
|
-
te = p+1
|
634
|
-
begin
|
635
|
-
delegate.instruction(data.byteslice(instruction_begin...instruction_end), "\n")
|
636
|
-
end
|
637
|
-
end
|
638
|
-
when 10 then
|
639
|
-
# line 60 "template.rl"
|
640
|
-
begin
|
641
|
-
te = p+1
|
642
|
-
begin
|
643
|
-
delegate.text(data.byteslice(ts...te))
|
644
|
-
end
|
645
|
-
end
|
646
|
-
when 22 then
|
647
|
-
# line 60 "template.rl"
|
648
|
-
begin
|
649
|
-
te = p
|
650
|
-
p = p - 1; begin
|
651
|
-
delegate.text(data.byteslice(ts...te))
|
652
|
-
end
|
653
|
-
end
|
654
|
-
when 24 then
|
655
|
-
# line 32 "template.rl"
|
656
|
-
begin
|
657
|
-
te = p
|
658
|
-
p = p - 1; begin
|
659
|
-
delegate.instruction(data.byteslice(instruction_begin...instruction_end))
|
660
|
-
end
|
661
|
-
end
|
662
|
-
when 21 then
|
663
|
-
# line 60 "template.rl"
|
664
|
-
begin
|
665
|
-
te = p
|
666
|
-
p = p - 1; begin
|
667
|
-
delegate.text(data.byteslice(ts...te))
|
668
|
-
end
|
669
|
-
end
|
670
|
-
when 1 then
|
671
|
-
# line 60 "template.rl"
|
672
|
-
begin
|
673
|
-
begin p = ((te))-1; end
|
674
|
-
begin
|
675
|
-
delegate.text(data.byteslice(ts...te))
|
676
|
-
end
|
677
|
-
end
|
678
|
-
when 3 then
|
679
|
-
# line 60 "template.rl"
|
680
|
-
begin
|
681
|
-
begin p = ((te))-1; end
|
682
|
-
begin
|
683
|
-
delegate.text(data.byteslice(ts...te))
|
684
|
-
end
|
685
|
-
end
|
686
|
-
when 7 then
|
687
|
-
# line 1 "NONE"
|
688
|
-
begin
|
689
|
-
case act
|
690
|
-
when 3 then
|
691
|
-
begin begin p = ((te))-1; end
|
692
|
-
|
693
|
-
delegate.instruction(data.byteslice(instruction_begin...instruction_end))
|
694
|
-
end
|
695
|
-
when 6 then
|
696
|
-
begin begin p = ((te))-1; end
|
697
|
-
|
698
|
-
delegate.text(data.byteslice(ts...te))
|
699
|
-
end
|
700
|
-
end
|
701
|
-
end
|
702
708
|
when 4 then
|
703
|
-
|
709
|
+
# line 40 "template.rl"
|
704
710
|
begin
|
705
711
|
|
706
|
-
|
707
|
-
end
|
708
|
-
# line 60 "template.rl"
|
709
|
-
begin
|
710
|
-
begin p = ((te))-1; end
|
711
|
-
begin
|
712
|
-
delegate.text(data.byteslice(ts...te))
|
712
|
+
raise ParseError.new("failed to parse instruction", buffer, p)
|
713
713
|
end
|
714
|
+
# line 60 "template.rl"
|
715
|
+
begin
|
716
|
+
begin p = ((te))-1; end
|
717
|
+
begin
|
718
|
+
delegate.text(data.byteslice(ts...te))
|
719
|
+
end
|
714
720
|
end
|
715
721
|
when 23 then
|
716
|
-
|
722
|
+
# line 44 "template.rl"
|
717
723
|
begin
|
718
724
|
|
719
|
-
|
725
|
+
expression_begin = p
|
726
|
+
end
|
727
|
+
# line 53 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
728
|
+
begin
|
729
|
+
te = p
|
730
|
+
p = p - 1; begin cs = 32; end
|
720
731
|
end
|
721
|
-
|
732
|
+
when 15 then
|
733
|
+
# line 13 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
722
734
|
begin
|
723
|
-
|
724
|
-
|
735
|
+
begin
|
736
|
+
stack[top] = cs
|
737
|
+
top+= 1
|
738
|
+
cs = 21
|
739
|
+
_goto_level = _again
|
740
|
+
next
|
725
741
|
end
|
726
|
-
|
727
|
-
|
742
|
+
end
|
743
|
+
# line 17 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
744
|
+
begin
|
728
745
|
begin
|
746
|
+
stack[top] = cs
|
747
|
+
top+= 1
|
748
|
+
cs = 21
|
749
|
+
_goto_level = _again
|
750
|
+
next
|
751
|
+
end
|
752
|
+
end
|
753
|
+
when 11 then
|
754
|
+
# line 1 "NONE"
|
729
755
|
begin
|
730
|
-
|
731
|
-
top+= 1
|
732
|
-
cs = 21
|
733
|
-
_goto_level = _again
|
734
|
-
next
|
756
|
+
te = p+1
|
735
757
|
end
|
736
|
-
|
737
|
-
# line 17 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/template.rl"
|
738
|
-
begin
|
758
|
+
# line 32 "template.rl"
|
739
759
|
begin
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
760
|
+
act = 3; end
|
761
|
+
when 20 then
|
762
|
+
# line 1 "NONE"
|
763
|
+
begin
|
764
|
+
te = p+1
|
745
765
|
end
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
# line 32 "template.rl"
|
753
|
-
begin
|
754
|
-
act = 3; end
|
755
|
-
when 20 then
|
756
|
-
# line 1 "NONE"
|
757
|
-
begin
|
758
|
-
te = p+1
|
759
|
-
end
|
760
|
-
# line 60 "template.rl"
|
761
|
-
begin
|
762
|
-
act = 6; end
|
763
|
-
when 18 then
|
764
|
-
# line 48 "template.rl"
|
765
|
-
begin
|
766
|
+
# line 60 "template.rl"
|
767
|
+
begin
|
768
|
+
act = 6; end
|
769
|
+
when 18 then
|
770
|
+
# line 48 "template.rl"
|
771
|
+
begin
|
766
772
|
|
767
773
|
expression_end = p
|
768
|
-
|
769
|
-
|
770
|
-
|
774
|
+
end
|
775
|
+
# line 52 "template.rl"
|
776
|
+
begin
|
771
777
|
|
772
778
|
delegate.expression(data.byteslice(expression_begin...expression_end))
|
779
|
+
end
|
780
|
+
# line 21 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/template.rl"
|
781
|
+
begin
|
782
|
+
cs = 43; end
|
783
|
+
# line 784 "template.rb"
|
773
784
|
end
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
# line 784 "template.rb"
|
778
|
-
end
|
779
|
-
end
|
780
|
-
end
|
781
|
-
if _goto_level <= _again
|
785
|
+
end
|
786
|
+
end
|
787
|
+
if _goto_level <= _again
|
782
788
|
case _template_to_state_actions[cs]
|
783
789
|
when 12 then
|
784
|
-
|
790
|
+
# line 1 "NONE"
|
785
791
|
begin
|
786
|
-
|
787
|
-
|
792
|
+
ts = nil; end
|
793
|
+
# line 794 "template.rb"
|
788
794
|
end
|
789
795
|
|
790
796
|
if cs == 0
|
@@ -796,43 +802,45 @@ if _goto_level <= _again
|
|
796
802
|
_goto_level = _resume
|
797
803
|
next
|
798
804
|
end
|
799
|
-
end
|
800
|
-
if _goto_level <= _test_eof
|
805
|
+
end
|
806
|
+
if _goto_level <= _test_eof
|
801
807
|
if p == eof
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
808
|
+
if _template_eof_trans[cs] > 0
|
809
|
+
_trans = _template_eof_trans[cs] - 1;
|
810
|
+
_goto_level = _eof_trans
|
811
|
+
next;
|
812
|
+
end
|
813
|
+
case _template_eof_actions[cs]
|
814
|
+
when 9 then
|
815
|
+
# line 40 "template.rl"
|
816
|
+
begin
|
811
817
|
|
812
|
-
|
818
|
+
raise ParseError.new("failed to parse instruction", buffer, p)
|
813
819
|
end
|
814
|
-
|
815
|
-
|
816
|
-
|
820
|
+
when 17 then
|
821
|
+
# line 56 "template.rl"
|
822
|
+
begin
|
817
823
|
|
818
|
-
|
824
|
+
raise ParseError.new("failed to parse expression", buffer, p)
|
819
825
|
end
|
820
|
-
|
821
|
-
|
826
|
+
# line 827 "template.rb"
|
827
|
+
end
|
822
828
|
end
|
823
829
|
|
830
|
+
end
|
831
|
+
if _goto_level <= _out
|
832
|
+
break
|
833
|
+
end
|
824
834
|
end
|
825
|
-
|
826
|
-
break
|
827
|
-
end
|
828
|
-
end
|
829
|
-
end
|
835
|
+
end
|
830
836
|
|
831
837
|
# line 89 "template.rl"
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
+
|
839
|
+
if p != eof
|
840
|
+
raise ParseError.new("could not consume all input", buffer, p)
|
841
|
+
end
|
842
|
+
|
843
|
+
return nil
|
844
|
+
end
|
845
|
+
end
|
838
846
|
end
|