trenni 3.8.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8daf0b4e7519f7cf5dc9ceb959b17b13094b2908ed1d5a7421880c9867511b1
|
4
|
+
data.tar.gz: 15c6e221db0e24ed37a7b3cc65c8ce68be223972c1bb75a0e0171d3b4725ba78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7063eae72ed9a392771c904152cb472cb18e4b46196e20365dc9cace23347eca3054c33a2c01badd8d6ed6a027121aa6ec2b4f616597ff752810d339a61cef7
|
7
|
+
data.tar.gz: 531ed1c5fabc91dd36eb299b1c779c417f65c7aefc0026aa5ecaab3a6d84a2dce22eb7fa8dfdf43d1a1c36e9eb840d5d39acd51e6d4a9e8e471fe0dc6577a70f
|
data/.editorconfig
ADDED
data/ext/trenni/markup.c
CHANGED
@@ -29,7 +29,7 @@ VALUE Trenni_Native_parse_markup(VALUE self, VALUE buffer, VALUE delegate, VALUE
|
|
29
29
|
unsigned long cs, top = 0, stack[2] = {0};
|
30
30
|
unsigned long codepoint = 0;
|
31
31
|
|
32
|
-
|
32
|
+
Trenni_Token identifier = {0}, cdata = {0}, characters = {0}, entity = {0}, doctype = {0}, comment = {0}, instruction = {0};
|
33
33
|
unsigned self_closing = 0, has_value = 0, has_entities = 0;
|
34
34
|
|
35
35
|
s = p = RSTRING_PTR(string);
|
@@ -168,7 +168,7 @@ tr99:
|
|
168
168
|
{
|
169
169
|
comment.end = p;
|
170
170
|
|
171
|
-
rb_funcall(delegate, id_comment, 1,
|
171
|
+
rb_funcall(delegate, id_comment, 1, Trenni_Token_string(comment, encoding));
|
172
172
|
}
|
173
173
|
#line 24 "markup.rl"
|
174
174
|
{
|
@@ -188,7 +188,7 @@ tr102:
|
|
188
188
|
{
|
189
189
|
doctype.end = p;
|
190
190
|
|
191
|
-
rb_funcall(delegate, id_doctype, 1,
|
191
|
+
rb_funcall(delegate, id_doctype, 1, Trenni_Token_string(doctype, encoding));
|
192
192
|
}
|
193
193
|
#line 24 "markup.rl"
|
194
194
|
{
|
@@ -208,7 +208,7 @@ tr105:
|
|
208
208
|
{
|
209
209
|
cdata.end = p;
|
210
210
|
|
211
|
-
rb_funcall(delegate, id_cdata, 1,
|
211
|
+
rb_funcall(delegate, id_cdata, 1, Trenni_Token_string(cdata, encoding));
|
212
212
|
}
|
213
213
|
#line 24 "markup.rl"
|
214
214
|
{
|
@@ -226,7 +226,7 @@ tr105:
|
|
226
226
|
tr108:
|
227
227
|
#line 170 "markup.rl"
|
228
228
|
{
|
229
|
-
rb_funcall(delegate, id_close_tag, 2,
|
229
|
+
rb_funcall(delegate, id_close_tag, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
230
230
|
}
|
231
231
|
#line 24 "markup.rl"
|
232
232
|
{
|
@@ -246,7 +246,7 @@ tr111:
|
|
246
246
|
{
|
247
247
|
instruction.end = p;
|
248
248
|
|
249
|
-
rb_funcall(delegate, id_instruction, 1,
|
249
|
+
rb_funcall(delegate, id_instruction, 1, Trenni_Token_string(instruction, encoding));
|
250
250
|
}
|
251
251
|
#line 24 "markup.rl"
|
252
252
|
{
|
@@ -278,12 +278,12 @@ tr91:
|
|
278
278
|
|
279
279
|
Trenni_append_token(&pcdata, encoding, characters);
|
280
280
|
}
|
281
|
-
#line 10 "/
|
282
|
-
{{stack[top++] = 50;
|
281
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
282
|
+
{{stack[top++] = 50;goto st42;}}
|
283
283
|
goto st50;
|
284
284
|
tr94:
|
285
|
-
#line 10 "/
|
286
|
-
{{stack[top++] = 50;
|
285
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
286
|
+
{{stack[top++] = 50;goto st42;}}
|
287
287
|
goto st50;
|
288
288
|
tr88:
|
289
289
|
#line 24 "markup.rl"
|
@@ -294,8 +294,8 @@ tr88:
|
|
294
294
|
pcdata = Qnil;
|
295
295
|
has_entities = 0;
|
296
296
|
}
|
297
|
-
#line 10 "/
|
298
|
-
{{stack[top++] = 50;
|
297
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
298
|
+
{{stack[top++] = 50;goto st42;}}
|
299
299
|
goto st50;
|
300
300
|
tr97:
|
301
301
|
#line 163 "markup.rl"
|
@@ -310,15 +310,15 @@ tr97:
|
|
310
310
|
pcdata = Qnil;
|
311
311
|
has_entities = 0;
|
312
312
|
}
|
313
|
-
#line 10 "/
|
314
|
-
{{stack[top++] = 50;
|
313
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
314
|
+
{{stack[top++] = 50;goto st42;}}
|
315
315
|
goto st50;
|
316
316
|
tr100:
|
317
317
|
#line 97 "markup.rl"
|
318
318
|
{
|
319
319
|
comment.end = p;
|
320
320
|
|
321
|
-
rb_funcall(delegate, id_comment, 1,
|
321
|
+
rb_funcall(delegate, id_comment, 1, Trenni_Token_string(comment, encoding));
|
322
322
|
}
|
323
323
|
#line 24 "markup.rl"
|
324
324
|
{
|
@@ -328,15 +328,15 @@ tr100:
|
|
328
328
|
pcdata = Qnil;
|
329
329
|
has_entities = 0;
|
330
330
|
}
|
331
|
-
#line 10 "/
|
332
|
-
{{stack[top++] = 50;
|
331
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
332
|
+
{{stack[top++] = 50;goto st42;}}
|
333
333
|
goto st50;
|
334
334
|
tr103:
|
335
335
|
#line 83 "markup.rl"
|
336
336
|
{
|
337
337
|
doctype.end = p;
|
338
338
|
|
339
|
-
rb_funcall(delegate, id_doctype, 1,
|
339
|
+
rb_funcall(delegate, id_doctype, 1, Trenni_Token_string(doctype, encoding));
|
340
340
|
}
|
341
341
|
#line 24 "markup.rl"
|
342
342
|
{
|
@@ -346,15 +346,15 @@ tr103:
|
|
346
346
|
pcdata = Qnil;
|
347
347
|
has_entities = 0;
|
348
348
|
}
|
349
|
-
#line 10 "/
|
350
|
-
{{stack[top++] = 50;
|
349
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
350
|
+
{{stack[top++] = 50;goto st42;}}
|
351
351
|
goto st50;
|
352
352
|
tr106:
|
353
353
|
#line 182 "markup.rl"
|
354
354
|
{
|
355
355
|
cdata.end = p;
|
356
356
|
|
357
|
-
rb_funcall(delegate, id_cdata, 1,
|
357
|
+
rb_funcall(delegate, id_cdata, 1, Trenni_Token_string(cdata, encoding));
|
358
358
|
}
|
359
359
|
#line 24 "markup.rl"
|
360
360
|
{
|
@@ -364,13 +364,13 @@ tr106:
|
|
364
364
|
pcdata = Qnil;
|
365
365
|
has_entities = 0;
|
366
366
|
}
|
367
|
-
#line 10 "/
|
368
|
-
{{stack[top++] = 50;
|
367
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
368
|
+
{{stack[top++] = 50;goto st42;}}
|
369
369
|
goto st50;
|
370
370
|
tr109:
|
371
371
|
#line 170 "markup.rl"
|
372
372
|
{
|
373
|
-
rb_funcall(delegate, id_close_tag, 2,
|
373
|
+
rb_funcall(delegate, id_close_tag, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
374
374
|
}
|
375
375
|
#line 24 "markup.rl"
|
376
376
|
{
|
@@ -380,15 +380,15 @@ tr109:
|
|
380
380
|
pcdata = Qnil;
|
381
381
|
has_entities = 0;
|
382
382
|
}
|
383
|
-
#line 10 "/
|
384
|
-
{{stack[top++] = 50;
|
383
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
384
|
+
{{stack[top++] = 50;goto st42;}}
|
385
385
|
goto st50;
|
386
386
|
tr112:
|
387
387
|
#line 117 "markup.rl"
|
388
388
|
{
|
389
389
|
instruction.end = p;
|
390
390
|
|
391
|
-
rb_funcall(delegate, id_instruction, 1,
|
391
|
+
rb_funcall(delegate, id_instruction, 1, Trenni_Token_string(instruction, encoding));
|
392
392
|
}
|
393
393
|
#line 24 "markup.rl"
|
394
394
|
{
|
@@ -398,8 +398,8 @@ tr112:
|
|
398
398
|
pcdata = Qnil;
|
399
399
|
has_entities = 0;
|
400
400
|
}
|
401
|
-
#line 10 "/
|
402
|
-
{{stack[top++] = 50;
|
401
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
402
|
+
{{stack[top++] = 50;goto st42;}}
|
403
403
|
goto st50;
|
404
404
|
st50:
|
405
405
|
if ( ++p == pe )
|
@@ -536,7 +536,7 @@ tr101:
|
|
536
536
|
{
|
537
537
|
comment.end = p;
|
538
538
|
|
539
|
-
rb_funcall(delegate, id_comment, 1,
|
539
|
+
rb_funcall(delegate, id_comment, 1, Trenni_Token_string(comment, encoding));
|
540
540
|
}
|
541
541
|
#line 134 "markup.rl"
|
542
542
|
{
|
@@ -566,7 +566,7 @@ tr104:
|
|
566
566
|
{
|
567
567
|
doctype.end = p;
|
568
568
|
|
569
|
-
rb_funcall(delegate, id_doctype, 1,
|
569
|
+
rb_funcall(delegate, id_doctype, 1, Trenni_Token_string(doctype, encoding));
|
570
570
|
}
|
571
571
|
#line 134 "markup.rl"
|
572
572
|
{
|
@@ -596,7 +596,7 @@ tr107:
|
|
596
596
|
{
|
597
597
|
cdata.end = p;
|
598
598
|
|
599
|
-
rb_funcall(delegate, id_cdata, 1,
|
599
|
+
rb_funcall(delegate, id_cdata, 1, Trenni_Token_string(cdata, encoding));
|
600
600
|
}
|
601
601
|
#line 134 "markup.rl"
|
602
602
|
{
|
@@ -624,7 +624,7 @@ tr107:
|
|
624
624
|
tr110:
|
625
625
|
#line 170 "markup.rl"
|
626
626
|
{
|
627
|
-
rb_funcall(delegate, id_close_tag, 2,
|
627
|
+
rb_funcall(delegate, id_close_tag, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
628
628
|
}
|
629
629
|
#line 134 "markup.rl"
|
630
630
|
{
|
@@ -654,7 +654,7 @@ tr113:
|
|
654
654
|
{
|
655
655
|
instruction.end = p;
|
656
656
|
|
657
|
-
rb_funcall(delegate, id_instruction, 1,
|
657
|
+
rb_funcall(delegate, id_instruction, 1, Trenni_Token_string(instruction, encoding));
|
658
658
|
}
|
659
659
|
#line 134 "markup.rl"
|
660
660
|
{
|
@@ -769,7 +769,7 @@ tr6:
|
|
769
769
|
// Reset self-closing state - we don't know yet.
|
770
770
|
self_closing = 0;
|
771
771
|
|
772
|
-
rb_funcall(delegate, id_open_tag_begin, 2,
|
772
|
+
rb_funcall(delegate, id_open_tag_begin, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
773
773
|
}
|
774
774
|
goto st3;
|
775
775
|
tr14:
|
@@ -780,11 +780,11 @@ tr14:
|
|
780
780
|
#line 153 "markup.rl"
|
781
781
|
{
|
782
782
|
if (has_value == 1) {
|
783
|
-
rb_funcall(delegate, id_attribute, 2,
|
783
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
784
784
|
} else if (has_value == 2) {
|
785
|
-
rb_funcall(delegate, id_attribute, 2,
|
785
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
786
786
|
} else {
|
787
|
-
rb_funcall(delegate, id_attribute, 2,
|
787
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
788
788
|
}
|
789
789
|
}
|
790
790
|
goto st3;
|
@@ -796,11 +796,11 @@ tr26:
|
|
796
796
|
#line 153 "markup.rl"
|
797
797
|
{
|
798
798
|
if (has_value == 1) {
|
799
|
-
rb_funcall(delegate, id_attribute, 2,
|
799
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
800
800
|
} else if (has_value == 2) {
|
801
|
-
rb_funcall(delegate, id_attribute, 2,
|
801
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
802
802
|
} else {
|
803
|
-
rb_funcall(delegate, id_attribute, 2,
|
803
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
804
804
|
}
|
805
805
|
}
|
806
806
|
goto st3;
|
@@ -812,11 +812,11 @@ tr32:
|
|
812
812
|
#line 153 "markup.rl"
|
813
813
|
{
|
814
814
|
if (has_value == 1) {
|
815
|
-
rb_funcall(delegate, id_attribute, 2,
|
815
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
816
816
|
} else if (has_value == 2) {
|
817
|
-
rb_funcall(delegate, id_attribute, 2,
|
817
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
818
818
|
} else {
|
819
|
-
rb_funcall(delegate, id_attribute, 2,
|
819
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
820
820
|
}
|
821
821
|
}
|
822
822
|
goto st3;
|
@@ -899,7 +899,7 @@ tr7:
|
|
899
899
|
// Reset self-closing state - we don't know yet.
|
900
900
|
self_closing = 0;
|
901
901
|
|
902
|
-
rb_funcall(delegate, id_open_tag_begin, 2,
|
902
|
+
rb_funcall(delegate, id_open_tag_begin, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
903
903
|
}
|
904
904
|
#line 137 "markup.rl"
|
905
905
|
{
|
@@ -920,11 +920,11 @@ tr15:
|
|
920
920
|
#line 153 "markup.rl"
|
921
921
|
{
|
922
922
|
if (has_value == 1) {
|
923
|
-
rb_funcall(delegate, id_attribute, 2,
|
923
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
924
924
|
} else if (has_value == 2) {
|
925
|
-
rb_funcall(delegate, id_attribute, 2,
|
925
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
926
926
|
} else {
|
927
|
-
rb_funcall(delegate, id_attribute, 2,
|
927
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
928
928
|
}
|
929
929
|
}
|
930
930
|
#line 137 "markup.rl"
|
@@ -940,11 +940,11 @@ tr27:
|
|
940
940
|
#line 153 "markup.rl"
|
941
941
|
{
|
942
942
|
if (has_value == 1) {
|
943
|
-
rb_funcall(delegate, id_attribute, 2,
|
943
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
944
944
|
} else if (has_value == 2) {
|
945
|
-
rb_funcall(delegate, id_attribute, 2,
|
945
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
946
946
|
} else {
|
947
|
-
rb_funcall(delegate, id_attribute, 2,
|
947
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
948
948
|
}
|
949
949
|
}
|
950
950
|
#line 137 "markup.rl"
|
@@ -960,11 +960,11 @@ tr33:
|
|
960
960
|
#line 153 "markup.rl"
|
961
961
|
{
|
962
962
|
if (has_value == 1) {
|
963
|
-
rb_funcall(delegate, id_attribute, 2,
|
963
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
964
964
|
} else if (has_value == 2) {
|
965
|
-
rb_funcall(delegate, id_attribute, 2,
|
965
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
966
966
|
} else {
|
967
|
-
rb_funcall(delegate, id_attribute, 2,
|
967
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
968
968
|
}
|
969
969
|
}
|
970
970
|
#line 137 "markup.rl"
|
@@ -990,7 +990,7 @@ tr8:
|
|
990
990
|
// Reset self-closing state - we don't know yet.
|
991
991
|
self_closing = 0;
|
992
992
|
|
993
|
-
rb_funcall(delegate, id_open_tag_begin, 2,
|
993
|
+
rb_funcall(delegate, id_open_tag_begin, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
994
994
|
}
|
995
995
|
goto st51;
|
996
996
|
tr17:
|
@@ -1001,11 +1001,11 @@ tr17:
|
|
1001
1001
|
#line 153 "markup.rl"
|
1002
1002
|
{
|
1003
1003
|
if (has_value == 1) {
|
1004
|
-
rb_funcall(delegate, id_attribute, 2,
|
1004
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
1005
1005
|
} else if (has_value == 2) {
|
1006
|
-
rb_funcall(delegate, id_attribute, 2,
|
1006
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
1007
1007
|
} else {
|
1008
|
-
rb_funcall(delegate, id_attribute, 2,
|
1008
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
1009
1009
|
}
|
1010
1010
|
}
|
1011
1011
|
goto st51;
|
@@ -1017,11 +1017,11 @@ tr28:
|
|
1017
1017
|
#line 153 "markup.rl"
|
1018
1018
|
{
|
1019
1019
|
if (has_value == 1) {
|
1020
|
-
rb_funcall(delegate, id_attribute, 2,
|
1020
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
1021
1021
|
} else if (has_value == 2) {
|
1022
|
-
rb_funcall(delegate, id_attribute, 2,
|
1022
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
1023
1023
|
} else {
|
1024
|
-
rb_funcall(delegate, id_attribute, 2,
|
1024
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
1025
1025
|
}
|
1026
1026
|
}
|
1027
1027
|
goto st51;
|
@@ -1033,11 +1033,11 @@ tr34:
|
|
1033
1033
|
#line 153 "markup.rl"
|
1034
1034
|
{
|
1035
1035
|
if (has_value == 1) {
|
1036
|
-
rb_funcall(delegate, id_attribute, 2,
|
1036
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Trenni_markup_safe(pcdata, has_entities));
|
1037
1037
|
} else if (has_value == 2) {
|
1038
|
-
rb_funcall(delegate, id_attribute, 2,
|
1038
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), empty_string);
|
1039
1039
|
} else {
|
1040
|
-
rb_funcall(delegate, id_attribute, 2,
|
1040
|
+
rb_funcall(delegate, id_attribute, 2, Trenni_Token_string(identifier, encoding), Qtrue);
|
1041
1041
|
}
|
1042
1042
|
}
|
1043
1043
|
goto st51;
|
@@ -1140,8 +1140,8 @@ tr22:
|
|
1140
1140
|
pcdata = Qnil;
|
1141
1141
|
has_entities = 0;
|
1142
1142
|
}
|
1143
|
-
#line 10 "/
|
1144
|
-
{{stack[top++] = 10;
|
1143
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1144
|
+
{{stack[top++] = 10;goto st42;}}
|
1145
1145
|
goto st10;
|
1146
1146
|
tr25:
|
1147
1147
|
#line 35 "markup.rl"
|
@@ -1150,12 +1150,12 @@ tr25:
|
|
1150
1150
|
|
1151
1151
|
Trenni_append_token(&pcdata, encoding, characters);
|
1152
1152
|
}
|
1153
|
-
#line 10 "/
|
1154
|
-
{{stack[top++] = 10;
|
1153
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1154
|
+
{{stack[top++] = 10;goto st42;}}
|
1155
1155
|
goto st10;
|
1156
1156
|
tr31:
|
1157
|
-
#line 10 "/
|
1158
|
-
{{stack[top++] = 10;
|
1157
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1158
|
+
{{stack[top++] = 10;goto st42;}}
|
1159
1159
|
goto st10;
|
1160
1160
|
st10:
|
1161
1161
|
if ( ++p == pe )
|
@@ -1224,8 +1224,8 @@ tr36:
|
|
1224
1224
|
pcdata = Qnil;
|
1225
1225
|
has_entities = 0;
|
1226
1226
|
}
|
1227
|
-
#line 10 "/
|
1228
|
-
{{stack[top++] = 14;
|
1227
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1228
|
+
{{stack[top++] = 14;goto st42;}}
|
1229
1229
|
goto st14;
|
1230
1230
|
tr38:
|
1231
1231
|
#line 35 "markup.rl"
|
@@ -1234,12 +1234,12 @@ tr38:
|
|
1234
1234
|
|
1235
1235
|
Trenni_append_token(&pcdata, encoding, characters);
|
1236
1236
|
}
|
1237
|
-
#line 10 "/
|
1238
|
-
{{stack[top++] = 14;
|
1237
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1238
|
+
{{stack[top++] = 14;goto st42;}}
|
1239
1239
|
goto st14;
|
1240
1240
|
tr40:
|
1241
|
-
#line 10 "/
|
1242
|
-
{{stack[top++] = 14;
|
1241
|
+
#line 10 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1242
|
+
{{stack[top++] = 14;goto st42;}}
|
1243
1243
|
goto st14;
|
1244
1244
|
st14:
|
1245
1245
|
if ( ++p == pe )
|
@@ -1643,7 +1643,7 @@ tr81:
|
|
1643
1643
|
|
1644
1644
|
Trenni_append_codepoint(&pcdata, encoding, codepoint);
|
1645
1645
|
}
|
1646
|
-
#line 8 "/
|
1646
|
+
#line 8 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1647
1647
|
{{cs = stack[--top];goto _again;}}
|
1648
1648
|
goto st57;
|
1649
1649
|
tr84:
|
@@ -1657,7 +1657,7 @@ tr84:
|
|
1657
1657
|
|
1658
1658
|
Trenni_append_codepoint(&pcdata, encoding, codepoint);
|
1659
1659
|
}
|
1660
|
-
#line 8 "/
|
1660
|
+
#line 8 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1661
1661
|
{{cs = stack[--top];goto _again;}}
|
1662
1662
|
goto st57;
|
1663
1663
|
tr86:
|
@@ -1668,10 +1668,10 @@ tr86:
|
|
1668
1668
|
has_entities = 1;
|
1669
1669
|
|
1670
1670
|
Trenni_append(&pcdata, encoding,
|
1671
|
-
rb_funcall(entities, id_key_get, 1,
|
1671
|
+
rb_funcall(entities, id_key_get, 1, Trenni_Token_string(entity, encoding))
|
1672
1672
|
);
|
1673
1673
|
}
|
1674
|
-
#line 8 "/
|
1674
|
+
#line 8 "/home/samuel/Documents/ioquatix/trenni/parsers/trenni/entities.rl"
|
1675
1675
|
{{cs = stack[--top];goto _again;}}
|
1676
1676
|
goto st57;
|
1677
1677
|
st57:
|
@@ -1816,7 +1816,7 @@ case 47:
|
|
1816
1816
|
{
|
1817
1817
|
doctype.end = p;
|
1818
1818
|
|
1819
|
-
rb_funcall(delegate, id_doctype, 1,
|
1819
|
+
rb_funcall(delegate, id_doctype, 1, Trenni_Token_string(doctype, encoding));
|
1820
1820
|
}
|
1821
1821
|
break;
|
1822
1822
|
case 26:
|
@@ -1830,7 +1830,7 @@ case 47:
|
|
1830
1830
|
{
|
1831
1831
|
comment.end = p;
|
1832
1832
|
|
1833
|
-
rb_funcall(delegate, id_comment, 1,
|
1833
|
+
rb_funcall(delegate, id_comment, 1, Trenni_Token_string(comment, encoding));
|
1834
1834
|
}
|
1835
1835
|
break;
|
1836
1836
|
case 17:
|
@@ -1846,7 +1846,7 @@ case 47:
|
|
1846
1846
|
{
|
1847
1847
|
instruction.end = p;
|
1848
1848
|
|
1849
|
-
rb_funcall(delegate, id_instruction, 1,
|
1849
|
+
rb_funcall(delegate, id_instruction, 1, Trenni_Token_string(instruction, encoding));
|
1850
1850
|
}
|
1851
1851
|
break;
|
1852
1852
|
case 38:
|
@@ -1867,7 +1867,7 @@ case 47:
|
|
1867
1867
|
case 55:
|
1868
1868
|
#line 170 "markup.rl"
|
1869
1869
|
{
|
1870
|
-
rb_funcall(delegate, id_close_tag, 2,
|
1870
|
+
rb_funcall(delegate, id_close_tag, 2, Trenni_Token_string(identifier, encoding), ULONG2NUM(identifier.begin-s));
|
1871
1871
|
}
|
1872
1872
|
break;
|
1873
1873
|
case 1:
|
@@ -1896,7 +1896,7 @@ case 47:
|
|
1896
1896
|
{
|
1897
1897
|
cdata.end = p;
|
1898
1898
|
|
1899
|
-
rb_funcall(delegate, id_cdata, 1,
|
1899
|
+
rb_funcall(delegate, id_cdata, 1, Trenni_Token_string(cdata, encoding));
|
1900
1900
|
}
|
1901
1901
|
break;
|
1902
1902
|
case 33:
|