xrb 0.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/bake/xrb/entities.rb +60 -0
  4. data/bake/xrb/parsers.rb +69 -0
  5. data/ext/extconf.rb +21 -0
  6. data/ext/xrb/escape.c +152 -0
  7. data/ext/xrb/escape.h +15 -0
  8. data/ext/xrb/markup.c +1949 -0
  9. data/ext/xrb/markup.h +6 -0
  10. data/ext/xrb/markup.rl +226 -0
  11. data/ext/xrb/query.c +619 -0
  12. data/ext/xrb/query.h +6 -0
  13. data/ext/xrb/query.rl +82 -0
  14. data/ext/xrb/tag.c +204 -0
  15. data/ext/xrb/tag.h +21 -0
  16. data/ext/xrb/template.c +1114 -0
  17. data/ext/xrb/template.h +6 -0
  18. data/ext/xrb/template.rl +77 -0
  19. data/ext/xrb/xrb.c +72 -0
  20. data/ext/xrb/xrb.h +132 -0
  21. data/lib/xrb/buffer.rb +103 -0
  22. data/lib/xrb/builder.rb +222 -0
  23. data/lib/xrb/entities.rb +2137 -0
  24. data/lib/xrb/entities.xrb +30 -0
  25. data/lib/xrb/error.rb +81 -0
  26. data/lib/xrb/fallback/markup.rb +1658 -0
  27. data/lib/xrb/fallback/markup.rl +228 -0
  28. data/lib/xrb/fallback/query.rb +548 -0
  29. data/lib/xrb/fallback/query.rl +88 -0
  30. data/lib/xrb/fallback/template.rb +829 -0
  31. data/lib/xrb/fallback/template.rl +80 -0
  32. data/lib/xrb/markup.rb +56 -0
  33. data/lib/xrb/native.rb +15 -0
  34. data/lib/xrb/parse_delegate.rb +19 -0
  35. data/lib/xrb/parsers.rb +17 -0
  36. data/lib/xrb/query.rb +80 -0
  37. data/lib/xrb/reference.rb +108 -0
  38. data/lib/xrb/strings.rb +47 -0
  39. data/lib/xrb/tag.rb +115 -0
  40. data/lib/xrb/template.rb +164 -0
  41. data/lib/xrb/uri.rb +100 -0
  42. data/lib/xrb/version.rb +8 -0
  43. data/lib/xrb.rb +11 -0
  44. data/license.md +23 -0
  45. data/readme.md +29 -0
  46. data.tar.gz.sig +0 -0
  47. metadata +109 -58
  48. metadata.gz.sig +0 -0
  49. data/README +0 -60
  50. data/app/helpers/ui_helper.rb +0 -80
  51. data/app/models/xrb/element.rb +0 -9
  52. data/lib/xrb/engine.rb +0 -4
  53. data/rails/init.rb +0 -1
  54. data/xrb.gemspec +0 -12
@@ -0,0 +1,829 @@
1
+
2
+ # line 1 "template.rl"
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2024, by Samuel Williams.
5
+
6
+
7
+ # line 51 "template.rl"
8
+
9
+
10
+ require_relative '../error'
11
+
12
+ module XRB
13
+ module Fallback
14
+
15
+ # line 16 "template.rb"
16
+ class << self
17
+ attr_accessor :_template_trans_keys
18
+ private :_template_trans_keys, :_template_trans_keys=
19
+ end
20
+ self._template_trans_keys = [
21
+ 0, 0, 10, 60, 123, 123,
22
+ 63, 63, 123, 123, 63,
23
+ 63, 63, 63, 114, 114,
24
+ 9, 32, 63, 63, 62, 62,
25
+ 9, 32, 123, 123, 63,
26
+ 63, 0, 127, 0, 127,
27
+ 63, 63, 62, 62, 0, 127,
28
+ 63, 63, 62, 62, 34,
29
+ 125, 34, 35, 35, 125,
30
+ 35, 125, 34, 39, 35, 125,
31
+ 35, 125, 34, 123, 34,
32
+ 123, 39, 39, 34, 125,
33
+ 34, 125, 34, 35, 35, 125,
34
+ 35, 125, 34, 39, 35,
35
+ 125, 35, 125, 34, 123,
36
+ 34, 123, 39, 39, 34, 125,
37
+ 9, 60, 10, 60, 10,
38
+ 60, 9, 60, 0, 0,
39
+ 9, 32, 34, 39, 34, 35,
40
+ 39, 39, 0, 0, 34,
41
+ 39, 34, 35, 39, 39,
42
+ 0, 0, 0
43
+ ]
44
+
45
+ class << self
46
+ attr_accessor :_template_key_spans
47
+ private :_template_key_spans, :_template_key_spans=
48
+ end
49
+ self._template_key_spans = [
50
+ 0, 51, 1, 1, 1, 1, 1, 1,
51
+ 24, 1, 1, 24, 1, 1, 128, 128,
52
+ 1, 1, 128, 1, 1, 92, 2, 91,
53
+ 91, 6, 91, 91, 90, 90, 1, 92,
54
+ 92, 2, 91, 91, 6, 91, 91, 90,
55
+ 90, 1, 92, 52, 51, 51, 52, 0,
56
+ 24, 6, 2, 1, 0, 6, 2, 1,
57
+ 0
58
+ ]
59
+
60
+ class << self
61
+ attr_accessor :_template_index_offsets
62
+ private :_template_index_offsets, :_template_index_offsets=
63
+ end
64
+ self._template_index_offsets = [
65
+ 0, 0, 52, 54, 56, 58, 60, 62,
66
+ 64, 89, 91, 93, 118, 120, 122, 251,
67
+ 380, 382, 384, 513, 515, 517, 610, 613,
68
+ 705, 797, 804, 896, 988, 1079, 1170, 1172,
69
+ 1265, 1358, 1361, 1453, 1545, 1552, 1644, 1736,
70
+ 1827, 1918, 1920, 2013, 2066, 2118, 2170, 2223,
71
+ 2224, 2249, 2256, 2259, 2261, 2262, 2269, 2272,
72
+ 2274
73
+ ]
74
+
75
+ class << self
76
+ attr_accessor :_template_indicies
77
+ private :_template_indicies, :_template_indicies=
78
+ end
79
+ self._template_indicies = [
80
+ 2, 1, 1, 1, 1, 1, 1, 1,
81
+ 1, 1, 1, 1, 1, 1, 1, 1,
82
+ 1, 1, 1, 1, 1, 1, 1, 1,
83
+ 1, 3, 1, 1, 1, 1, 1, 1,
84
+ 1, 1, 1, 1, 1, 1, 1, 1,
85
+ 1, 1, 1, 1, 1, 1, 1, 1,
86
+ 1, 1, 4, 1, 0, 1, 0, 1,
87
+ 5, 6, 5, 6, 7, 6, 8, 5,
88
+ 10, 10, 10, 10, 10, 5, 5, 5,
89
+ 5, 5, 5, 5, 5, 5, 5, 5,
90
+ 5, 5, 5, 5, 5, 5, 5, 10,
91
+ 5, 12, 11, 13, 11, 13, 15, 13,
92
+ 13, 13, 14, 14, 14, 14, 14, 14,
93
+ 14, 14, 14, 14, 14, 14, 14, 14,
94
+ 14, 14, 14, 14, 13, 14, 16, 6,
95
+ 17, 6, 19, 19, 19, 19, 19, 19,
96
+ 19, 19, 19, 19, 19, 19, 19, 19,
97
+ 19, 19, 19, 19, 19, 19, 19, 19,
98
+ 19, 19, 19, 19, 19, 19, 19, 19,
99
+ 19, 19, 19, 19, 19, 19, 19, 19,
100
+ 19, 19, 19, 19, 19, 19, 19, 18,
101
+ 18, 19, 18, 18, 18, 18, 18, 18,
102
+ 18, 18, 18, 18, 18, 19, 19, 19,
103
+ 19, 19, 19, 18, 18, 18, 18, 18,
104
+ 18, 18, 18, 18, 18, 18, 18, 18,
105
+ 18, 18, 18, 18, 18, 18, 18, 18,
106
+ 18, 18, 18, 18, 18, 19, 19, 19,
107
+ 19, 18, 19, 18, 18, 18, 18, 18,
108
+ 18, 18, 18, 18, 18, 18, 18, 18,
109
+ 18, 18, 18, 18, 20, 18, 18, 18,
110
+ 18, 18, 18, 18, 18, 19, 19, 19,
111
+ 19, 19, 18, 19, 19, 19, 19, 19,
112
+ 19, 19, 19, 19, 21, 21, 21, 21,
113
+ 21, 19, 19, 19, 19, 19, 19, 19,
114
+ 19, 19, 19, 19, 19, 19, 19, 19,
115
+ 19, 19, 19, 21, 19, 19, 19, 19,
116
+ 19, 19, 19, 19, 19, 19, 19, 19,
117
+ 18, 18, 19, 18, 18, 18, 18, 18,
118
+ 18, 18, 18, 18, 18, 18, 19, 19,
119
+ 19, 19, 19, 19, 18, 18, 18, 18,
120
+ 18, 18, 18, 18, 18, 18, 18, 18,
121
+ 18, 18, 18, 18, 18, 18, 18, 18,
122
+ 18, 18, 18, 18, 18, 18, 19, 19,
123
+ 19, 19, 18, 19, 18, 18, 18, 18,
124
+ 18, 18, 18, 18, 18, 18, 18, 18,
125
+ 18, 18, 18, 18, 18, 18, 18, 18,
126
+ 18, 18, 18, 18, 18, 18, 19, 19,
127
+ 19, 19, 19, 18, 22, 21, 23, 21,
128
+ 19, 19, 19, 19, 19, 19, 19, 19,
129
+ 19, 24, 24, 24, 24, 24, 19, 19,
130
+ 19, 19, 19, 19, 19, 19, 19, 19,
131
+ 19, 19, 19, 19, 19, 19, 19, 19,
132
+ 24, 19, 19, 19, 19, 19, 19, 19,
133
+ 19, 19, 19, 19, 19, 18, 18, 19,
134
+ 18, 18, 18, 18, 18, 18, 18, 18,
135
+ 18, 18, 18, 19, 19, 19, 19, 19,
136
+ 19, 18, 18, 18, 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, 19, 19, 19, 19, 18,
140
+ 19, 18, 18, 18, 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, 19, 19, 19, 19, 19,
144
+ 18, 26, 25, 27, 25, 29, 28, 28,
145
+ 28, 28, 30, 28, 28, 28, 28, 28,
146
+ 28, 28, 28, 28, 28, 28, 28, 28,
147
+ 28, 28, 28, 28, 28, 28, 28, 28,
148
+ 28, 28, 28, 28, 28, 28, 28, 28,
149
+ 28, 28, 28, 28, 28, 28, 28, 28,
150
+ 28, 28, 28, 28, 28, 28, 28, 28,
151
+ 28, 28, 28, 28, 28, 28, 28, 28,
152
+ 28, 28, 28, 28, 28, 28, 28, 28,
153
+ 28, 28, 28, 28, 28, 28, 28, 28,
154
+ 28, 28, 28, 28, 28, 28, 28, 28,
155
+ 28, 28, 28, 28, 28, 28, 31, 28,
156
+ 32, 28, 33, 34, 29, 35, 33, 33,
157
+ 33, 36, 33, 33, 33, 33, 33, 33,
158
+ 33, 33, 33, 33, 33, 33, 33, 33,
159
+ 33, 33, 33, 33, 33, 33, 33, 33,
160
+ 33, 33, 33, 33, 33, 33, 33, 33,
161
+ 33, 33, 33, 33, 33, 33, 33, 33,
162
+ 33, 33, 33, 33, 33, 33, 33, 33,
163
+ 33, 33, 33, 33, 33, 33, 33, 33,
164
+ 33, 33, 33, 33, 33, 33, 33, 33,
165
+ 33, 33, 33, 33, 33, 33, 33, 33,
166
+ 33, 33, 33, 33, 33, 33, 33, 33,
167
+ 33, 33, 33, 33, 33, 37, 33, 38,
168
+ 33, 35, 33, 33, 33, 36, 33, 33,
169
+ 33, 33, 33, 33, 33, 33, 33, 33,
170
+ 33, 33, 33, 33, 33, 33, 33, 33,
171
+ 33, 33, 33, 33, 33, 33, 33, 33,
172
+ 33, 33, 33, 33, 33, 33, 33, 33,
173
+ 33, 33, 33, 33, 33, 33, 33, 33,
174
+ 33, 33, 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, 39, 33, 38, 33, 40, 41, 36,
180
+ 36, 36, 40, 36, 42, 40, 40, 40,
181
+ 40, 40, 40, 40, 40, 40, 40, 40,
182
+ 40, 40, 40, 40, 40, 40, 40, 40,
183
+ 40, 40, 40, 40, 40, 40, 40, 40,
184
+ 40, 40, 40, 40, 40, 40, 40, 40,
185
+ 40, 40, 40, 40, 40, 40, 40, 40,
186
+ 40, 40, 40, 40, 40, 40, 40, 40,
187
+ 40, 40, 40, 40, 40, 40, 40, 40,
188
+ 40, 40, 40, 40, 40, 40, 40, 40,
189
+ 40, 40, 40, 40, 40, 40, 40, 40,
190
+ 40, 40, 40, 40, 40, 40, 40, 40,
191
+ 40, 40, 40, 40, 43, 40, 44, 40,
192
+ 42, 40, 40, 40, 40, 40, 40, 40,
193
+ 40, 40, 40, 40, 40, 40, 40, 40,
194
+ 40, 40, 40, 40, 40, 40, 40, 40,
195
+ 40, 40, 40, 40, 40, 40, 40, 40,
196
+ 40, 40, 40, 40, 40, 40, 40, 40,
197
+ 40, 40, 40, 40, 40, 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
+ 45, 40, 44, 40, 40, 41, 36, 36,
204
+ 36, 40, 36, 36, 36, 36, 36, 36,
205
+ 36, 36, 36, 36, 36, 36, 36, 36,
206
+ 36, 36, 36, 36, 36, 36, 36, 36,
207
+ 36, 36, 36, 36, 36, 36, 36, 36,
208
+ 36, 36, 36, 36, 36, 36, 36, 36,
209
+ 36, 36, 36, 36, 36, 36, 36, 36,
210
+ 36, 36, 36, 36, 36, 36, 36, 36,
211
+ 36, 36, 36, 36, 36, 36, 36, 36,
212
+ 36, 36, 36, 36, 36, 36, 36, 36,
213
+ 36, 36, 36, 36, 36, 36, 36, 36,
214
+ 36, 36, 36, 36, 36, 46, 36, 33,
215
+ 34, 29, 29, 29, 29, 29, 29, 29,
216
+ 29, 29, 29, 29, 29, 29, 29, 29,
217
+ 29, 29, 29, 29, 29, 29, 29, 29,
218
+ 29, 29, 29, 29, 29, 29, 29, 29,
219
+ 29, 29, 29, 29, 29, 29, 29, 29,
220
+ 29, 29, 29, 29, 29, 29, 29, 29,
221
+ 29, 29, 29, 29, 29, 29, 29, 29,
222
+ 29, 29, 29, 29, 29, 29, 29, 29,
223
+ 29, 29, 29, 29, 29, 29, 29, 29,
224
+ 29, 29, 29, 29, 29, 29, 29, 29,
225
+ 29, 29, 29, 29, 29, 29, 29, 29,
226
+ 47, 29, 48, 30, 36, 48, 48, 48,
227
+ 48, 48, 48, 48, 48, 48, 48, 48,
228
+ 48, 48, 48, 48, 48, 48, 48, 48,
229
+ 48, 48, 48, 48, 48, 48, 48, 48,
230
+ 48, 48, 48, 48, 48, 48, 48, 48,
231
+ 48, 48, 48, 48, 48, 48, 48, 48,
232
+ 48, 48, 48, 48, 48, 48, 48, 48,
233
+ 48, 48, 48, 48, 48, 48, 48, 48,
234
+ 48, 48, 48, 48, 48, 48, 48, 48,
235
+ 48, 48, 48, 48, 48, 48, 48, 48,
236
+ 48, 48, 48, 48, 48, 48, 48, 48,
237
+ 48, 48, 48, 48, 48, 49, 48, 50,
238
+ 48, 52, 51, 51, 51, 51, 53, 51,
239
+ 51, 51, 51, 51, 51, 51, 51, 51,
240
+ 51, 51, 51, 51, 51, 51, 51, 51,
241
+ 51, 51, 51, 51, 51, 51, 51, 51,
242
+ 51, 51, 51, 51, 51, 51, 51, 51,
243
+ 51, 51, 51, 51, 51, 51, 51, 51,
244
+ 51, 51, 51, 51, 51, 51, 51, 51,
245
+ 51, 51, 51, 51, 51, 51, 51, 51,
246
+ 51, 51, 51, 51, 51, 51, 51, 51,
247
+ 51, 51, 51, 51, 51, 51, 51, 51,
248
+ 51, 51, 51, 51, 51, 51, 51, 51,
249
+ 51, 51, 54, 51, 55, 51, 56, 57,
250
+ 52, 58, 56, 56, 56, 59, 56, 56,
251
+ 56, 56, 56, 56, 56, 56, 56, 56,
252
+ 56, 56, 56, 56, 56, 56, 56, 56,
253
+ 56, 56, 56, 56, 56, 56, 56, 56,
254
+ 56, 56, 56, 56, 56, 56, 56, 56,
255
+ 56, 56, 56, 56, 56, 56, 56, 56,
256
+ 56, 56, 56, 56, 56, 56, 56, 56,
257
+ 56, 56, 56, 56, 56, 56, 56, 56,
258
+ 56, 56, 56, 56, 56, 56, 56, 56,
259
+ 56, 56, 56, 56, 56, 56, 56, 56,
260
+ 56, 56, 56, 56, 56, 56, 56, 56,
261
+ 56, 60, 56, 61, 56, 58, 56, 56,
262
+ 56, 59, 56, 56, 56, 56, 56, 56,
263
+ 56, 56, 56, 56, 56, 56, 56, 56,
264
+ 56, 56, 56, 56, 56, 56, 56, 56,
265
+ 56, 56, 56, 56, 56, 56, 56, 56,
266
+ 56, 56, 56, 56, 56, 56, 56, 56,
267
+ 56, 56, 56, 56, 56, 56, 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, 62, 56, 61,
273
+ 56, 63, 64, 59, 59, 59, 63, 59,
274
+ 65, 63, 63, 63, 63, 63, 63, 63,
275
+ 63, 63, 63, 63, 63, 63, 63, 63,
276
+ 63, 63, 63, 63, 63, 63, 63, 63,
277
+ 63, 63, 63, 63, 63, 63, 63, 63,
278
+ 63, 63, 63, 63, 63, 63, 63, 63,
279
+ 63, 63, 63, 63, 63, 63, 63, 63,
280
+ 63, 63, 63, 63, 63, 63, 63, 63,
281
+ 63, 63, 63, 63, 63, 63, 63, 63,
282
+ 63, 63, 63, 63, 63, 63, 63, 63,
283
+ 63, 63, 63, 63, 63, 63, 63, 63,
284
+ 63, 63, 63, 63, 63, 63, 63, 63,
285
+ 66, 63, 67, 63, 65, 63, 63, 63,
286
+ 63, 63, 63, 63, 63, 63, 63, 63,
287
+ 63, 63, 63, 63, 63, 63, 63, 63,
288
+ 63, 63, 63, 63, 63, 63, 63, 63,
289
+ 63, 63, 63, 63, 63, 63, 63, 63,
290
+ 63, 63, 63, 63, 63, 63, 63, 63,
291
+ 63, 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, 68, 63, 67, 63,
297
+ 63, 64, 59, 59, 59, 63, 59, 59,
298
+ 59, 59, 59, 59, 59, 59, 59, 59,
299
+ 59, 59, 59, 59, 59, 59, 59, 59,
300
+ 59, 59, 59, 59, 59, 59, 59, 59,
301
+ 59, 59, 59, 59, 59, 59, 59, 59,
302
+ 59, 59, 59, 59, 59, 59, 59, 59,
303
+ 59, 59, 59, 59, 59, 59, 59, 59,
304
+ 59, 59, 59, 59, 59, 59, 59, 59,
305
+ 59, 59, 59, 59, 59, 59, 59, 59,
306
+ 59, 59, 59, 59, 59, 59, 59, 59,
307
+ 59, 59, 59, 59, 59, 59, 59, 59,
308
+ 59, 69, 59, 56, 57, 52, 52, 52,
309
+ 52, 52, 52, 52, 52, 52, 52, 52,
310
+ 52, 52, 52, 52, 52, 52, 52, 52,
311
+ 52, 52, 52, 52, 52, 52, 52, 52,
312
+ 52, 52, 52, 52, 52, 52, 52, 52,
313
+ 52, 52, 52, 52, 52, 52, 52, 52,
314
+ 52, 52, 52, 52, 52, 52, 52, 52,
315
+ 52, 52, 52, 52, 52, 52, 52, 52,
316
+ 52, 52, 52, 52, 52, 52, 52, 52,
317
+ 52, 52, 52, 52, 52, 52, 52, 52,
318
+ 52, 52, 52, 52, 52, 52, 52, 52,
319
+ 52, 52, 52, 52, 70, 52, 71, 53,
320
+ 59, 71, 71, 71, 71, 71, 71, 71,
321
+ 71, 71, 71, 71, 71, 71, 71, 71,
322
+ 71, 71, 71, 71, 71, 71, 71, 71,
323
+ 71, 71, 71, 71, 71, 71, 71, 71,
324
+ 71, 71, 71, 71, 71, 71, 71, 71,
325
+ 71, 71, 71, 71, 71, 71, 71, 71,
326
+ 71, 71, 71, 71, 71, 71, 71, 71,
327
+ 71, 71, 71, 71, 71, 71, 71, 71,
328
+ 71, 71, 71, 71, 71, 71, 71, 71,
329
+ 71, 71, 71, 71, 71, 71, 71, 71,
330
+ 71, 71, 71, 71, 71, 71, 71, 71,
331
+ 71, 72, 71, 73, 71, 74, 2, 74,
332
+ 74, 74, 6, 6, 6, 6, 6, 6,
333
+ 6, 6, 6, 6, 6, 6, 6, 6,
334
+ 6, 6, 6, 6, 74, 6, 6, 75,
335
+ 6, 6, 6, 6, 6, 6, 6, 6,
336
+ 6, 6, 6, 6, 6, 6, 6, 6,
337
+ 6, 6, 6, 6, 6, 6, 6, 6,
338
+ 76, 6, 2, 6, 6, 6, 6, 6,
339
+ 6, 6, 6, 6, 6, 6, 6, 6,
340
+ 6, 6, 6, 6, 6, 6, 6, 6,
341
+ 6, 6, 6, 78, 6, 6, 6, 6,
342
+ 6, 6, 6, 6, 6, 6, 6, 6,
343
+ 6, 6, 6, 6, 6, 6, 6, 6,
344
+ 6, 6, 6, 6, 79, 6, 2, 1,
345
+ 1, 1, 1, 1, 1, 1, 1, 1,
346
+ 1, 1, 1, 1, 1, 1, 1, 1,
347
+ 1, 1, 1, 1, 1, 1, 1, 3,
348
+ 1, 1, 1, 1, 1, 1, 1, 1,
349
+ 1, 1, 1, 1, 1, 1, 1, 1,
350
+ 1, 1, 1, 1, 1, 1, 1, 1,
351
+ 4, 1, 74, 2, 74, 74, 74, 6,
352
+ 6, 6, 6, 6, 6, 6, 6, 6,
353
+ 6, 6, 6, 6, 6, 6, 6, 6,
354
+ 6, 74, 6, 6, 78, 6, 6, 6,
355
+ 6, 6, 6, 6, 6, 6, 6, 6,
356
+ 6, 6, 6, 6, 6, 6, 6, 6,
357
+ 6, 6, 6, 6, 6, 81, 6, 82,
358
+ 13, 15, 13, 13, 13, 83, 83, 83,
359
+ 83, 83, 83, 83, 83, 83, 83, 83,
360
+ 83, 83, 83, 83, 83, 83, 83, 13,
361
+ 83, 40, 41, 36, 36, 36, 40, 36,
362
+ 33, 34, 29, 48, 30, 84, 63, 64,
363
+ 59, 59, 59, 63, 59, 56, 57, 52,
364
+ 71, 53, 84, 0
365
+ ]
366
+
367
+ class << self
368
+ attr_accessor :_template_trans_targs
369
+ private :_template_trans_targs, :_template_trans_targs=
370
+ end
371
+ self._template_trans_targs = [
372
+ 43, 1, 45, 2, 3, 43, 44, 7,
373
+ 8, 43, 9, 9, 10, 11, 43, 43,
374
+ 47, 14, 15, 0, 18, 16, 17, 43,
375
+ 19, 19, 20, 48, 21, 22, 30, 21,
376
+ 52, 23, 29, 24, 25, 23, 50, 23,
377
+ 26, 28, 27, 26, 49, 26, 25, 22,
378
+ 31, 31, 51, 32, 33, 41, 32, 56,
379
+ 34, 40, 35, 36, 34, 54, 34, 37,
380
+ 39, 38, 37, 53, 37, 36, 33, 42,
381
+ 42, 55, 46, 12, 13, 43, 4, 5,
382
+ 43, 6, 43, 43, 0
383
+ ]
384
+
385
+ class << self
386
+ attr_accessor :_template_trans_actions
387
+ private :_template_trans_actions, :_template_trans_actions=
388
+ end
389
+ self._template_trans_actions = [
390
+ 1, 0, 2, 0, 0, 3, 2, 0,
391
+ 0, 4, 5, 0, 6, 0, 7, 8,
392
+ 0, 0, 0, 9, 0, 0, 0, 10,
393
+ 5, 0, 6, 11, 0, 0, 0, 13,
394
+ 14, 0, 0, 0, 0, 13, 14, 15,
395
+ 0, 0, 0, 13, 14, 15, 16, 16,
396
+ 0, 13, 14, 0, 0, 0, 13, 18,
397
+ 0, 0, 0, 0, 13, 18, 15, 0,
398
+ 0, 0, 13, 18, 15, 16, 16, 0,
399
+ 13, 18, 20, 0, 0, 21, 0, 0,
400
+ 22, 0, 23, 24, 0
401
+ ]
402
+
403
+ class << self
404
+ attr_accessor :_template_to_state_actions
405
+ private :_template_to_state_actions, :_template_to_state_actions=
406
+ end
407
+ self._template_to_state_actions = [
408
+ 0, 0, 0, 0, 0, 0, 0, 0,
409
+ 0, 0, 0, 0, 0, 0, 0, 0,
410
+ 0, 0, 0, 0, 0, 12, 12, 12,
411
+ 0, 12, 12, 0, 0, 0, 0, 12,
412
+ 12, 12, 12, 0, 12, 12, 0, 0,
413
+ 0, 0, 12, 12, 0, 0, 0, 0,
414
+ 0, 0, 0, 0, 0, 0, 0, 0,
415
+ 0
416
+ ]
417
+
418
+ class << self
419
+ attr_accessor :_template_from_state_actions
420
+ private :_template_from_state_actions, :_template_from_state_actions=
421
+ end
422
+ self._template_from_state_actions = [
423
+ 0, 0, 0, 0, 0, 0, 0, 0,
424
+ 0, 0, 0, 0, 0, 0, 0, 0,
425
+ 0, 0, 0, 0, 0, 0, 0, 0,
426
+ 0, 0, 0, 0, 0, 0, 0, 0,
427
+ 0, 0, 0, 0, 0, 0, 0, 0,
428
+ 0, 0, 0, 19, 0, 0, 0, 0,
429
+ 0, 0, 0, 0, 0, 0, 0, 0,
430
+ 0
431
+ ]
432
+
433
+ class << self
434
+ attr_accessor :_template_eof_actions
435
+ private :_template_eof_actions, :_template_eof_actions=
436
+ end
437
+ self._template_eof_actions = [
438
+ 0, 0, 0, 0, 0, 0, 0, 0,
439
+ 0, 0, 0, 0, 0, 0, 9, 9,
440
+ 9, 9, 9, 9, 9, 0, 0, 0,
441
+ 0, 0, 0, 0, 0, 0, 0, 0,
442
+ 17, 17, 17, 17, 17, 17, 17, 17,
443
+ 17, 17, 17, 0, 0, 0, 0, 0,
444
+ 0, 0, 0, 0, 0, 0, 0, 0,
445
+ 0
446
+ ]
447
+
448
+ class << self
449
+ attr_accessor :_template_eof_trans
450
+ private :_template_eof_trans, :_template_eof_trans=
451
+ end
452
+ self._template_eof_trans = [
453
+ 0, 1, 1, 1, 6, 6, 6, 6,
454
+ 10, 10, 10, 15, 0, 0, 0, 0,
455
+ 0, 0, 0, 0, 0, 0, 0, 0,
456
+ 0, 0, 0, 0, 0, 0, 0, 0,
457
+ 0, 0, 0, 0, 0, 0, 0, 0,
458
+ 0, 0, 0, 0, 78, 81, 78, 83,
459
+ 84, 0, 0, 0, 0, 0, 0, 0,
460
+ 0
461
+ ]
462
+
463
+ class << self
464
+ attr_accessor :template_start
465
+ end
466
+ self.template_start = 43;
467
+ class << self
468
+ attr_accessor :template_first_final
469
+ end
470
+ self.template_first_final = 43;
471
+ class << self
472
+ attr_accessor :template_error
473
+ end
474
+ self.template_error = 0;
475
+
476
+ class << self
477
+ attr_accessor :template_en_parse_nested_expression
478
+ end
479
+ self.template_en_parse_nested_expression = 21;
480
+ class << self
481
+ attr_accessor :template_en_parse_expression
482
+ end
483
+ self.template_en_parse_expression = 32;
484
+ class << self
485
+ attr_accessor :template_en_main
486
+ end
487
+ self.template_en_main = 43;
488
+
489
+
490
+ # line 58 "template.rl"
491
+
492
+ def self.parse_template(buffer, delegate)
493
+ data = buffer.read
494
+ bytes = data.bytes
495
+
496
+ p = 0
497
+ pe = eof = data.bytesize
498
+ stack = []
499
+
500
+ expression_begin = expression_end = nil
501
+ instruction_begin = instruction_end = nil
502
+
503
+
504
+ # line 505 "template.rb"
505
+ begin
506
+ p ||= 0
507
+ pe ||= data.length
508
+ cs = template_start
509
+ top = 0
510
+ ts = nil
511
+ te = nil
512
+ act = 0
513
+ end
514
+
515
+ # line 71 "template.rl"
516
+
517
+ # line 518 "template.rb"
518
+ begin
519
+ testEof = false
520
+ _slen, _trans, _keys, _inds, _acts, _nacts = nil
521
+ _goto_level = 0
522
+ _resume = 10
523
+ _eof_trans = 15
524
+ _again = 20
525
+ _test_eof = 30
526
+ _out = 40
527
+ while true
528
+ if _goto_level <= 0
529
+ if p == pe
530
+ _goto_level = _test_eof
531
+ next
532
+ end
533
+ if cs == 0
534
+ _goto_level = _out
535
+ next
536
+ end
537
+ end
538
+ if _goto_level <= _resume
539
+ case _template_from_state_actions[cs]
540
+ when 19 then
541
+ # line 1 "NONE"
542
+ begin
543
+ ts = p
544
+ end
545
+ # line 546 "template.rb"
546
+ end
547
+ _keys = cs << 1
548
+ _inds = _template_index_offsets[cs]
549
+ _slen = _template_key_spans[cs]
550
+ _wide = ( bytes[p])
551
+ _trans = if ( _slen > 0 &&
552
+ _template_trans_keys[_keys] <= _wide &&
553
+ _wide <= _template_trans_keys[_keys + 1]
554
+ ) then
555
+ _template_indicies[ _inds + _wide - _template_trans_keys[_keys] ]
556
+ else
557
+ _template_indicies[ _inds + _slen ]
558
+ end
559
+ end
560
+ if _goto_level <= _eof_trans
561
+ cs = _template_trans_targs[_trans]
562
+ if _template_trans_actions[_trans] != 0
563
+ case _template_trans_actions[_trans]
564
+ when 5 then
565
+ # line 7 "template.rl"
566
+ begin
567
+
568
+ instruction_begin = p
569
+ end
570
+ when 6 then
571
+ # line 11 "template.rl"
572
+ begin
573
+
574
+ instruction_end = p
575
+ end
576
+ when 9 then
577
+ # line 23 "template.rl"
578
+ begin
579
+
580
+ raise ParseError.new("failed to parse instruction", buffer, p)
581
+ end
582
+ when 16 then
583
+ # line 13 "/home/samuel/Projects/socketry/xrb/parsers/xrb/template.rl"
584
+ begin
585
+ begin
586
+ stack[top] = cs
587
+ top+= 1
588
+ cs = 21
589
+ _goto_level = _again
590
+ next
591
+ end
592
+ end
593
+ when 13 then
594
+ # line 17 "/home/samuel/Projects/socketry/xrb/parsers/xrb/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 14 then
605
+ # line 20 "/home/samuel/Projects/socketry/xrb/parsers/xrb/template.rl"
606
+ begin
607
+ begin
608
+ top -= 1
609
+ cs = stack[top]
610
+ _goto_level = _again
611
+ next
612
+ end
613
+ end
614
+ when 2 then
615
+ # line 1 "NONE"
616
+ begin
617
+ te = p+1
618
+ end
619
+ when 8 then
620
+ # line 19 "template.rl"
621
+ begin
622
+ te = p+1
623
+ begin
624
+ delegate.instruction(data.byteslice(instruction_begin...instruction_end), "\n")
625
+ end
626
+ end
627
+ when 10 then
628
+ # line 43 "template.rl"
629
+ begin
630
+ te = p+1
631
+ begin
632
+ delegate.text(data.byteslice(ts...te))
633
+ end
634
+ end
635
+ when 22 then
636
+ # line 43 "template.rl"
637
+ begin
638
+ te = p
639
+ p = p - 1; begin
640
+ delegate.text(data.byteslice(ts...te))
641
+ end
642
+ end
643
+ when 24 then
644
+ # line 15 "template.rl"
645
+ begin
646
+ te = p
647
+ p = p - 1; begin
648
+ delegate.instruction(data.byteslice(instruction_begin...instruction_end))
649
+ end
650
+ end
651
+ when 21 then
652
+ # line 43 "template.rl"
653
+ begin
654
+ te = p
655
+ p = p - 1; begin
656
+ delegate.text(data.byteslice(ts...te))
657
+ end
658
+ end
659
+ when 1 then
660
+ # line 43 "template.rl"
661
+ begin
662
+ begin p = ((te))-1; end
663
+ begin
664
+ delegate.text(data.byteslice(ts...te))
665
+ end
666
+ end
667
+ when 3 then
668
+ # line 43 "template.rl"
669
+ begin
670
+ begin p = ((te))-1; end
671
+ begin
672
+ delegate.text(data.byteslice(ts...te))
673
+ end
674
+ end
675
+ when 7 then
676
+ # line 1 "NONE"
677
+ begin
678
+ case act
679
+ when 3 then
680
+ begin begin p = ((te))-1; end
681
+
682
+ delegate.instruction(data.byteslice(instruction_begin...instruction_end))
683
+ end
684
+ when 6 then
685
+ begin begin p = ((te))-1; end
686
+
687
+ delegate.text(data.byteslice(ts...te))
688
+ end
689
+ end
690
+ end
691
+ when 4 then
692
+ # line 23 "template.rl"
693
+ begin
694
+
695
+ raise ParseError.new("failed to parse instruction", buffer, p)
696
+ end
697
+ # line 43 "template.rl"
698
+ begin
699
+ begin p = ((te))-1; end
700
+ begin
701
+ delegate.text(data.byteslice(ts...te))
702
+ end
703
+ end
704
+ when 23 then
705
+ # line 27 "template.rl"
706
+ begin
707
+
708
+ expression_begin = p
709
+ end
710
+ # line 53 "/home/samuel/Projects/socketry/xrb/parsers/xrb/template.rl"
711
+ begin
712
+ te = p
713
+ p = p - 1; begin cs = 32; end
714
+ end
715
+ when 15 then
716
+ # line 13 "/home/samuel/Projects/socketry/xrb/parsers/xrb/template.rl"
717
+ begin
718
+ begin
719
+ stack[top] = cs
720
+ top+= 1
721
+ cs = 21
722
+ _goto_level = _again
723
+ next
724
+ end
725
+ end
726
+ # line 17 "/home/samuel/Projects/socketry/xrb/parsers/xrb/template.rl"
727
+ begin
728
+ begin
729
+ stack[top] = cs
730
+ top+= 1
731
+ cs = 21
732
+ _goto_level = _again
733
+ next
734
+ end
735
+ end
736
+ when 11 then
737
+ # line 1 "NONE"
738
+ begin
739
+ te = p+1
740
+ end
741
+ # line 15 "template.rl"
742
+ begin
743
+ act = 3; end
744
+ when 20 then
745
+ # line 1 "NONE"
746
+ begin
747
+ te = p+1
748
+ end
749
+ # line 43 "template.rl"
750
+ begin
751
+ act = 6; end
752
+ when 18 then
753
+ # line 31 "template.rl"
754
+ begin
755
+
756
+ expression_end = p
757
+ end
758
+ # line 35 "template.rl"
759
+ begin
760
+
761
+ delegate.expression(data.byteslice(expression_begin...expression_end))
762
+ end
763
+ # line 21 "/home/samuel/Projects/socketry/xrb/parsers/xrb/template.rl"
764
+ begin
765
+ cs = 43; end
766
+ # line 767 "template.rb"
767
+ end
768
+ end
769
+ end
770
+ if _goto_level <= _again
771
+ case _template_to_state_actions[cs]
772
+ when 12 then
773
+ # line 1 "NONE"
774
+ begin
775
+ ts = nil; end
776
+ # line 777 "template.rb"
777
+ end
778
+
779
+ if cs == 0
780
+ _goto_level = _out
781
+ next
782
+ end
783
+ p += 1
784
+ if p != pe
785
+ _goto_level = _resume
786
+ next
787
+ end
788
+ end
789
+ if _goto_level <= _test_eof
790
+ if p == eof
791
+ if _template_eof_trans[cs] > 0
792
+ _trans = _template_eof_trans[cs] - 1;
793
+ _goto_level = _eof_trans
794
+ next;
795
+ end
796
+ case _template_eof_actions[cs]
797
+ when 9 then
798
+ # line 23 "template.rl"
799
+ begin
800
+
801
+ raise ParseError.new("failed to parse instruction", buffer, p)
802
+ end
803
+ when 17 then
804
+ # line 39 "template.rl"
805
+ begin
806
+
807
+ raise ParseError.new("failed to parse expression", buffer, p)
808
+ end
809
+ # line 810 "template.rb"
810
+ end
811
+ end
812
+
813
+ end
814
+ if _goto_level <= _out
815
+ break
816
+ end
817
+ end
818
+ end
819
+
820
+ # line 72 "template.rl"
821
+
822
+ if p != eof
823
+ raise ParseError.new("could not consume all input", buffer, p)
824
+ end
825
+
826
+ return nil
827
+ end
828
+ end
829
+ end