xrb 0.1 → 0.3.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 +7 -0
- checksums.yaml.gz.sig +1 -0
- data/bake/xrb/entities.rb +60 -0
- data/bake/xrb/parsers.rb +66 -0
- data/ext/Makefile +270 -0
- data/ext/XRB_Extension.bundle +0 -0
- data/ext/escape.o +0 -0
- data/ext/extconf.h +5 -0
- data/ext/extconf.rb +21 -0
- data/ext/markup.o +0 -0
- data/ext/mkmf.log +122 -0
- data/ext/query.o +0 -0
- data/ext/tag.o +0 -0
- data/ext/template.o +0 -0
- data/ext/xrb/escape.c +152 -0
- data/ext/xrb/escape.h +15 -0
- data/ext/xrb/markup.c +1949 -0
- data/ext/xrb/markup.h +6 -0
- data/ext/xrb/markup.rl +226 -0
- data/ext/xrb/query.c +619 -0
- data/ext/xrb/query.h +6 -0
- data/ext/xrb/query.rl +82 -0
- data/ext/xrb/tag.c +204 -0
- data/ext/xrb/tag.h +21 -0
- data/ext/xrb/template.c +1114 -0
- data/ext/xrb/template.h +6 -0
- data/ext/xrb/template.rl +77 -0
- data/ext/xrb/xrb.c +72 -0
- data/ext/xrb/xrb.h +132 -0
- data/ext/xrb.o +0 -0
- data/lib/xrb/buffer.rb +103 -0
- data/lib/xrb/builder.rb +229 -0
- data/lib/xrb/entities.rb +2137 -0
- data/lib/xrb/entities.xrb +15 -0
- data/lib/xrb/error.rb +81 -0
- data/lib/xrb/fallback/markup.rb +1657 -0
- data/lib/xrb/fallback/markup.rl +227 -0
- data/lib/xrb/fallback/query.rb +548 -0
- data/lib/xrb/fallback/query.rl +88 -0
- data/lib/xrb/fallback/template.rb +829 -0
- data/lib/xrb/fallback/template.rl +80 -0
- data/lib/xrb/markup.rb +56 -0
- data/lib/xrb/native.rb +15 -0
- data/lib/xrb/parsers.rb +16 -0
- data/lib/xrb/query.rb +80 -0
- data/lib/xrb/reference.rb +108 -0
- data/lib/xrb/strings.rb +47 -0
- data/lib/xrb/tag.rb +115 -0
- data/lib/xrb/template.rb +128 -0
- data/lib/xrb/uri.rb +100 -0
- data/lib/xrb/version.rb +8 -0
- data/lib/xrb.rb +11 -0
- data/license.md +23 -0
- data/readme.md +34 -0
- data.tar.gz.sig +0 -0
- metadata +118 -58
- metadata.gz.sig +2 -0
- data/README +0 -60
- data/app/helpers/ui_helper.rb +0 -80
- data/app/models/xrb/element.rb +0 -9
- data/lib/xrb/engine.rb +0 -4
- data/rails/init.rb +0 -1
- data/xrb.gemspec +0 -12
data/ext/xrb/markup.c
ADDED
@@ -0,0 +1,1949 @@
|
|
1
|
+
|
2
|
+
#line 1 "ext/xrb/markup.rl"
|
3
|
+
|
4
|
+
#include "markup.h"
|
5
|
+
|
6
|
+
|
7
|
+
#line 8 "ext/xrb/markup.c"
|
8
|
+
static const int XRB_markup_parser_start = 48;
|
9
|
+
static const int XRB_markup_parser_first_final = 48;
|
10
|
+
static const int XRB_markup_parser_error = 0;
|
11
|
+
|
12
|
+
static const int XRB_markup_parser_en_parse_entity = 42;
|
13
|
+
static const int XRB_markup_parser_en_main = 48;
|
14
|
+
|
15
|
+
|
16
|
+
#line 195 "ext/xrb/markup.rl"
|
17
|
+
|
18
|
+
|
19
|
+
VALUE XRB_Native_parse_markup(VALUE self, VALUE buffer, VALUE delegate, VALUE entities) {
|
20
|
+
VALUE string = rb_funcall(buffer, id_read, 0);
|
21
|
+
|
22
|
+
rb_encoding *encoding = rb_enc_get(string);
|
23
|
+
|
24
|
+
VALUE pcdata = Qnil;
|
25
|
+
|
26
|
+
VALUE empty_string = rb_obj_freeze(rb_enc_str_new(0, 0, encoding));
|
27
|
+
|
28
|
+
const char *s, *p, *pe, *eof;
|
29
|
+
unsigned long cs, top = 0, stack[2] = {0};
|
30
|
+
unsigned long codepoint = 0;
|
31
|
+
|
32
|
+
XRB_Token identifier = {0}, cdata = {0}, characters = {0}, entity = {0}, doctype = {0}, comment = {0}, instruction = {0};
|
33
|
+
unsigned self_closing = 0, has_value = 0, has_entities = 0;
|
34
|
+
|
35
|
+
s = p = RSTRING_PTR(string);
|
36
|
+
eof = pe = p + RSTRING_LEN(string);
|
37
|
+
|
38
|
+
|
39
|
+
#line 40 "ext/xrb/markup.c"
|
40
|
+
{
|
41
|
+
cs = XRB_markup_parser_start;
|
42
|
+
top = 0;
|
43
|
+
}
|
44
|
+
|
45
|
+
#line 46 "ext/xrb/markup.c"
|
46
|
+
{
|
47
|
+
if ( p == pe )
|
48
|
+
goto _test_eof;
|
49
|
+
goto _resume;
|
50
|
+
|
51
|
+
_again:
|
52
|
+
switch ( cs ) {
|
53
|
+
case 48: goto st48;
|
54
|
+
case 49: goto st49;
|
55
|
+
case 50: goto st50;
|
56
|
+
case 1: goto st1;
|
57
|
+
case 2: goto st2;
|
58
|
+
case 0: goto st0;
|
59
|
+
case 3: goto st3;
|
60
|
+
case 4: goto st4;
|
61
|
+
case 5: goto st5;
|
62
|
+
case 51: goto st51;
|
63
|
+
case 6: goto st6;
|
64
|
+
case 7: goto st7;
|
65
|
+
case 8: goto st8;
|
66
|
+
case 9: goto st9;
|
67
|
+
case 10: goto st10;
|
68
|
+
case 11: goto st11;
|
69
|
+
case 12: goto st12;
|
70
|
+
case 13: goto st13;
|
71
|
+
case 14: goto st14;
|
72
|
+
case 15: goto st15;
|
73
|
+
case 16: goto st16;
|
74
|
+
case 17: goto st17;
|
75
|
+
case 18: goto st18;
|
76
|
+
case 19: goto st19;
|
77
|
+
case 52: goto st52;
|
78
|
+
case 20: goto st20;
|
79
|
+
case 21: goto st21;
|
80
|
+
case 22: goto st22;
|
81
|
+
case 23: goto st23;
|
82
|
+
case 24: goto st24;
|
83
|
+
case 25: goto st25;
|
84
|
+
case 26: goto st26;
|
85
|
+
case 53: goto st53;
|
86
|
+
case 27: goto st27;
|
87
|
+
case 28: goto st28;
|
88
|
+
case 29: goto st29;
|
89
|
+
case 30: goto st30;
|
90
|
+
case 31: goto st31;
|
91
|
+
case 32: goto st32;
|
92
|
+
case 33: goto st33;
|
93
|
+
case 34: goto st34;
|
94
|
+
case 35: goto st35;
|
95
|
+
case 54: goto st54;
|
96
|
+
case 36: goto st36;
|
97
|
+
case 37: goto st37;
|
98
|
+
case 55: goto st55;
|
99
|
+
case 38: goto st38;
|
100
|
+
case 39: goto st39;
|
101
|
+
case 40: goto st40;
|
102
|
+
case 41: goto st41;
|
103
|
+
case 56: goto st56;
|
104
|
+
case 42: goto st42;
|
105
|
+
case 43: goto st43;
|
106
|
+
case 44: goto st44;
|
107
|
+
case 57: goto st57;
|
108
|
+
case 45: goto st45;
|
109
|
+
case 46: goto st46;
|
110
|
+
case 47: goto st47;
|
111
|
+
default: break;
|
112
|
+
}
|
113
|
+
|
114
|
+
if ( ++p == pe )
|
115
|
+
goto _test_eof;
|
116
|
+
_resume:
|
117
|
+
switch ( cs )
|
118
|
+
{
|
119
|
+
st48:
|
120
|
+
if ( ++p == pe )
|
121
|
+
goto _test_eof48;
|
122
|
+
case 48:
|
123
|
+
switch( (*p) ) {
|
124
|
+
case 38: goto tr88;
|
125
|
+
case 60: goto tr89;
|
126
|
+
}
|
127
|
+
goto tr87;
|
128
|
+
tr93:
|
129
|
+
#line 31 "ext/xrb/markup.rl"
|
130
|
+
{
|
131
|
+
characters.begin = p;
|
132
|
+
}
|
133
|
+
goto st49;
|
134
|
+
tr87:
|
135
|
+
#line 24 "ext/xrb/markup.rl"
|
136
|
+
{
|
137
|
+
}
|
138
|
+
#line 16 "ext/xrb/markup.rl"
|
139
|
+
{
|
140
|
+
pcdata = Qnil;
|
141
|
+
has_entities = 0;
|
142
|
+
}
|
143
|
+
#line 31 "ext/xrb/markup.rl"
|
144
|
+
{
|
145
|
+
characters.begin = p;
|
146
|
+
}
|
147
|
+
goto st49;
|
148
|
+
tr96:
|
149
|
+
#line 163 "ext/xrb/markup.rl"
|
150
|
+
{
|
151
|
+
rb_funcall(delegate, id_open_tag_end, 1, self_closing == 1 ? Qtrue : Qfalse);
|
152
|
+
}
|
153
|
+
#line 24 "ext/xrb/markup.rl"
|
154
|
+
{
|
155
|
+
}
|
156
|
+
#line 16 "ext/xrb/markup.rl"
|
157
|
+
{
|
158
|
+
pcdata = Qnil;
|
159
|
+
has_entities = 0;
|
160
|
+
}
|
161
|
+
#line 31 "ext/xrb/markup.rl"
|
162
|
+
{
|
163
|
+
characters.begin = p;
|
164
|
+
}
|
165
|
+
goto st49;
|
166
|
+
tr99:
|
167
|
+
#line 97 "ext/xrb/markup.rl"
|
168
|
+
{
|
169
|
+
comment.end = p;
|
170
|
+
|
171
|
+
rb_funcall(delegate, id_comment, 1, XRB_Token_string(comment, encoding));
|
172
|
+
}
|
173
|
+
#line 24 "ext/xrb/markup.rl"
|
174
|
+
{
|
175
|
+
}
|
176
|
+
#line 16 "ext/xrb/markup.rl"
|
177
|
+
{
|
178
|
+
pcdata = Qnil;
|
179
|
+
has_entities = 0;
|
180
|
+
}
|
181
|
+
#line 31 "ext/xrb/markup.rl"
|
182
|
+
{
|
183
|
+
characters.begin = p;
|
184
|
+
}
|
185
|
+
goto st49;
|
186
|
+
tr102:
|
187
|
+
#line 83 "ext/xrb/markup.rl"
|
188
|
+
{
|
189
|
+
doctype.end = p;
|
190
|
+
|
191
|
+
rb_funcall(delegate, id_doctype, 1, XRB_Token_string(doctype, encoding));
|
192
|
+
}
|
193
|
+
#line 24 "ext/xrb/markup.rl"
|
194
|
+
{
|
195
|
+
}
|
196
|
+
#line 16 "ext/xrb/markup.rl"
|
197
|
+
{
|
198
|
+
pcdata = Qnil;
|
199
|
+
has_entities = 0;
|
200
|
+
}
|
201
|
+
#line 31 "ext/xrb/markup.rl"
|
202
|
+
{
|
203
|
+
characters.begin = p;
|
204
|
+
}
|
205
|
+
goto st49;
|
206
|
+
tr105:
|
207
|
+
#line 182 "ext/xrb/markup.rl"
|
208
|
+
{
|
209
|
+
cdata.end = p;
|
210
|
+
|
211
|
+
rb_funcall(delegate, id_cdata, 1, XRB_Token_string(cdata, encoding));
|
212
|
+
}
|
213
|
+
#line 24 "ext/xrb/markup.rl"
|
214
|
+
{
|
215
|
+
}
|
216
|
+
#line 16 "ext/xrb/markup.rl"
|
217
|
+
{
|
218
|
+
pcdata = Qnil;
|
219
|
+
has_entities = 0;
|
220
|
+
}
|
221
|
+
#line 31 "ext/xrb/markup.rl"
|
222
|
+
{
|
223
|
+
characters.begin = p;
|
224
|
+
}
|
225
|
+
goto st49;
|
226
|
+
tr108:
|
227
|
+
#line 170 "ext/xrb/markup.rl"
|
228
|
+
{
|
229
|
+
rb_funcall(delegate, id_close_tag, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
230
|
+
}
|
231
|
+
#line 24 "ext/xrb/markup.rl"
|
232
|
+
{
|
233
|
+
}
|
234
|
+
#line 16 "ext/xrb/markup.rl"
|
235
|
+
{
|
236
|
+
pcdata = Qnil;
|
237
|
+
has_entities = 0;
|
238
|
+
}
|
239
|
+
#line 31 "ext/xrb/markup.rl"
|
240
|
+
{
|
241
|
+
characters.begin = p;
|
242
|
+
}
|
243
|
+
goto st49;
|
244
|
+
tr111:
|
245
|
+
#line 117 "ext/xrb/markup.rl"
|
246
|
+
{
|
247
|
+
instruction.end = p;
|
248
|
+
|
249
|
+
rb_funcall(delegate, id_instruction, 1, XRB_Token_string(instruction, encoding));
|
250
|
+
}
|
251
|
+
#line 24 "ext/xrb/markup.rl"
|
252
|
+
{
|
253
|
+
}
|
254
|
+
#line 16 "ext/xrb/markup.rl"
|
255
|
+
{
|
256
|
+
pcdata = Qnil;
|
257
|
+
has_entities = 0;
|
258
|
+
}
|
259
|
+
#line 31 "ext/xrb/markup.rl"
|
260
|
+
{
|
261
|
+
characters.begin = p;
|
262
|
+
}
|
263
|
+
goto st49;
|
264
|
+
st49:
|
265
|
+
if ( ++p == pe )
|
266
|
+
goto _test_eof49;
|
267
|
+
case 49:
|
268
|
+
#line 269 "ext/xrb/markup.c"
|
269
|
+
switch( (*p) ) {
|
270
|
+
case 38: goto tr91;
|
271
|
+
case 60: goto tr92;
|
272
|
+
}
|
273
|
+
goto st49;
|
274
|
+
tr91:
|
275
|
+
#line 35 "ext/xrb/markup.rl"
|
276
|
+
{
|
277
|
+
characters.end = p;
|
278
|
+
|
279
|
+
XRB_append_token(&pcdata, encoding, characters);
|
280
|
+
}
|
281
|
+
#line 10 "parsers/xrb/entities.rl"
|
282
|
+
{{stack[top++] = 50;goto st42;}}
|
283
|
+
goto st50;
|
284
|
+
tr94:
|
285
|
+
#line 10 "parsers/xrb/entities.rl"
|
286
|
+
{{stack[top++] = 50;goto st42;}}
|
287
|
+
goto st50;
|
288
|
+
tr88:
|
289
|
+
#line 24 "ext/xrb/markup.rl"
|
290
|
+
{
|
291
|
+
}
|
292
|
+
#line 16 "ext/xrb/markup.rl"
|
293
|
+
{
|
294
|
+
pcdata = Qnil;
|
295
|
+
has_entities = 0;
|
296
|
+
}
|
297
|
+
#line 10 "parsers/xrb/entities.rl"
|
298
|
+
{{stack[top++] = 50;goto st42;}}
|
299
|
+
goto st50;
|
300
|
+
tr97:
|
301
|
+
#line 163 "ext/xrb/markup.rl"
|
302
|
+
{
|
303
|
+
rb_funcall(delegate, id_open_tag_end, 1, self_closing == 1 ? Qtrue : Qfalse);
|
304
|
+
}
|
305
|
+
#line 24 "ext/xrb/markup.rl"
|
306
|
+
{
|
307
|
+
}
|
308
|
+
#line 16 "ext/xrb/markup.rl"
|
309
|
+
{
|
310
|
+
pcdata = Qnil;
|
311
|
+
has_entities = 0;
|
312
|
+
}
|
313
|
+
#line 10 "parsers/xrb/entities.rl"
|
314
|
+
{{stack[top++] = 50;goto st42;}}
|
315
|
+
goto st50;
|
316
|
+
tr100:
|
317
|
+
#line 97 "ext/xrb/markup.rl"
|
318
|
+
{
|
319
|
+
comment.end = p;
|
320
|
+
|
321
|
+
rb_funcall(delegate, id_comment, 1, XRB_Token_string(comment, encoding));
|
322
|
+
}
|
323
|
+
#line 24 "ext/xrb/markup.rl"
|
324
|
+
{
|
325
|
+
}
|
326
|
+
#line 16 "ext/xrb/markup.rl"
|
327
|
+
{
|
328
|
+
pcdata = Qnil;
|
329
|
+
has_entities = 0;
|
330
|
+
}
|
331
|
+
#line 10 "parsers/xrb/entities.rl"
|
332
|
+
{{stack[top++] = 50;goto st42;}}
|
333
|
+
goto st50;
|
334
|
+
tr103:
|
335
|
+
#line 83 "ext/xrb/markup.rl"
|
336
|
+
{
|
337
|
+
doctype.end = p;
|
338
|
+
|
339
|
+
rb_funcall(delegate, id_doctype, 1, XRB_Token_string(doctype, encoding));
|
340
|
+
}
|
341
|
+
#line 24 "ext/xrb/markup.rl"
|
342
|
+
{
|
343
|
+
}
|
344
|
+
#line 16 "ext/xrb/markup.rl"
|
345
|
+
{
|
346
|
+
pcdata = Qnil;
|
347
|
+
has_entities = 0;
|
348
|
+
}
|
349
|
+
#line 10 "parsers/xrb/entities.rl"
|
350
|
+
{{stack[top++] = 50;goto st42;}}
|
351
|
+
goto st50;
|
352
|
+
tr106:
|
353
|
+
#line 182 "ext/xrb/markup.rl"
|
354
|
+
{
|
355
|
+
cdata.end = p;
|
356
|
+
|
357
|
+
rb_funcall(delegate, id_cdata, 1, XRB_Token_string(cdata, encoding));
|
358
|
+
}
|
359
|
+
#line 24 "ext/xrb/markup.rl"
|
360
|
+
{
|
361
|
+
}
|
362
|
+
#line 16 "ext/xrb/markup.rl"
|
363
|
+
{
|
364
|
+
pcdata = Qnil;
|
365
|
+
has_entities = 0;
|
366
|
+
}
|
367
|
+
#line 10 "parsers/xrb/entities.rl"
|
368
|
+
{{stack[top++] = 50;goto st42;}}
|
369
|
+
goto st50;
|
370
|
+
tr109:
|
371
|
+
#line 170 "ext/xrb/markup.rl"
|
372
|
+
{
|
373
|
+
rb_funcall(delegate, id_close_tag, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
374
|
+
}
|
375
|
+
#line 24 "ext/xrb/markup.rl"
|
376
|
+
{
|
377
|
+
}
|
378
|
+
#line 16 "ext/xrb/markup.rl"
|
379
|
+
{
|
380
|
+
pcdata = Qnil;
|
381
|
+
has_entities = 0;
|
382
|
+
}
|
383
|
+
#line 10 "parsers/xrb/entities.rl"
|
384
|
+
{{stack[top++] = 50;goto st42;}}
|
385
|
+
goto st50;
|
386
|
+
tr112:
|
387
|
+
#line 117 "ext/xrb/markup.rl"
|
388
|
+
{
|
389
|
+
instruction.end = p;
|
390
|
+
|
391
|
+
rb_funcall(delegate, id_instruction, 1, XRB_Token_string(instruction, encoding));
|
392
|
+
}
|
393
|
+
#line 24 "ext/xrb/markup.rl"
|
394
|
+
{
|
395
|
+
}
|
396
|
+
#line 16 "ext/xrb/markup.rl"
|
397
|
+
{
|
398
|
+
pcdata = Qnil;
|
399
|
+
has_entities = 0;
|
400
|
+
}
|
401
|
+
#line 10 "parsers/xrb/entities.rl"
|
402
|
+
{{stack[top++] = 50;goto st42;}}
|
403
|
+
goto st50;
|
404
|
+
st50:
|
405
|
+
if ( ++p == pe )
|
406
|
+
goto _test_eof50;
|
407
|
+
case 50:
|
408
|
+
#line 409 "ext/xrb/markup.c"
|
409
|
+
switch( (*p) ) {
|
410
|
+
case 38: goto tr94;
|
411
|
+
case 60: goto tr95;
|
412
|
+
}
|
413
|
+
goto tr93;
|
414
|
+
tr89:
|
415
|
+
#line 134 "ext/xrb/markup.rl"
|
416
|
+
{
|
417
|
+
}
|
418
|
+
#line 167 "ext/xrb/markup.rl"
|
419
|
+
{
|
420
|
+
}
|
421
|
+
#line 107 "ext/xrb/markup.rl"
|
422
|
+
{
|
423
|
+
instruction.begin = p;
|
424
|
+
}
|
425
|
+
#line 93 "ext/xrb/markup.rl"
|
426
|
+
{
|
427
|
+
comment.begin = p;
|
428
|
+
}
|
429
|
+
#line 79 "ext/xrb/markup.rl"
|
430
|
+
{
|
431
|
+
doctype.begin = p;
|
432
|
+
}
|
433
|
+
#line 178 "ext/xrb/markup.rl"
|
434
|
+
{
|
435
|
+
cdata.begin = p;
|
436
|
+
}
|
437
|
+
goto st1;
|
438
|
+
tr92:
|
439
|
+
#line 35 "ext/xrb/markup.rl"
|
440
|
+
{
|
441
|
+
characters.end = p;
|
442
|
+
|
443
|
+
XRB_append_token(&pcdata, encoding, characters);
|
444
|
+
}
|
445
|
+
#line 21 "ext/xrb/markup.rl"
|
446
|
+
{
|
447
|
+
}
|
448
|
+
#line 27 "ext/xrb/markup.rl"
|
449
|
+
{
|
450
|
+
rb_funcall(delegate, id_text, 1, XRB_markup_safe(pcdata, has_entities));
|
451
|
+
}
|
452
|
+
#line 134 "ext/xrb/markup.rl"
|
453
|
+
{
|
454
|
+
}
|
455
|
+
#line 167 "ext/xrb/markup.rl"
|
456
|
+
{
|
457
|
+
}
|
458
|
+
#line 107 "ext/xrb/markup.rl"
|
459
|
+
{
|
460
|
+
instruction.begin = p;
|
461
|
+
}
|
462
|
+
#line 93 "ext/xrb/markup.rl"
|
463
|
+
{
|
464
|
+
comment.begin = p;
|
465
|
+
}
|
466
|
+
#line 79 "ext/xrb/markup.rl"
|
467
|
+
{
|
468
|
+
doctype.begin = p;
|
469
|
+
}
|
470
|
+
#line 178 "ext/xrb/markup.rl"
|
471
|
+
{
|
472
|
+
cdata.begin = p;
|
473
|
+
}
|
474
|
+
goto st1;
|
475
|
+
tr95:
|
476
|
+
#line 21 "ext/xrb/markup.rl"
|
477
|
+
{
|
478
|
+
}
|
479
|
+
#line 27 "ext/xrb/markup.rl"
|
480
|
+
{
|
481
|
+
rb_funcall(delegate, id_text, 1, XRB_markup_safe(pcdata, has_entities));
|
482
|
+
}
|
483
|
+
#line 134 "ext/xrb/markup.rl"
|
484
|
+
{
|
485
|
+
}
|
486
|
+
#line 167 "ext/xrb/markup.rl"
|
487
|
+
{
|
488
|
+
}
|
489
|
+
#line 107 "ext/xrb/markup.rl"
|
490
|
+
{
|
491
|
+
instruction.begin = p;
|
492
|
+
}
|
493
|
+
#line 93 "ext/xrb/markup.rl"
|
494
|
+
{
|
495
|
+
comment.begin = p;
|
496
|
+
}
|
497
|
+
#line 79 "ext/xrb/markup.rl"
|
498
|
+
{
|
499
|
+
doctype.begin = p;
|
500
|
+
}
|
501
|
+
#line 178 "ext/xrb/markup.rl"
|
502
|
+
{
|
503
|
+
cdata.begin = p;
|
504
|
+
}
|
505
|
+
goto st1;
|
506
|
+
tr98:
|
507
|
+
#line 163 "ext/xrb/markup.rl"
|
508
|
+
{
|
509
|
+
rb_funcall(delegate, id_open_tag_end, 1, self_closing == 1 ? Qtrue : Qfalse);
|
510
|
+
}
|
511
|
+
#line 134 "ext/xrb/markup.rl"
|
512
|
+
{
|
513
|
+
}
|
514
|
+
#line 167 "ext/xrb/markup.rl"
|
515
|
+
{
|
516
|
+
}
|
517
|
+
#line 107 "ext/xrb/markup.rl"
|
518
|
+
{
|
519
|
+
instruction.begin = p;
|
520
|
+
}
|
521
|
+
#line 93 "ext/xrb/markup.rl"
|
522
|
+
{
|
523
|
+
comment.begin = p;
|
524
|
+
}
|
525
|
+
#line 79 "ext/xrb/markup.rl"
|
526
|
+
{
|
527
|
+
doctype.begin = p;
|
528
|
+
}
|
529
|
+
#line 178 "ext/xrb/markup.rl"
|
530
|
+
{
|
531
|
+
cdata.begin = p;
|
532
|
+
}
|
533
|
+
goto st1;
|
534
|
+
tr101:
|
535
|
+
#line 97 "ext/xrb/markup.rl"
|
536
|
+
{
|
537
|
+
comment.end = p;
|
538
|
+
|
539
|
+
rb_funcall(delegate, id_comment, 1, XRB_Token_string(comment, encoding));
|
540
|
+
}
|
541
|
+
#line 134 "ext/xrb/markup.rl"
|
542
|
+
{
|
543
|
+
}
|
544
|
+
#line 167 "ext/xrb/markup.rl"
|
545
|
+
{
|
546
|
+
}
|
547
|
+
#line 107 "ext/xrb/markup.rl"
|
548
|
+
{
|
549
|
+
instruction.begin = p;
|
550
|
+
}
|
551
|
+
#line 93 "ext/xrb/markup.rl"
|
552
|
+
{
|
553
|
+
comment.begin = p;
|
554
|
+
}
|
555
|
+
#line 79 "ext/xrb/markup.rl"
|
556
|
+
{
|
557
|
+
doctype.begin = p;
|
558
|
+
}
|
559
|
+
#line 178 "ext/xrb/markup.rl"
|
560
|
+
{
|
561
|
+
cdata.begin = p;
|
562
|
+
}
|
563
|
+
goto st1;
|
564
|
+
tr104:
|
565
|
+
#line 83 "ext/xrb/markup.rl"
|
566
|
+
{
|
567
|
+
doctype.end = p;
|
568
|
+
|
569
|
+
rb_funcall(delegate, id_doctype, 1, XRB_Token_string(doctype, encoding));
|
570
|
+
}
|
571
|
+
#line 134 "ext/xrb/markup.rl"
|
572
|
+
{
|
573
|
+
}
|
574
|
+
#line 167 "ext/xrb/markup.rl"
|
575
|
+
{
|
576
|
+
}
|
577
|
+
#line 107 "ext/xrb/markup.rl"
|
578
|
+
{
|
579
|
+
instruction.begin = p;
|
580
|
+
}
|
581
|
+
#line 93 "ext/xrb/markup.rl"
|
582
|
+
{
|
583
|
+
comment.begin = p;
|
584
|
+
}
|
585
|
+
#line 79 "ext/xrb/markup.rl"
|
586
|
+
{
|
587
|
+
doctype.begin = p;
|
588
|
+
}
|
589
|
+
#line 178 "ext/xrb/markup.rl"
|
590
|
+
{
|
591
|
+
cdata.begin = p;
|
592
|
+
}
|
593
|
+
goto st1;
|
594
|
+
tr107:
|
595
|
+
#line 182 "ext/xrb/markup.rl"
|
596
|
+
{
|
597
|
+
cdata.end = p;
|
598
|
+
|
599
|
+
rb_funcall(delegate, id_cdata, 1, XRB_Token_string(cdata, encoding));
|
600
|
+
}
|
601
|
+
#line 134 "ext/xrb/markup.rl"
|
602
|
+
{
|
603
|
+
}
|
604
|
+
#line 167 "ext/xrb/markup.rl"
|
605
|
+
{
|
606
|
+
}
|
607
|
+
#line 107 "ext/xrb/markup.rl"
|
608
|
+
{
|
609
|
+
instruction.begin = p;
|
610
|
+
}
|
611
|
+
#line 93 "ext/xrb/markup.rl"
|
612
|
+
{
|
613
|
+
comment.begin = p;
|
614
|
+
}
|
615
|
+
#line 79 "ext/xrb/markup.rl"
|
616
|
+
{
|
617
|
+
doctype.begin = p;
|
618
|
+
}
|
619
|
+
#line 178 "ext/xrb/markup.rl"
|
620
|
+
{
|
621
|
+
cdata.begin = p;
|
622
|
+
}
|
623
|
+
goto st1;
|
624
|
+
tr110:
|
625
|
+
#line 170 "ext/xrb/markup.rl"
|
626
|
+
{
|
627
|
+
rb_funcall(delegate, id_close_tag, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
628
|
+
}
|
629
|
+
#line 134 "ext/xrb/markup.rl"
|
630
|
+
{
|
631
|
+
}
|
632
|
+
#line 167 "ext/xrb/markup.rl"
|
633
|
+
{
|
634
|
+
}
|
635
|
+
#line 107 "ext/xrb/markup.rl"
|
636
|
+
{
|
637
|
+
instruction.begin = p;
|
638
|
+
}
|
639
|
+
#line 93 "ext/xrb/markup.rl"
|
640
|
+
{
|
641
|
+
comment.begin = p;
|
642
|
+
}
|
643
|
+
#line 79 "ext/xrb/markup.rl"
|
644
|
+
{
|
645
|
+
doctype.begin = p;
|
646
|
+
}
|
647
|
+
#line 178 "ext/xrb/markup.rl"
|
648
|
+
{
|
649
|
+
cdata.begin = p;
|
650
|
+
}
|
651
|
+
goto st1;
|
652
|
+
tr113:
|
653
|
+
#line 117 "ext/xrb/markup.rl"
|
654
|
+
{
|
655
|
+
instruction.end = p;
|
656
|
+
|
657
|
+
rb_funcall(delegate, id_instruction, 1, XRB_Token_string(instruction, encoding));
|
658
|
+
}
|
659
|
+
#line 134 "ext/xrb/markup.rl"
|
660
|
+
{
|
661
|
+
}
|
662
|
+
#line 167 "ext/xrb/markup.rl"
|
663
|
+
{
|
664
|
+
}
|
665
|
+
#line 107 "ext/xrb/markup.rl"
|
666
|
+
{
|
667
|
+
instruction.begin = p;
|
668
|
+
}
|
669
|
+
#line 93 "ext/xrb/markup.rl"
|
670
|
+
{
|
671
|
+
comment.begin = p;
|
672
|
+
}
|
673
|
+
#line 79 "ext/xrb/markup.rl"
|
674
|
+
{
|
675
|
+
doctype.begin = p;
|
676
|
+
}
|
677
|
+
#line 178 "ext/xrb/markup.rl"
|
678
|
+
{
|
679
|
+
cdata.begin = p;
|
680
|
+
}
|
681
|
+
goto st1;
|
682
|
+
st1:
|
683
|
+
if ( ++p == pe )
|
684
|
+
goto _test_eof1;
|
685
|
+
case 1:
|
686
|
+
#line 687 "ext/xrb/markup.c"
|
687
|
+
switch( (*p) ) {
|
688
|
+
case 33: goto st15;
|
689
|
+
case 47: goto st36;
|
690
|
+
case 63: goto st38;
|
691
|
+
case 96: goto tr1;
|
692
|
+
}
|
693
|
+
if ( (*p) < 59 ) {
|
694
|
+
if ( 0 <= (*p) && (*p) <= 44 )
|
695
|
+
goto tr1;
|
696
|
+
} else if ( (*p) > 64 ) {
|
697
|
+
if ( (*p) > 94 ) {
|
698
|
+
if ( 123 <= (*p) )
|
699
|
+
goto tr1;
|
700
|
+
} else if ( (*p) >= 91 )
|
701
|
+
goto tr1;
|
702
|
+
} else
|
703
|
+
goto tr1;
|
704
|
+
goto tr0;
|
705
|
+
tr0:
|
706
|
+
#line 8 "ext/xrb/markup.rl"
|
707
|
+
{
|
708
|
+
identifier.begin = p;
|
709
|
+
}
|
710
|
+
goto st2;
|
711
|
+
st2:
|
712
|
+
if ( ++p == pe )
|
713
|
+
goto _test_eof2;
|
714
|
+
case 2:
|
715
|
+
#line 716 "ext/xrb/markup.c"
|
716
|
+
switch( (*p) ) {
|
717
|
+
case 32: goto tr6;
|
718
|
+
case 47: goto tr7;
|
719
|
+
case 62: goto tr8;
|
720
|
+
case 96: goto tr1;
|
721
|
+
}
|
722
|
+
if ( (*p) < 14 ) {
|
723
|
+
if ( (*p) > 8 ) {
|
724
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
725
|
+
goto tr6;
|
726
|
+
} else if ( (*p) >= 0 )
|
727
|
+
goto tr1;
|
728
|
+
} else if ( (*p) > 44 ) {
|
729
|
+
if ( (*p) < 91 ) {
|
730
|
+
if ( 59 <= (*p) && (*p) <= 64 )
|
731
|
+
goto tr1;
|
732
|
+
} else if ( (*p) > 94 ) {
|
733
|
+
if ( 123 <= (*p) )
|
734
|
+
goto tr1;
|
735
|
+
} else
|
736
|
+
goto tr1;
|
737
|
+
} else
|
738
|
+
goto tr1;
|
739
|
+
goto st2;
|
740
|
+
tr1:
|
741
|
+
#line 174 "ext/xrb/markup.rl"
|
742
|
+
{
|
743
|
+
XRB_raise_error("could not parse tag", buffer, p-s);
|
744
|
+
}
|
745
|
+
goto st0;
|
746
|
+
tr69:
|
747
|
+
#line 123 "ext/xrb/markup.rl"
|
748
|
+
{
|
749
|
+
XRB_raise_error("could not parse instruction", buffer, p-s);
|
750
|
+
}
|
751
|
+
goto st0;
|
752
|
+
tr75:
|
753
|
+
#line 41 "ext/xrb/markup.rl"
|
754
|
+
{
|
755
|
+
XRB_raise_error("could not parse entity", buffer, p-s);
|
756
|
+
}
|
757
|
+
goto st0;
|
758
|
+
#line 759 "ext/xrb/markup.c"
|
759
|
+
st0:
|
760
|
+
cs = 0;
|
761
|
+
goto _out;
|
762
|
+
tr6:
|
763
|
+
#line 12 "ext/xrb/markup.rl"
|
764
|
+
{
|
765
|
+
identifier.end = p;
|
766
|
+
}
|
767
|
+
#line 127 "ext/xrb/markup.rl"
|
768
|
+
{
|
769
|
+
// Reset self-closing state - we don't know yet.
|
770
|
+
self_closing = 0;
|
771
|
+
|
772
|
+
rb_funcall(delegate, id_open_tag_begin, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
773
|
+
}
|
774
|
+
goto st3;
|
775
|
+
tr14:
|
776
|
+
#line 12 "ext/xrb/markup.rl"
|
777
|
+
{
|
778
|
+
identifier.end = p;
|
779
|
+
}
|
780
|
+
#line 153 "ext/xrb/markup.rl"
|
781
|
+
{
|
782
|
+
if (has_value == 1) {
|
783
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
784
|
+
} else if (has_value == 2) {
|
785
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
786
|
+
} else {
|
787
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
788
|
+
}
|
789
|
+
}
|
790
|
+
goto st3;
|
791
|
+
tr26:
|
792
|
+
#line 145 "ext/xrb/markup.rl"
|
793
|
+
{
|
794
|
+
has_value = 1;
|
795
|
+
}
|
796
|
+
#line 153 "ext/xrb/markup.rl"
|
797
|
+
{
|
798
|
+
if (has_value == 1) {
|
799
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
800
|
+
} else if (has_value == 2) {
|
801
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
802
|
+
} else {
|
803
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
804
|
+
}
|
805
|
+
}
|
806
|
+
goto st3;
|
807
|
+
tr32:
|
808
|
+
#line 149 "ext/xrb/markup.rl"
|
809
|
+
{
|
810
|
+
has_value = 2;
|
811
|
+
}
|
812
|
+
#line 153 "ext/xrb/markup.rl"
|
813
|
+
{
|
814
|
+
if (has_value == 1) {
|
815
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
816
|
+
} else if (has_value == 2) {
|
817
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
818
|
+
} else {
|
819
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
820
|
+
}
|
821
|
+
}
|
822
|
+
goto st3;
|
823
|
+
st3:
|
824
|
+
if ( ++p == pe )
|
825
|
+
goto _test_eof3;
|
826
|
+
case 3:
|
827
|
+
#line 828 "ext/xrb/markup.c"
|
828
|
+
switch( (*p) ) {
|
829
|
+
case 32: goto st3;
|
830
|
+
case 47: goto tr11;
|
831
|
+
case 62: goto st51;
|
832
|
+
case 96: goto tr1;
|
833
|
+
}
|
834
|
+
if ( (*p) < 14 ) {
|
835
|
+
if ( (*p) > 8 ) {
|
836
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
837
|
+
goto st3;
|
838
|
+
} else if ( (*p) >= 0 )
|
839
|
+
goto tr1;
|
840
|
+
} else if ( (*p) > 44 ) {
|
841
|
+
if ( (*p) < 91 ) {
|
842
|
+
if ( 59 <= (*p) && (*p) <= 64 )
|
843
|
+
goto tr1;
|
844
|
+
} else if ( (*p) > 94 ) {
|
845
|
+
if ( 123 <= (*p) )
|
846
|
+
goto tr1;
|
847
|
+
} else
|
848
|
+
goto tr1;
|
849
|
+
} else
|
850
|
+
goto tr1;
|
851
|
+
goto tr9;
|
852
|
+
tr9:
|
853
|
+
#line 141 "ext/xrb/markup.rl"
|
854
|
+
{
|
855
|
+
has_value = 0;
|
856
|
+
}
|
857
|
+
#line 8 "ext/xrb/markup.rl"
|
858
|
+
{
|
859
|
+
identifier.begin = p;
|
860
|
+
}
|
861
|
+
goto st4;
|
862
|
+
st4:
|
863
|
+
if ( ++p == pe )
|
864
|
+
goto _test_eof4;
|
865
|
+
case 4:
|
866
|
+
#line 867 "ext/xrb/markup.c"
|
867
|
+
switch( (*p) ) {
|
868
|
+
case 32: goto tr14;
|
869
|
+
case 47: goto tr15;
|
870
|
+
case 61: goto tr16;
|
871
|
+
case 62: goto tr17;
|
872
|
+
case 96: goto tr1;
|
873
|
+
}
|
874
|
+
if ( (*p) < 14 ) {
|
875
|
+
if ( (*p) > 8 ) {
|
876
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
877
|
+
goto tr14;
|
878
|
+
} else if ( (*p) >= 0 )
|
879
|
+
goto tr1;
|
880
|
+
} else if ( (*p) > 44 ) {
|
881
|
+
if ( (*p) < 91 ) {
|
882
|
+
if ( 59 <= (*p) && (*p) <= 64 )
|
883
|
+
goto tr1;
|
884
|
+
} else if ( (*p) > 94 ) {
|
885
|
+
if ( 123 <= (*p) )
|
886
|
+
goto tr1;
|
887
|
+
} else
|
888
|
+
goto tr1;
|
889
|
+
} else
|
890
|
+
goto tr1;
|
891
|
+
goto st4;
|
892
|
+
tr7:
|
893
|
+
#line 12 "ext/xrb/markup.rl"
|
894
|
+
{
|
895
|
+
identifier.end = p;
|
896
|
+
}
|
897
|
+
#line 127 "ext/xrb/markup.rl"
|
898
|
+
{
|
899
|
+
// Reset self-closing state - we don't know yet.
|
900
|
+
self_closing = 0;
|
901
|
+
|
902
|
+
rb_funcall(delegate, id_open_tag_begin, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
903
|
+
}
|
904
|
+
#line 137 "ext/xrb/markup.rl"
|
905
|
+
{
|
906
|
+
self_closing = 1;
|
907
|
+
}
|
908
|
+
goto st5;
|
909
|
+
tr11:
|
910
|
+
#line 137 "ext/xrb/markup.rl"
|
911
|
+
{
|
912
|
+
self_closing = 1;
|
913
|
+
}
|
914
|
+
goto st5;
|
915
|
+
tr15:
|
916
|
+
#line 12 "ext/xrb/markup.rl"
|
917
|
+
{
|
918
|
+
identifier.end = p;
|
919
|
+
}
|
920
|
+
#line 153 "ext/xrb/markup.rl"
|
921
|
+
{
|
922
|
+
if (has_value == 1) {
|
923
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
924
|
+
} else if (has_value == 2) {
|
925
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
926
|
+
} else {
|
927
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
928
|
+
}
|
929
|
+
}
|
930
|
+
#line 137 "ext/xrb/markup.rl"
|
931
|
+
{
|
932
|
+
self_closing = 1;
|
933
|
+
}
|
934
|
+
goto st5;
|
935
|
+
tr27:
|
936
|
+
#line 145 "ext/xrb/markup.rl"
|
937
|
+
{
|
938
|
+
has_value = 1;
|
939
|
+
}
|
940
|
+
#line 153 "ext/xrb/markup.rl"
|
941
|
+
{
|
942
|
+
if (has_value == 1) {
|
943
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
944
|
+
} else if (has_value == 2) {
|
945
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
946
|
+
} else {
|
947
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
948
|
+
}
|
949
|
+
}
|
950
|
+
#line 137 "ext/xrb/markup.rl"
|
951
|
+
{
|
952
|
+
self_closing = 1;
|
953
|
+
}
|
954
|
+
goto st5;
|
955
|
+
tr33:
|
956
|
+
#line 149 "ext/xrb/markup.rl"
|
957
|
+
{
|
958
|
+
has_value = 2;
|
959
|
+
}
|
960
|
+
#line 153 "ext/xrb/markup.rl"
|
961
|
+
{
|
962
|
+
if (has_value == 1) {
|
963
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
964
|
+
} else if (has_value == 2) {
|
965
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
966
|
+
} else {
|
967
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
968
|
+
}
|
969
|
+
}
|
970
|
+
#line 137 "ext/xrb/markup.rl"
|
971
|
+
{
|
972
|
+
self_closing = 1;
|
973
|
+
}
|
974
|
+
goto st5;
|
975
|
+
st5:
|
976
|
+
if ( ++p == pe )
|
977
|
+
goto _test_eof5;
|
978
|
+
case 5:
|
979
|
+
#line 980 "ext/xrb/markup.c"
|
980
|
+
if ( (*p) == 62 )
|
981
|
+
goto st51;
|
982
|
+
goto tr1;
|
983
|
+
tr8:
|
984
|
+
#line 12 "ext/xrb/markup.rl"
|
985
|
+
{
|
986
|
+
identifier.end = p;
|
987
|
+
}
|
988
|
+
#line 127 "ext/xrb/markup.rl"
|
989
|
+
{
|
990
|
+
// Reset self-closing state - we don't know yet.
|
991
|
+
self_closing = 0;
|
992
|
+
|
993
|
+
rb_funcall(delegate, id_open_tag_begin, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
994
|
+
}
|
995
|
+
goto st51;
|
996
|
+
tr17:
|
997
|
+
#line 12 "ext/xrb/markup.rl"
|
998
|
+
{
|
999
|
+
identifier.end = p;
|
1000
|
+
}
|
1001
|
+
#line 153 "ext/xrb/markup.rl"
|
1002
|
+
{
|
1003
|
+
if (has_value == 1) {
|
1004
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
1005
|
+
} else if (has_value == 2) {
|
1006
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
1007
|
+
} else {
|
1008
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
1009
|
+
}
|
1010
|
+
}
|
1011
|
+
goto st51;
|
1012
|
+
tr28:
|
1013
|
+
#line 145 "ext/xrb/markup.rl"
|
1014
|
+
{
|
1015
|
+
has_value = 1;
|
1016
|
+
}
|
1017
|
+
#line 153 "ext/xrb/markup.rl"
|
1018
|
+
{
|
1019
|
+
if (has_value == 1) {
|
1020
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
1021
|
+
} else if (has_value == 2) {
|
1022
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
1023
|
+
} else {
|
1024
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
1025
|
+
}
|
1026
|
+
}
|
1027
|
+
goto st51;
|
1028
|
+
tr34:
|
1029
|
+
#line 149 "ext/xrb/markup.rl"
|
1030
|
+
{
|
1031
|
+
has_value = 2;
|
1032
|
+
}
|
1033
|
+
#line 153 "ext/xrb/markup.rl"
|
1034
|
+
{
|
1035
|
+
if (has_value == 1) {
|
1036
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), XRB_markup_safe(pcdata, has_entities));
|
1037
|
+
} else if (has_value == 2) {
|
1038
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), empty_string);
|
1039
|
+
} else {
|
1040
|
+
rb_funcall(delegate, id_attribute, 2, XRB_Token_string(identifier, encoding), Qtrue);
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
goto st51;
|
1044
|
+
st51:
|
1045
|
+
if ( ++p == pe )
|
1046
|
+
goto _test_eof51;
|
1047
|
+
case 51:
|
1048
|
+
#line 1049 "ext/xrb/markup.c"
|
1049
|
+
switch( (*p) ) {
|
1050
|
+
case 38: goto tr97;
|
1051
|
+
case 60: goto tr98;
|
1052
|
+
}
|
1053
|
+
goto tr96;
|
1054
|
+
tr16:
|
1055
|
+
#line 12 "ext/xrb/markup.rl"
|
1056
|
+
{
|
1057
|
+
identifier.end = p;
|
1058
|
+
}
|
1059
|
+
goto st6;
|
1060
|
+
st6:
|
1061
|
+
if ( ++p == pe )
|
1062
|
+
goto _test_eof6;
|
1063
|
+
case 6:
|
1064
|
+
#line 1065 "ext/xrb/markup.c"
|
1065
|
+
switch( (*p) ) {
|
1066
|
+
case 34: goto st7;
|
1067
|
+
case 39: goto st12;
|
1068
|
+
}
|
1069
|
+
goto tr1;
|
1070
|
+
st7:
|
1071
|
+
if ( ++p == pe )
|
1072
|
+
goto _test_eof7;
|
1073
|
+
case 7:
|
1074
|
+
switch( (*p) ) {
|
1075
|
+
case 34: goto st11;
|
1076
|
+
case 38: goto tr22;
|
1077
|
+
case 60: goto tr1;
|
1078
|
+
}
|
1079
|
+
goto tr20;
|
1080
|
+
tr20:
|
1081
|
+
#line 16 "ext/xrb/markup.rl"
|
1082
|
+
{
|
1083
|
+
pcdata = Qnil;
|
1084
|
+
has_entities = 0;
|
1085
|
+
}
|
1086
|
+
#line 31 "ext/xrb/markup.rl"
|
1087
|
+
{
|
1088
|
+
characters.begin = p;
|
1089
|
+
}
|
1090
|
+
goto st8;
|
1091
|
+
tr29:
|
1092
|
+
#line 31 "ext/xrb/markup.rl"
|
1093
|
+
{
|
1094
|
+
characters.begin = p;
|
1095
|
+
}
|
1096
|
+
goto st8;
|
1097
|
+
st8:
|
1098
|
+
if ( ++p == pe )
|
1099
|
+
goto _test_eof8;
|
1100
|
+
case 8:
|
1101
|
+
#line 1102 "ext/xrb/markup.c"
|
1102
|
+
switch( (*p) ) {
|
1103
|
+
case 34: goto tr24;
|
1104
|
+
case 38: goto tr25;
|
1105
|
+
case 60: goto tr1;
|
1106
|
+
}
|
1107
|
+
goto st8;
|
1108
|
+
tr24:
|
1109
|
+
#line 35 "ext/xrb/markup.rl"
|
1110
|
+
{
|
1111
|
+
characters.end = p;
|
1112
|
+
|
1113
|
+
XRB_append_token(&pcdata, encoding, characters);
|
1114
|
+
}
|
1115
|
+
#line 21 "ext/xrb/markup.rl"
|
1116
|
+
{
|
1117
|
+
}
|
1118
|
+
goto st9;
|
1119
|
+
tr30:
|
1120
|
+
#line 21 "ext/xrb/markup.rl"
|
1121
|
+
{
|
1122
|
+
}
|
1123
|
+
goto st9;
|
1124
|
+
st9:
|
1125
|
+
if ( ++p == pe )
|
1126
|
+
goto _test_eof9;
|
1127
|
+
case 9:
|
1128
|
+
#line 1129 "ext/xrb/markup.c"
|
1129
|
+
switch( (*p) ) {
|
1130
|
+
case 32: goto tr26;
|
1131
|
+
case 47: goto tr27;
|
1132
|
+
case 62: goto tr28;
|
1133
|
+
}
|
1134
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
1135
|
+
goto tr26;
|
1136
|
+
goto tr1;
|
1137
|
+
tr22:
|
1138
|
+
#line 16 "ext/xrb/markup.rl"
|
1139
|
+
{
|
1140
|
+
pcdata = Qnil;
|
1141
|
+
has_entities = 0;
|
1142
|
+
}
|
1143
|
+
#line 10 "parsers/xrb/entities.rl"
|
1144
|
+
{{stack[top++] = 10;goto st42;}}
|
1145
|
+
goto st10;
|
1146
|
+
tr25:
|
1147
|
+
#line 35 "ext/xrb/markup.rl"
|
1148
|
+
{
|
1149
|
+
characters.end = p;
|
1150
|
+
|
1151
|
+
XRB_append_token(&pcdata, encoding, characters);
|
1152
|
+
}
|
1153
|
+
#line 10 "parsers/xrb/entities.rl"
|
1154
|
+
{{stack[top++] = 10;goto st42;}}
|
1155
|
+
goto st10;
|
1156
|
+
tr31:
|
1157
|
+
#line 10 "parsers/xrb/entities.rl"
|
1158
|
+
{{stack[top++] = 10;goto st42;}}
|
1159
|
+
goto st10;
|
1160
|
+
st10:
|
1161
|
+
if ( ++p == pe )
|
1162
|
+
goto _test_eof10;
|
1163
|
+
case 10:
|
1164
|
+
#line 1165 "ext/xrb/markup.c"
|
1165
|
+
switch( (*p) ) {
|
1166
|
+
case 34: goto tr30;
|
1167
|
+
case 38: goto tr31;
|
1168
|
+
case 60: goto tr1;
|
1169
|
+
}
|
1170
|
+
goto tr29;
|
1171
|
+
st11:
|
1172
|
+
if ( ++p == pe )
|
1173
|
+
goto _test_eof11;
|
1174
|
+
case 11:
|
1175
|
+
switch( (*p) ) {
|
1176
|
+
case 32: goto tr32;
|
1177
|
+
case 47: goto tr33;
|
1178
|
+
case 62: goto tr34;
|
1179
|
+
}
|
1180
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
1181
|
+
goto tr32;
|
1182
|
+
goto tr1;
|
1183
|
+
st12:
|
1184
|
+
if ( ++p == pe )
|
1185
|
+
goto _test_eof12;
|
1186
|
+
case 12:
|
1187
|
+
switch( (*p) ) {
|
1188
|
+
case 38: goto tr36;
|
1189
|
+
case 39: goto st11;
|
1190
|
+
case 60: goto tr1;
|
1191
|
+
}
|
1192
|
+
goto tr35;
|
1193
|
+
tr35:
|
1194
|
+
#line 16 "ext/xrb/markup.rl"
|
1195
|
+
{
|
1196
|
+
pcdata = Qnil;
|
1197
|
+
has_entities = 0;
|
1198
|
+
}
|
1199
|
+
#line 31 "ext/xrb/markup.rl"
|
1200
|
+
{
|
1201
|
+
characters.begin = p;
|
1202
|
+
}
|
1203
|
+
goto st13;
|
1204
|
+
tr39:
|
1205
|
+
#line 31 "ext/xrb/markup.rl"
|
1206
|
+
{
|
1207
|
+
characters.begin = p;
|
1208
|
+
}
|
1209
|
+
goto st13;
|
1210
|
+
st13:
|
1211
|
+
if ( ++p == pe )
|
1212
|
+
goto _test_eof13;
|
1213
|
+
case 13:
|
1214
|
+
#line 1215 "ext/xrb/markup.c"
|
1215
|
+
switch( (*p) ) {
|
1216
|
+
case 38: goto tr38;
|
1217
|
+
case 39: goto tr24;
|
1218
|
+
case 60: goto tr1;
|
1219
|
+
}
|
1220
|
+
goto st13;
|
1221
|
+
tr36:
|
1222
|
+
#line 16 "ext/xrb/markup.rl"
|
1223
|
+
{
|
1224
|
+
pcdata = Qnil;
|
1225
|
+
has_entities = 0;
|
1226
|
+
}
|
1227
|
+
#line 10 "parsers/xrb/entities.rl"
|
1228
|
+
{{stack[top++] = 14;goto st42;}}
|
1229
|
+
goto st14;
|
1230
|
+
tr38:
|
1231
|
+
#line 35 "ext/xrb/markup.rl"
|
1232
|
+
{
|
1233
|
+
characters.end = p;
|
1234
|
+
|
1235
|
+
XRB_append_token(&pcdata, encoding, characters);
|
1236
|
+
}
|
1237
|
+
#line 10 "parsers/xrb/entities.rl"
|
1238
|
+
{{stack[top++] = 14;goto st42;}}
|
1239
|
+
goto st14;
|
1240
|
+
tr40:
|
1241
|
+
#line 10 "parsers/xrb/entities.rl"
|
1242
|
+
{{stack[top++] = 14;goto st42;}}
|
1243
|
+
goto st14;
|
1244
|
+
st14:
|
1245
|
+
if ( ++p == pe )
|
1246
|
+
goto _test_eof14;
|
1247
|
+
case 14:
|
1248
|
+
#line 1249 "ext/xrb/markup.c"
|
1249
|
+
switch( (*p) ) {
|
1250
|
+
case 38: goto tr40;
|
1251
|
+
case 39: goto tr30;
|
1252
|
+
case 60: goto tr1;
|
1253
|
+
}
|
1254
|
+
goto tr39;
|
1255
|
+
st15:
|
1256
|
+
if ( ++p == pe )
|
1257
|
+
goto _test_eof15;
|
1258
|
+
case 15:
|
1259
|
+
switch( (*p) ) {
|
1260
|
+
case 45: goto st16;
|
1261
|
+
case 68: goto st20;
|
1262
|
+
case 91: goto st27;
|
1263
|
+
}
|
1264
|
+
goto st0;
|
1265
|
+
st16:
|
1266
|
+
if ( ++p == pe )
|
1267
|
+
goto _test_eof16;
|
1268
|
+
case 16:
|
1269
|
+
if ( (*p) == 45 )
|
1270
|
+
goto st17;
|
1271
|
+
goto st0;
|
1272
|
+
st17:
|
1273
|
+
if ( ++p == pe )
|
1274
|
+
goto _test_eof17;
|
1275
|
+
case 17:
|
1276
|
+
if ( (*p) == 45 )
|
1277
|
+
goto st18;
|
1278
|
+
goto st17;
|
1279
|
+
st18:
|
1280
|
+
if ( ++p == pe )
|
1281
|
+
goto _test_eof18;
|
1282
|
+
case 18:
|
1283
|
+
if ( (*p) == 45 )
|
1284
|
+
goto st19;
|
1285
|
+
goto st17;
|
1286
|
+
st19:
|
1287
|
+
if ( ++p == pe )
|
1288
|
+
goto _test_eof19;
|
1289
|
+
case 19:
|
1290
|
+
switch( (*p) ) {
|
1291
|
+
case 45: goto st19;
|
1292
|
+
case 62: goto st52;
|
1293
|
+
}
|
1294
|
+
goto st17;
|
1295
|
+
st52:
|
1296
|
+
if ( ++p == pe )
|
1297
|
+
goto _test_eof52;
|
1298
|
+
case 52:
|
1299
|
+
switch( (*p) ) {
|
1300
|
+
case 38: goto tr100;
|
1301
|
+
case 60: goto tr101;
|
1302
|
+
}
|
1303
|
+
goto tr99;
|
1304
|
+
st20:
|
1305
|
+
if ( ++p == pe )
|
1306
|
+
goto _test_eof20;
|
1307
|
+
case 20:
|
1308
|
+
if ( (*p) == 79 )
|
1309
|
+
goto st21;
|
1310
|
+
goto st0;
|
1311
|
+
st21:
|
1312
|
+
if ( ++p == pe )
|
1313
|
+
goto _test_eof21;
|
1314
|
+
case 21:
|
1315
|
+
if ( (*p) == 67 )
|
1316
|
+
goto st22;
|
1317
|
+
goto st0;
|
1318
|
+
st22:
|
1319
|
+
if ( ++p == pe )
|
1320
|
+
goto _test_eof22;
|
1321
|
+
case 22:
|
1322
|
+
if ( (*p) == 84 )
|
1323
|
+
goto st23;
|
1324
|
+
goto st0;
|
1325
|
+
st23:
|
1326
|
+
if ( ++p == pe )
|
1327
|
+
goto _test_eof23;
|
1328
|
+
case 23:
|
1329
|
+
if ( (*p) == 89 )
|
1330
|
+
goto st24;
|
1331
|
+
goto st0;
|
1332
|
+
st24:
|
1333
|
+
if ( ++p == pe )
|
1334
|
+
goto _test_eof24;
|
1335
|
+
case 24:
|
1336
|
+
if ( (*p) == 80 )
|
1337
|
+
goto st25;
|
1338
|
+
goto st0;
|
1339
|
+
st25:
|
1340
|
+
if ( ++p == pe )
|
1341
|
+
goto _test_eof25;
|
1342
|
+
case 25:
|
1343
|
+
if ( (*p) == 69 )
|
1344
|
+
goto st26;
|
1345
|
+
goto st0;
|
1346
|
+
st26:
|
1347
|
+
if ( ++p == pe )
|
1348
|
+
goto _test_eof26;
|
1349
|
+
case 26:
|
1350
|
+
if ( (*p) == 62 )
|
1351
|
+
goto st53;
|
1352
|
+
goto st26;
|
1353
|
+
st53:
|
1354
|
+
if ( ++p == pe )
|
1355
|
+
goto _test_eof53;
|
1356
|
+
case 53:
|
1357
|
+
switch( (*p) ) {
|
1358
|
+
case 38: goto tr103;
|
1359
|
+
case 60: goto tr104;
|
1360
|
+
}
|
1361
|
+
goto tr102;
|
1362
|
+
st27:
|
1363
|
+
if ( ++p == pe )
|
1364
|
+
goto _test_eof27;
|
1365
|
+
case 27:
|
1366
|
+
if ( (*p) == 67 )
|
1367
|
+
goto st28;
|
1368
|
+
goto st0;
|
1369
|
+
st28:
|
1370
|
+
if ( ++p == pe )
|
1371
|
+
goto _test_eof28;
|
1372
|
+
case 28:
|
1373
|
+
if ( (*p) == 68 )
|
1374
|
+
goto st29;
|
1375
|
+
goto st0;
|
1376
|
+
st29:
|
1377
|
+
if ( ++p == pe )
|
1378
|
+
goto _test_eof29;
|
1379
|
+
case 29:
|
1380
|
+
if ( (*p) == 65 )
|
1381
|
+
goto st30;
|
1382
|
+
goto st0;
|
1383
|
+
st30:
|
1384
|
+
if ( ++p == pe )
|
1385
|
+
goto _test_eof30;
|
1386
|
+
case 30:
|
1387
|
+
if ( (*p) == 84 )
|
1388
|
+
goto st31;
|
1389
|
+
goto st0;
|
1390
|
+
st31:
|
1391
|
+
if ( ++p == pe )
|
1392
|
+
goto _test_eof31;
|
1393
|
+
case 31:
|
1394
|
+
if ( (*p) == 65 )
|
1395
|
+
goto st32;
|
1396
|
+
goto st0;
|
1397
|
+
st32:
|
1398
|
+
if ( ++p == pe )
|
1399
|
+
goto _test_eof32;
|
1400
|
+
case 32:
|
1401
|
+
if ( (*p) == 91 )
|
1402
|
+
goto st33;
|
1403
|
+
goto st0;
|
1404
|
+
st33:
|
1405
|
+
if ( ++p == pe )
|
1406
|
+
goto _test_eof33;
|
1407
|
+
case 33:
|
1408
|
+
if ( (*p) == 93 )
|
1409
|
+
goto st34;
|
1410
|
+
goto st33;
|
1411
|
+
st34:
|
1412
|
+
if ( ++p == pe )
|
1413
|
+
goto _test_eof34;
|
1414
|
+
case 34:
|
1415
|
+
if ( (*p) == 93 )
|
1416
|
+
goto st35;
|
1417
|
+
goto st33;
|
1418
|
+
st35:
|
1419
|
+
if ( ++p == pe )
|
1420
|
+
goto _test_eof35;
|
1421
|
+
case 35:
|
1422
|
+
switch( (*p) ) {
|
1423
|
+
case 62: goto st54;
|
1424
|
+
case 93: goto st35;
|
1425
|
+
}
|
1426
|
+
goto st33;
|
1427
|
+
st54:
|
1428
|
+
if ( ++p == pe )
|
1429
|
+
goto _test_eof54;
|
1430
|
+
case 54:
|
1431
|
+
switch( (*p) ) {
|
1432
|
+
case 38: goto tr106;
|
1433
|
+
case 60: goto tr107;
|
1434
|
+
}
|
1435
|
+
goto tr105;
|
1436
|
+
st36:
|
1437
|
+
if ( ++p == pe )
|
1438
|
+
goto _test_eof36;
|
1439
|
+
case 36:
|
1440
|
+
switch( (*p) ) {
|
1441
|
+
case 47: goto tr1;
|
1442
|
+
case 96: goto tr1;
|
1443
|
+
}
|
1444
|
+
if ( (*p) < 59 ) {
|
1445
|
+
if ( 0 <= (*p) && (*p) <= 44 )
|
1446
|
+
goto tr1;
|
1447
|
+
} else if ( (*p) > 64 ) {
|
1448
|
+
if ( (*p) > 94 ) {
|
1449
|
+
if ( 123 <= (*p) )
|
1450
|
+
goto tr1;
|
1451
|
+
} else if ( (*p) >= 91 )
|
1452
|
+
goto tr1;
|
1453
|
+
} else
|
1454
|
+
goto tr1;
|
1455
|
+
goto tr65;
|
1456
|
+
tr65:
|
1457
|
+
#line 8 "ext/xrb/markup.rl"
|
1458
|
+
{
|
1459
|
+
identifier.begin = p;
|
1460
|
+
}
|
1461
|
+
goto st37;
|
1462
|
+
st37:
|
1463
|
+
if ( ++p == pe )
|
1464
|
+
goto _test_eof37;
|
1465
|
+
case 37:
|
1466
|
+
#line 1467 "ext/xrb/markup.c"
|
1467
|
+
switch( (*p) ) {
|
1468
|
+
case 47: goto tr1;
|
1469
|
+
case 62: goto tr67;
|
1470
|
+
case 96: goto tr1;
|
1471
|
+
}
|
1472
|
+
if ( (*p) < 59 ) {
|
1473
|
+
if ( 0 <= (*p) && (*p) <= 44 )
|
1474
|
+
goto tr1;
|
1475
|
+
} else if ( (*p) > 64 ) {
|
1476
|
+
if ( (*p) > 94 ) {
|
1477
|
+
if ( 123 <= (*p) )
|
1478
|
+
goto tr1;
|
1479
|
+
} else if ( (*p) >= 91 )
|
1480
|
+
goto tr1;
|
1481
|
+
} else
|
1482
|
+
goto tr1;
|
1483
|
+
goto st37;
|
1484
|
+
tr67:
|
1485
|
+
#line 12 "ext/xrb/markup.rl"
|
1486
|
+
{
|
1487
|
+
identifier.end = p;
|
1488
|
+
}
|
1489
|
+
goto st55;
|
1490
|
+
st55:
|
1491
|
+
if ( ++p == pe )
|
1492
|
+
goto _test_eof55;
|
1493
|
+
case 55:
|
1494
|
+
#line 1495 "ext/xrb/markup.c"
|
1495
|
+
switch( (*p) ) {
|
1496
|
+
case 38: goto tr109;
|
1497
|
+
case 60: goto tr110;
|
1498
|
+
}
|
1499
|
+
goto tr108;
|
1500
|
+
st38:
|
1501
|
+
if ( ++p == pe )
|
1502
|
+
goto _test_eof38;
|
1503
|
+
case 38:
|
1504
|
+
switch( (*p) ) {
|
1505
|
+
case 47: goto tr69;
|
1506
|
+
case 96: goto tr69;
|
1507
|
+
}
|
1508
|
+
if ( (*p) < 59 ) {
|
1509
|
+
if ( 0 <= (*p) && (*p) <= 44 )
|
1510
|
+
goto tr69;
|
1511
|
+
} else if ( (*p) > 64 ) {
|
1512
|
+
if ( (*p) > 94 ) {
|
1513
|
+
if ( 123 <= (*p) )
|
1514
|
+
goto tr69;
|
1515
|
+
} else if ( (*p) >= 91 )
|
1516
|
+
goto tr69;
|
1517
|
+
} else
|
1518
|
+
goto tr69;
|
1519
|
+
goto tr68;
|
1520
|
+
tr68:
|
1521
|
+
#line 8 "ext/xrb/markup.rl"
|
1522
|
+
{
|
1523
|
+
identifier.begin = p;
|
1524
|
+
}
|
1525
|
+
goto st39;
|
1526
|
+
st39:
|
1527
|
+
if ( ++p == pe )
|
1528
|
+
goto _test_eof39;
|
1529
|
+
case 39:
|
1530
|
+
#line 1531 "ext/xrb/markup.c"
|
1531
|
+
switch( (*p) ) {
|
1532
|
+
case 32: goto tr71;
|
1533
|
+
case 47: goto tr69;
|
1534
|
+
case 96: goto tr69;
|
1535
|
+
}
|
1536
|
+
if ( (*p) < 14 ) {
|
1537
|
+
if ( (*p) > 8 ) {
|
1538
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
1539
|
+
goto tr71;
|
1540
|
+
} else if ( (*p) >= 0 )
|
1541
|
+
goto tr69;
|
1542
|
+
} else if ( (*p) > 44 ) {
|
1543
|
+
if ( (*p) < 91 ) {
|
1544
|
+
if ( 59 <= (*p) && (*p) <= 64 )
|
1545
|
+
goto tr69;
|
1546
|
+
} else if ( (*p) > 94 ) {
|
1547
|
+
if ( 123 <= (*p) )
|
1548
|
+
goto tr69;
|
1549
|
+
} else
|
1550
|
+
goto tr69;
|
1551
|
+
} else
|
1552
|
+
goto tr69;
|
1553
|
+
goto st39;
|
1554
|
+
tr71:
|
1555
|
+
#line 12 "ext/xrb/markup.rl"
|
1556
|
+
{
|
1557
|
+
identifier.end = p;
|
1558
|
+
}
|
1559
|
+
#line 111 "ext/xrb/markup.rl"
|
1560
|
+
{
|
1561
|
+
}
|
1562
|
+
goto st40;
|
1563
|
+
st40:
|
1564
|
+
if ( ++p == pe )
|
1565
|
+
goto _test_eof40;
|
1566
|
+
case 40:
|
1567
|
+
#line 1568 "ext/xrb/markup.c"
|
1568
|
+
if ( (*p) == 63 )
|
1569
|
+
goto tr73;
|
1570
|
+
goto st40;
|
1571
|
+
tr73:
|
1572
|
+
#line 114 "ext/xrb/markup.rl"
|
1573
|
+
{
|
1574
|
+
}
|
1575
|
+
goto st41;
|
1576
|
+
st41:
|
1577
|
+
if ( ++p == pe )
|
1578
|
+
goto _test_eof41;
|
1579
|
+
case 41:
|
1580
|
+
#line 1581 "ext/xrb/markup.c"
|
1581
|
+
switch( (*p) ) {
|
1582
|
+
case 62: goto st56;
|
1583
|
+
case 63: goto tr73;
|
1584
|
+
}
|
1585
|
+
goto st40;
|
1586
|
+
st56:
|
1587
|
+
if ( ++p == pe )
|
1588
|
+
goto _test_eof56;
|
1589
|
+
case 56:
|
1590
|
+
switch( (*p) ) {
|
1591
|
+
case 38: goto tr112;
|
1592
|
+
case 60: goto tr113;
|
1593
|
+
}
|
1594
|
+
goto tr111;
|
1595
|
+
st42:
|
1596
|
+
if ( ++p == pe )
|
1597
|
+
goto _test_eof42;
|
1598
|
+
case 42:
|
1599
|
+
if ( (*p) == 35 )
|
1600
|
+
goto st43;
|
1601
|
+
if ( (*p) < 65 ) {
|
1602
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
1603
|
+
goto tr77;
|
1604
|
+
} else if ( (*p) > 90 ) {
|
1605
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1606
|
+
goto tr77;
|
1607
|
+
} else
|
1608
|
+
goto tr77;
|
1609
|
+
goto tr75;
|
1610
|
+
st43:
|
1611
|
+
if ( ++p == pe )
|
1612
|
+
goto _test_eof43;
|
1613
|
+
case 43:
|
1614
|
+
if ( (*p) == 120 )
|
1615
|
+
goto st45;
|
1616
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
1617
|
+
goto tr78;
|
1618
|
+
goto tr75;
|
1619
|
+
tr78:
|
1620
|
+
#line 45 "ext/xrb/markup.rl"
|
1621
|
+
{
|
1622
|
+
entity.begin = p;
|
1623
|
+
}
|
1624
|
+
goto st44;
|
1625
|
+
st44:
|
1626
|
+
if ( ++p == pe )
|
1627
|
+
goto _test_eof44;
|
1628
|
+
case 44:
|
1629
|
+
#line 1630 "ext/xrb/markup.c"
|
1630
|
+
if ( (*p) == 59 )
|
1631
|
+
goto tr81;
|
1632
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
1633
|
+
goto st44;
|
1634
|
+
goto tr75;
|
1635
|
+
tr81:
|
1636
|
+
#line 69 "ext/xrb/markup.rl"
|
1637
|
+
{
|
1638
|
+
entity.end = p;
|
1639
|
+
|
1640
|
+
has_entities = 1;
|
1641
|
+
|
1642
|
+
codepoint = strtoul(entity.begin, (char **)&entity.end, 10);
|
1643
|
+
|
1644
|
+
XRB_append_codepoint(&pcdata, encoding, codepoint);
|
1645
|
+
}
|
1646
|
+
#line 8 "parsers/xrb/entities.rl"
|
1647
|
+
{{cs = stack[--top];goto _again;}}
|
1648
|
+
goto st57;
|
1649
|
+
tr84:
|
1650
|
+
#line 59 "ext/xrb/markup.rl"
|
1651
|
+
{
|
1652
|
+
entity.end = p;
|
1653
|
+
|
1654
|
+
has_entities = 1;
|
1655
|
+
|
1656
|
+
codepoint = strtoul(entity.begin, (char **)&entity.end, 16);
|
1657
|
+
|
1658
|
+
XRB_append_codepoint(&pcdata, encoding, codepoint);
|
1659
|
+
}
|
1660
|
+
#line 8 "parsers/xrb/entities.rl"
|
1661
|
+
{{cs = stack[--top];goto _again;}}
|
1662
|
+
goto st57;
|
1663
|
+
tr86:
|
1664
|
+
#line 49 "ext/xrb/markup.rl"
|
1665
|
+
{
|
1666
|
+
entity.end = p;
|
1667
|
+
|
1668
|
+
has_entities = 1;
|
1669
|
+
|
1670
|
+
XRB_append(&pcdata, encoding,
|
1671
|
+
rb_funcall(entities, id_key_get, 1, XRB_Token_string(entity, encoding))
|
1672
|
+
);
|
1673
|
+
}
|
1674
|
+
#line 8 "parsers/xrb/entities.rl"
|
1675
|
+
{{cs = stack[--top];goto _again;}}
|
1676
|
+
goto st57;
|
1677
|
+
st57:
|
1678
|
+
if ( ++p == pe )
|
1679
|
+
goto _test_eof57;
|
1680
|
+
case 57:
|
1681
|
+
#line 1682 "ext/xrb/markup.c"
|
1682
|
+
goto st0;
|
1683
|
+
st45:
|
1684
|
+
if ( ++p == pe )
|
1685
|
+
goto _test_eof45;
|
1686
|
+
case 45:
|
1687
|
+
if ( (*p) < 65 ) {
|
1688
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
1689
|
+
goto tr82;
|
1690
|
+
} else if ( (*p) > 70 ) {
|
1691
|
+
if ( 97 <= (*p) && (*p) <= 102 )
|
1692
|
+
goto tr82;
|
1693
|
+
} else
|
1694
|
+
goto tr82;
|
1695
|
+
goto tr75;
|
1696
|
+
tr82:
|
1697
|
+
#line 45 "ext/xrb/markup.rl"
|
1698
|
+
{
|
1699
|
+
entity.begin = p;
|
1700
|
+
}
|
1701
|
+
goto st46;
|
1702
|
+
st46:
|
1703
|
+
if ( ++p == pe )
|
1704
|
+
goto _test_eof46;
|
1705
|
+
case 46:
|
1706
|
+
#line 1707 "ext/xrb/markup.c"
|
1707
|
+
if ( (*p) == 59 )
|
1708
|
+
goto tr84;
|
1709
|
+
if ( (*p) < 65 ) {
|
1710
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
1711
|
+
goto st46;
|
1712
|
+
} else if ( (*p) > 70 ) {
|
1713
|
+
if ( 97 <= (*p) && (*p) <= 102 )
|
1714
|
+
goto st46;
|
1715
|
+
} else
|
1716
|
+
goto st46;
|
1717
|
+
goto tr75;
|
1718
|
+
tr77:
|
1719
|
+
#line 45 "ext/xrb/markup.rl"
|
1720
|
+
{
|
1721
|
+
entity.begin = p;
|
1722
|
+
}
|
1723
|
+
goto st47;
|
1724
|
+
st47:
|
1725
|
+
if ( ++p == pe )
|
1726
|
+
goto _test_eof47;
|
1727
|
+
case 47:
|
1728
|
+
#line 1729 "ext/xrb/markup.c"
|
1729
|
+
if ( (*p) == 59 )
|
1730
|
+
goto tr86;
|
1731
|
+
if ( (*p) < 65 ) {
|
1732
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
1733
|
+
goto st47;
|
1734
|
+
} else if ( (*p) > 90 ) {
|
1735
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1736
|
+
goto st47;
|
1737
|
+
} else
|
1738
|
+
goto st47;
|
1739
|
+
goto tr75;
|
1740
|
+
}
|
1741
|
+
_test_eof48: cs = 48; goto _test_eof;
|
1742
|
+
_test_eof49: cs = 49; goto _test_eof;
|
1743
|
+
_test_eof50: cs = 50; goto _test_eof;
|
1744
|
+
_test_eof1: cs = 1; goto _test_eof;
|
1745
|
+
_test_eof2: cs = 2; goto _test_eof;
|
1746
|
+
_test_eof3: cs = 3; goto _test_eof;
|
1747
|
+
_test_eof4: cs = 4; goto _test_eof;
|
1748
|
+
_test_eof5: cs = 5; goto _test_eof;
|
1749
|
+
_test_eof51: cs = 51; goto _test_eof;
|
1750
|
+
_test_eof6: cs = 6; goto _test_eof;
|
1751
|
+
_test_eof7: cs = 7; goto _test_eof;
|
1752
|
+
_test_eof8: cs = 8; goto _test_eof;
|
1753
|
+
_test_eof9: cs = 9; goto _test_eof;
|
1754
|
+
_test_eof10: cs = 10; goto _test_eof;
|
1755
|
+
_test_eof11: cs = 11; goto _test_eof;
|
1756
|
+
_test_eof12: cs = 12; goto _test_eof;
|
1757
|
+
_test_eof13: cs = 13; goto _test_eof;
|
1758
|
+
_test_eof14: cs = 14; goto _test_eof;
|
1759
|
+
_test_eof15: cs = 15; goto _test_eof;
|
1760
|
+
_test_eof16: cs = 16; goto _test_eof;
|
1761
|
+
_test_eof17: cs = 17; goto _test_eof;
|
1762
|
+
_test_eof18: cs = 18; goto _test_eof;
|
1763
|
+
_test_eof19: cs = 19; goto _test_eof;
|
1764
|
+
_test_eof52: cs = 52; goto _test_eof;
|
1765
|
+
_test_eof20: cs = 20; goto _test_eof;
|
1766
|
+
_test_eof21: cs = 21; goto _test_eof;
|
1767
|
+
_test_eof22: cs = 22; goto _test_eof;
|
1768
|
+
_test_eof23: cs = 23; goto _test_eof;
|
1769
|
+
_test_eof24: cs = 24; goto _test_eof;
|
1770
|
+
_test_eof25: cs = 25; goto _test_eof;
|
1771
|
+
_test_eof26: cs = 26; goto _test_eof;
|
1772
|
+
_test_eof53: cs = 53; goto _test_eof;
|
1773
|
+
_test_eof27: cs = 27; goto _test_eof;
|
1774
|
+
_test_eof28: cs = 28; goto _test_eof;
|
1775
|
+
_test_eof29: cs = 29; goto _test_eof;
|
1776
|
+
_test_eof30: cs = 30; goto _test_eof;
|
1777
|
+
_test_eof31: cs = 31; goto _test_eof;
|
1778
|
+
_test_eof32: cs = 32; goto _test_eof;
|
1779
|
+
_test_eof33: cs = 33; goto _test_eof;
|
1780
|
+
_test_eof34: cs = 34; goto _test_eof;
|
1781
|
+
_test_eof35: cs = 35; goto _test_eof;
|
1782
|
+
_test_eof54: cs = 54; goto _test_eof;
|
1783
|
+
_test_eof36: cs = 36; goto _test_eof;
|
1784
|
+
_test_eof37: cs = 37; goto _test_eof;
|
1785
|
+
_test_eof55: cs = 55; goto _test_eof;
|
1786
|
+
_test_eof38: cs = 38; goto _test_eof;
|
1787
|
+
_test_eof39: cs = 39; goto _test_eof;
|
1788
|
+
_test_eof40: cs = 40; goto _test_eof;
|
1789
|
+
_test_eof41: cs = 41; goto _test_eof;
|
1790
|
+
_test_eof56: cs = 56; goto _test_eof;
|
1791
|
+
_test_eof42: cs = 42; goto _test_eof;
|
1792
|
+
_test_eof43: cs = 43; goto _test_eof;
|
1793
|
+
_test_eof44: cs = 44; goto _test_eof;
|
1794
|
+
_test_eof57: cs = 57; goto _test_eof;
|
1795
|
+
_test_eof45: cs = 45; goto _test_eof;
|
1796
|
+
_test_eof46: cs = 46; goto _test_eof;
|
1797
|
+
_test_eof47: cs = 47; goto _test_eof;
|
1798
|
+
|
1799
|
+
_test_eof: {}
|
1800
|
+
if ( p == eof )
|
1801
|
+
{
|
1802
|
+
switch ( cs ) {
|
1803
|
+
case 42:
|
1804
|
+
case 43:
|
1805
|
+
case 44:
|
1806
|
+
case 45:
|
1807
|
+
case 46:
|
1808
|
+
case 47:
|
1809
|
+
#line 41 "ext/xrb/markup.rl"
|
1810
|
+
{
|
1811
|
+
XRB_raise_error("could not parse entity", buffer, p-s);
|
1812
|
+
}
|
1813
|
+
break;
|
1814
|
+
case 53:
|
1815
|
+
#line 83 "ext/xrb/markup.rl"
|
1816
|
+
{
|
1817
|
+
doctype.end = p;
|
1818
|
+
|
1819
|
+
rb_funcall(delegate, id_doctype, 1, XRB_Token_string(doctype, encoding));
|
1820
|
+
}
|
1821
|
+
break;
|
1822
|
+
case 26:
|
1823
|
+
#line 89 "ext/xrb/markup.rl"
|
1824
|
+
{
|
1825
|
+
XRB_raise_error("could not parse doctype", buffer, p-s);
|
1826
|
+
}
|
1827
|
+
break;
|
1828
|
+
case 52:
|
1829
|
+
#line 97 "ext/xrb/markup.rl"
|
1830
|
+
{
|
1831
|
+
comment.end = p;
|
1832
|
+
|
1833
|
+
rb_funcall(delegate, id_comment, 1, XRB_Token_string(comment, encoding));
|
1834
|
+
}
|
1835
|
+
break;
|
1836
|
+
case 17:
|
1837
|
+
case 18:
|
1838
|
+
case 19:
|
1839
|
+
#line 103 "ext/xrb/markup.rl"
|
1840
|
+
{
|
1841
|
+
XRB_raise_error("could not parse comment", buffer, p-s);
|
1842
|
+
}
|
1843
|
+
break;
|
1844
|
+
case 56:
|
1845
|
+
#line 117 "ext/xrb/markup.rl"
|
1846
|
+
{
|
1847
|
+
instruction.end = p;
|
1848
|
+
|
1849
|
+
rb_funcall(delegate, id_instruction, 1, XRB_Token_string(instruction, encoding));
|
1850
|
+
}
|
1851
|
+
break;
|
1852
|
+
case 38:
|
1853
|
+
case 39:
|
1854
|
+
case 40:
|
1855
|
+
case 41:
|
1856
|
+
#line 123 "ext/xrb/markup.rl"
|
1857
|
+
{
|
1858
|
+
XRB_raise_error("could not parse instruction", buffer, p-s);
|
1859
|
+
}
|
1860
|
+
break;
|
1861
|
+
case 51:
|
1862
|
+
#line 163 "ext/xrb/markup.rl"
|
1863
|
+
{
|
1864
|
+
rb_funcall(delegate, id_open_tag_end, 1, self_closing == 1 ? Qtrue : Qfalse);
|
1865
|
+
}
|
1866
|
+
break;
|
1867
|
+
case 55:
|
1868
|
+
#line 170 "ext/xrb/markup.rl"
|
1869
|
+
{
|
1870
|
+
rb_funcall(delegate, id_close_tag, 2, XRB_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
1871
|
+
}
|
1872
|
+
break;
|
1873
|
+
case 1:
|
1874
|
+
case 2:
|
1875
|
+
case 3:
|
1876
|
+
case 4:
|
1877
|
+
case 5:
|
1878
|
+
case 6:
|
1879
|
+
case 7:
|
1880
|
+
case 8:
|
1881
|
+
case 9:
|
1882
|
+
case 10:
|
1883
|
+
case 11:
|
1884
|
+
case 12:
|
1885
|
+
case 13:
|
1886
|
+
case 14:
|
1887
|
+
case 36:
|
1888
|
+
case 37:
|
1889
|
+
#line 174 "ext/xrb/markup.rl"
|
1890
|
+
{
|
1891
|
+
XRB_raise_error("could not parse tag", buffer, p-s);
|
1892
|
+
}
|
1893
|
+
break;
|
1894
|
+
case 54:
|
1895
|
+
#line 182 "ext/xrb/markup.rl"
|
1896
|
+
{
|
1897
|
+
cdata.end = p;
|
1898
|
+
|
1899
|
+
rb_funcall(delegate, id_cdata, 1, XRB_Token_string(cdata, encoding));
|
1900
|
+
}
|
1901
|
+
break;
|
1902
|
+
case 33:
|
1903
|
+
case 34:
|
1904
|
+
case 35:
|
1905
|
+
#line 188 "ext/xrb/markup.rl"
|
1906
|
+
{
|
1907
|
+
XRB_raise_error("could not parse cdata", buffer, p-s);
|
1908
|
+
}
|
1909
|
+
break;
|
1910
|
+
case 50:
|
1911
|
+
#line 21 "ext/xrb/markup.rl"
|
1912
|
+
{
|
1913
|
+
}
|
1914
|
+
#line 27 "ext/xrb/markup.rl"
|
1915
|
+
{
|
1916
|
+
rb_funcall(delegate, id_text, 1, XRB_markup_safe(pcdata, has_entities));
|
1917
|
+
}
|
1918
|
+
break;
|
1919
|
+
case 49:
|
1920
|
+
#line 35 "ext/xrb/markup.rl"
|
1921
|
+
{
|
1922
|
+
characters.end = p;
|
1923
|
+
|
1924
|
+
XRB_append_token(&pcdata, encoding, characters);
|
1925
|
+
}
|
1926
|
+
#line 21 "ext/xrb/markup.rl"
|
1927
|
+
{
|
1928
|
+
}
|
1929
|
+
#line 27 "ext/xrb/markup.rl"
|
1930
|
+
{
|
1931
|
+
rb_funcall(delegate, id_text, 1, XRB_markup_safe(pcdata, has_entities));
|
1932
|
+
}
|
1933
|
+
break;
|
1934
|
+
#line 1935 "ext/xrb/markup.c"
|
1935
|
+
}
|
1936
|
+
}
|
1937
|
+
|
1938
|
+
_out: {}
|
1939
|
+
}
|
1940
|
+
|
1941
|
+
#line 219 "ext/xrb/markup.rl"
|
1942
|
+
|
1943
|
+
|
1944
|
+
if (p != eof) {
|
1945
|
+
XRB_raise_error("could not parse all input", buffer, p-s);
|
1946
|
+
}
|
1947
|
+
|
1948
|
+
return Qnil;
|
1949
|
+
}
|