xrb 0.2.0 → 0.4.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
- checksums.yaml.gz.sig +0 -0
- data/bake/xrb/parsers.rb +17 -20
- data/ext/extconf.rb +0 -1
- data/ext/xrb/escape.c +1 -1
- data/ext/xrb/escape.h +1 -1
- data/ext/xrb/markup.c +241 -241
- data/ext/xrb/query.c +69 -69
- data/ext/xrb/tag.c +4 -4
- data/ext/xrb/tag.h +1 -1
- data/ext/xrb/template.c +93 -93
- data/ext/xrb/xrb.c +3 -3
- data/ext/xrb/xrb.h +1 -11
- data/lib/xrb/builder.rb +13 -6
- data/lib/xrb/entities.xrb +4 -19
- data/lib/xrb/fallback/markup.rb +1618 -1619
- data/lib/xrb/fallback/markup.rl +0 -1
- data/lib/xrb/fallback/query.rb +515 -515
- data/lib/xrb/fallback/template.rb +787 -787
- data/lib/xrb/parsers.rb +0 -1
- data/lib/xrb/template.rb +10 -46
- data/lib/xrb/version.rb +1 -1
- data/readme.md +42 -1
- data.tar.gz.sig +0 -0
- metadata +2 -3
- metadata.gz.sig +0 -0
- data/lib/xrb/parse_delegate.rb +0 -19
data/ext/xrb/template.c
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
#line 1 "template.rl"
|
2
|
+
#line 1 "ext/xrb/template.rl"
|
3
3
|
|
4
4
|
#include "template.h"
|
5
5
|
|
6
6
|
|
7
|
-
#line 8 "template.c"
|
7
|
+
#line 8 "ext/xrb/template.c"
|
8
8
|
static const int XRB_template_parser_start = 43;
|
9
9
|
static const int XRB_template_parser_first_final = 43;
|
10
10
|
static const int XRB_template_parser_error = 0;
|
@@ -14,7 +14,7 @@ static const int XRB_template_parser_en_parse_expression = 32;
|
|
14
14
|
static const int XRB_template_parser_en_main = 43;
|
15
15
|
|
16
16
|
|
17
|
-
#line 50 "template.rl"
|
17
|
+
#line 50 "ext/xrb/template.rl"
|
18
18
|
|
19
19
|
|
20
20
|
VALUE XRB_Native_parse_template(VALUE self, VALUE buffer, VALUE delegate) {
|
@@ -33,7 +33,7 @@ VALUE XRB_Native_parse_template(VALUE self, VALUE buffer, VALUE delegate) {
|
|
33
33
|
eof = pe = p + RSTRING_LEN(string);
|
34
34
|
|
35
35
|
|
36
|
-
#line 37 "template.c"
|
36
|
+
#line 37 "ext/xrb/template.c"
|
37
37
|
{
|
38
38
|
cs = XRB_template_parser_start;
|
39
39
|
top = 0;
|
@@ -42,7 +42,7 @@ VALUE XRB_Native_parse_template(VALUE self, VALUE buffer, VALUE delegate) {
|
|
42
42
|
act = 0;
|
43
43
|
}
|
44
44
|
|
45
|
-
#line 46 "template.c"
|
45
|
+
#line 46 "ext/xrb/template.c"
|
46
46
|
{
|
47
47
|
if ( p == pe )
|
48
48
|
goto _test_eof;
|
@@ -116,23 +116,23 @@ _resume:
|
|
116
116
|
switch ( cs )
|
117
117
|
{
|
118
118
|
tr0:
|
119
|
-
#line 43 "template.rl"
|
119
|
+
#line 43 "ext/xrb/template.rl"
|
120
120
|
{{p = ((te))-1;}{
|
121
121
|
rb_funcall(delegate, id_text, 1, XRB_string(ts, te, encoding));
|
122
122
|
}}
|
123
123
|
goto st43;
|
124
124
|
tr5:
|
125
|
-
#line 43 "template.rl"
|
125
|
+
#line 43 "ext/xrb/template.rl"
|
126
126
|
{{p = ((te))-1;}{
|
127
127
|
rb_funcall(delegate, id_text, 1, XRB_string(ts, te, encoding));
|
128
128
|
}}
|
129
129
|
goto st43;
|
130
130
|
tr9:
|
131
|
-
#line 23 "template.rl"
|
131
|
+
#line 23 "ext/xrb/template.rl"
|
132
132
|
{
|
133
133
|
XRB_raise_error("failed to parse instruction", buffer, p-s);
|
134
134
|
}
|
135
|
-
#line 43 "template.rl"
|
135
|
+
#line 43 "ext/xrb/template.rl"
|
136
136
|
{{p = ((te))-1;}{
|
137
137
|
rb_funcall(delegate, id_text, 1, XRB_string(ts, te, encoding));
|
138
138
|
}}
|
@@ -154,40 +154,40 @@ tr14:
|
|
154
154
|
}
|
155
155
|
goto st43;
|
156
156
|
tr15:
|
157
|
-
#line 19 "template.rl"
|
157
|
+
#line 19 "ext/xrb/template.rl"
|
158
158
|
{te = p+1;{
|
159
159
|
rb_funcall(delegate, id_instruction, 2, XRB_Token_string(instruction, encoding), newline);
|
160
160
|
}}
|
161
161
|
goto st43;
|
162
162
|
tr23:
|
163
|
-
#line 43 "template.rl"
|
163
|
+
#line 43 "ext/xrb/template.rl"
|
164
164
|
{te = p+1;{
|
165
165
|
rb_funcall(delegate, id_text, 1, XRB_string(ts, te, encoding));
|
166
166
|
}}
|
167
167
|
goto st43;
|
168
168
|
tr77:
|
169
|
-
#line 43 "template.rl"
|
169
|
+
#line 43 "ext/xrb/template.rl"
|
170
170
|
{te = p;p--;{
|
171
171
|
rb_funcall(delegate, id_text, 1, XRB_string(ts, te, encoding));
|
172
172
|
}}
|
173
173
|
goto st43;
|
174
174
|
tr80:
|
175
|
-
#line 43 "template.rl"
|
175
|
+
#line 43 "ext/xrb/template.rl"
|
176
176
|
{te = p;p--;{
|
177
177
|
rb_funcall(delegate, id_text, 1, XRB_string(ts, te, encoding));
|
178
178
|
}}
|
179
179
|
goto st43;
|
180
180
|
tr82:
|
181
181
|
cs = 43;
|
182
|
-
#line 27 "template.rl"
|
182
|
+
#line 27 "ext/xrb/template.rl"
|
183
183
|
{
|
184
184
|
expression.begin = p;
|
185
185
|
}
|
186
|
-
#line 53 "
|
186
|
+
#line 53 "parsers/xrb/template.rl"
|
187
187
|
{te = p;p--;{cs = 32;}}
|
188
188
|
goto _again;
|
189
189
|
tr83:
|
190
|
-
#line 15 "template.rl"
|
190
|
+
#line 15 "ext/xrb/template.rl"
|
191
191
|
{te = p;p--;{
|
192
192
|
rb_funcall(delegate, id_instruction, 1, XRB_Token_string(instruction, encoding));
|
193
193
|
}}
|
@@ -200,7 +200,7 @@ st43:
|
|
200
200
|
case 43:
|
201
201
|
#line 1 "NONE"
|
202
202
|
{ts = p;}
|
203
|
-
#line 204 "template.c"
|
203
|
+
#line 204 "ext/xrb/template.c"
|
204
204
|
switch( (*p) ) {
|
205
205
|
case 10: goto tr2;
|
206
206
|
case 32: goto tr74;
|
@@ -218,7 +218,7 @@ st44:
|
|
218
218
|
if ( ++p == pe )
|
219
219
|
goto _test_eof44;
|
220
220
|
case 44:
|
221
|
-
#line 222 "template.c"
|
221
|
+
#line 222 "ext/xrb/template.c"
|
222
222
|
switch( (*p) ) {
|
223
223
|
case 10: goto tr2;
|
224
224
|
case 35: goto st4;
|
@@ -233,7 +233,7 @@ st45:
|
|
233
233
|
if ( ++p == pe )
|
234
234
|
goto _test_eof45;
|
235
235
|
case 45:
|
236
|
-
#line 237 "template.c"
|
236
|
+
#line 237 "ext/xrb/template.c"
|
237
237
|
switch( (*p) ) {
|
238
238
|
case 10: goto tr2;
|
239
239
|
case 35: goto st2;
|
@@ -281,14 +281,14 @@ case 5:
|
|
281
281
|
tr74:
|
282
282
|
#line 1 "NONE"
|
283
283
|
{te = p+1;}
|
284
|
-
#line 43 "template.rl"
|
284
|
+
#line 43 "ext/xrb/template.rl"
|
285
285
|
{act = 6;}
|
286
286
|
goto st46;
|
287
287
|
st46:
|
288
288
|
if ( ++p == pe )
|
289
289
|
goto _test_eof46;
|
290
290
|
case 46:
|
291
|
-
#line 292 "template.c"
|
291
|
+
#line 292 "ext/xrb/template.c"
|
292
292
|
switch( (*p) ) {
|
293
293
|
case 10: goto tr2;
|
294
294
|
case 32: goto tr74;
|
@@ -322,7 +322,7 @@ case 8:
|
|
322
322
|
goto tr10;
|
323
323
|
goto tr5;
|
324
324
|
tr10:
|
325
|
-
#line 7 "template.rl"
|
325
|
+
#line 7 "ext/xrb/template.rl"
|
326
326
|
{
|
327
327
|
instruction.begin = p;
|
328
328
|
}
|
@@ -331,12 +331,12 @@ st9:
|
|
331
331
|
if ( ++p == pe )
|
332
332
|
goto _test_eof9;
|
333
333
|
case 9:
|
334
|
-
#line 335 "template.c"
|
334
|
+
#line 335 "ext/xrb/template.c"
|
335
335
|
if ( (*p) == 63 )
|
336
336
|
goto tr12;
|
337
337
|
goto st9;
|
338
338
|
tr12:
|
339
|
-
#line 11 "template.rl"
|
339
|
+
#line 11 "ext/xrb/template.rl"
|
340
340
|
{
|
341
341
|
instruction.end = p;
|
342
342
|
}
|
@@ -345,7 +345,7 @@ st10:
|
|
345
345
|
if ( ++p == pe )
|
346
346
|
goto _test_eof10;
|
347
347
|
case 10:
|
348
|
-
#line 349 "template.c"
|
348
|
+
#line 349 "ext/xrb/template.c"
|
349
349
|
if ( (*p) == 62 )
|
350
350
|
goto st11;
|
351
351
|
goto st9;
|
@@ -428,12 +428,12 @@ case 15:
|
|
428
428
|
goto tr19;
|
429
429
|
goto st15;
|
430
430
|
tr19:
|
431
|
-
#line 23 "template.rl"
|
431
|
+
#line 23 "ext/xrb/template.rl"
|
432
432
|
{
|
433
433
|
XRB_raise_error("failed to parse instruction", buffer, p-s);
|
434
434
|
}
|
435
435
|
goto st0;
|
436
|
-
#line 437 "template.c"
|
436
|
+
#line 437 "ext/xrb/template.c"
|
437
437
|
st0:
|
438
438
|
cs = 0;
|
439
439
|
goto _out;
|
@@ -479,7 +479,7 @@ case 18:
|
|
479
479
|
goto tr19;
|
480
480
|
goto st15;
|
481
481
|
tr24:
|
482
|
-
#line 7 "template.rl"
|
482
|
+
#line 7 "ext/xrb/template.rl"
|
483
483
|
{
|
484
484
|
instruction.begin = p;
|
485
485
|
}
|
@@ -488,12 +488,12 @@ st19:
|
|
488
488
|
if ( ++p == pe )
|
489
489
|
goto _test_eof19;
|
490
490
|
case 19:
|
491
|
-
#line 492 "template.c"
|
491
|
+
#line 492 "ext/xrb/template.c"
|
492
492
|
if ( (*p) == 63 )
|
493
493
|
goto tr26;
|
494
494
|
goto st19;
|
495
495
|
tr26:
|
496
|
-
#line 11 "template.rl"
|
496
|
+
#line 11 "ext/xrb/template.rl"
|
497
497
|
{
|
498
498
|
instruction.end = p;
|
499
499
|
}
|
@@ -502,21 +502,21 @@ st20:
|
|
502
502
|
if ( ++p == pe )
|
503
503
|
goto _test_eof20;
|
504
504
|
case 20:
|
505
|
-
#line 506 "template.c"
|
505
|
+
#line 506 "ext/xrb/template.c"
|
506
506
|
if ( (*p) == 62 )
|
507
507
|
goto tr27;
|
508
508
|
goto st19;
|
509
509
|
tr27:
|
510
510
|
#line 1 "NONE"
|
511
511
|
{te = p+1;}
|
512
|
-
#line 15 "template.rl"
|
512
|
+
#line 15 "ext/xrb/template.rl"
|
513
513
|
{act = 3;}
|
514
514
|
goto st48;
|
515
515
|
st48:
|
516
516
|
if ( ++p == pe )
|
517
517
|
goto _test_eof48;
|
518
518
|
case 48:
|
519
|
-
#line 520 "template.c"
|
519
|
+
#line 520 "ext/xrb/template.c"
|
520
520
|
switch( (*p) ) {
|
521
521
|
case 10: goto tr15;
|
522
522
|
case 32: goto st11;
|
@@ -525,7 +525,7 @@ case 48:
|
|
525
525
|
goto st11;
|
526
526
|
goto tr83;
|
527
527
|
tr31:
|
528
|
-
#line 17 "
|
528
|
+
#line 17 "parsers/xrb/template.rl"
|
529
529
|
{{stack[top++] = 21;goto st21;}}
|
530
530
|
goto st21;
|
531
531
|
st21:
|
@@ -534,7 +534,7 @@ st21:
|
|
534
534
|
if ( ++p == pe )
|
535
535
|
goto _test_eof21;
|
536
536
|
case 21:
|
537
|
-
#line 538 "template.c"
|
537
|
+
#line 538 "ext/xrb/template.c"
|
538
538
|
switch( (*p) ) {
|
539
539
|
case 34: goto st22;
|
540
540
|
case 39: goto st30;
|
@@ -543,7 +543,7 @@ case 21:
|
|
543
543
|
}
|
544
544
|
goto st21;
|
545
545
|
tr47:
|
546
|
-
#line 13 "
|
546
|
+
#line 13 "parsers/xrb/template.rl"
|
547
547
|
{{stack[top++] = 22;goto st21;}}
|
548
548
|
goto st22;
|
549
549
|
st22:
|
@@ -552,20 +552,20 @@ st22:
|
|
552
552
|
if ( ++p == pe )
|
553
553
|
goto _test_eof22;
|
554
554
|
case 22:
|
555
|
-
#line 556 "template.c"
|
555
|
+
#line 556 "ext/xrb/template.c"
|
556
556
|
switch( (*p) ) {
|
557
557
|
case 34: goto st23;
|
558
558
|
case 35: goto st29;
|
559
559
|
}
|
560
560
|
goto st22;
|
561
561
|
tr37:
|
562
|
-
#line 17 "
|
562
|
+
#line 17 "parsers/xrb/template.rl"
|
563
563
|
{{stack[top++] = 23;goto st21;}}
|
564
564
|
goto st23;
|
565
565
|
tr39:
|
566
|
-
#line 13 "
|
566
|
+
#line 13 "parsers/xrb/template.rl"
|
567
567
|
{{stack[top++] = 23;goto st21;}}
|
568
|
-
#line 17 "
|
568
|
+
#line 17 "parsers/xrb/template.rl"
|
569
569
|
{{stack[top++] = 23;goto st21;}}
|
570
570
|
goto st23;
|
571
571
|
st23:
|
@@ -574,7 +574,7 @@ st23:
|
|
574
574
|
if ( ++p == pe )
|
575
575
|
goto _test_eof23;
|
576
576
|
case 23:
|
577
|
-
#line 578 "template.c"
|
577
|
+
#line 578 "ext/xrb/template.c"
|
578
578
|
switch( (*p) ) {
|
579
579
|
case 35: goto st24;
|
580
580
|
case 39: goto st25;
|
@@ -594,7 +594,7 @@ case 24:
|
|
594
594
|
}
|
595
595
|
goto st23;
|
596
596
|
tr46:
|
597
|
-
#line 13 "
|
597
|
+
#line 13 "parsers/xrb/template.rl"
|
598
598
|
{{stack[top++] = 25;goto st21;}}
|
599
599
|
goto st25;
|
600
600
|
st25:
|
@@ -603,7 +603,7 @@ st25:
|
|
603
603
|
if ( ++p == pe )
|
604
604
|
goto _test_eof25;
|
605
605
|
case 25:
|
606
|
-
#line 607 "template.c"
|
606
|
+
#line 607 "ext/xrb/template.c"
|
607
607
|
switch( (*p) ) {
|
608
608
|
case 34: goto st26;
|
609
609
|
case 35: goto st28;
|
@@ -611,13 +611,13 @@ case 25:
|
|
611
611
|
}
|
612
612
|
goto st25;
|
613
613
|
tr43:
|
614
|
-
#line 17 "
|
614
|
+
#line 17 "parsers/xrb/template.rl"
|
615
615
|
{{stack[top++] = 26;goto st21;}}
|
616
616
|
goto st26;
|
617
617
|
tr45:
|
618
|
-
#line 13 "
|
618
|
+
#line 13 "parsers/xrb/template.rl"
|
619
619
|
{{stack[top++] = 26;goto st21;}}
|
620
|
-
#line 17 "
|
620
|
+
#line 17 "parsers/xrb/template.rl"
|
621
621
|
{{stack[top++] = 26;goto st21;}}
|
622
622
|
goto st26;
|
623
623
|
st26:
|
@@ -626,7 +626,7 @@ st26:
|
|
626
626
|
if ( ++p == pe )
|
627
627
|
goto _test_eof26;
|
628
628
|
case 26:
|
629
|
-
#line 630 "template.c"
|
629
|
+
#line 630 "ext/xrb/template.c"
|
630
630
|
switch( (*p) ) {
|
631
631
|
case 35: goto st27;
|
632
632
|
case 123: goto tr43;
|
@@ -644,14 +644,14 @@ case 27:
|
|
644
644
|
}
|
645
645
|
goto st26;
|
646
646
|
tr44:
|
647
|
-
#line 20 "
|
647
|
+
#line 20 "parsers/xrb/template.rl"
|
648
648
|
{{cs = stack[--top];goto _again;}}
|
649
649
|
goto st49;
|
650
650
|
st49:
|
651
651
|
if ( ++p == pe )
|
652
652
|
goto _test_eof49;
|
653
653
|
case 49:
|
654
|
-
#line 655 "template.c"
|
654
|
+
#line 655 "ext/xrb/template.c"
|
655
655
|
switch( (*p) ) {
|
656
656
|
case 34: goto st26;
|
657
657
|
case 35: goto st28;
|
@@ -670,14 +670,14 @@ case 28:
|
|
670
670
|
}
|
671
671
|
goto st25;
|
672
672
|
tr38:
|
673
|
-
#line 20 "
|
673
|
+
#line 20 "parsers/xrb/template.rl"
|
674
674
|
{{cs = stack[--top];goto _again;}}
|
675
675
|
goto st50;
|
676
676
|
st50:
|
677
677
|
if ( ++p == pe )
|
678
678
|
goto _test_eof50;
|
679
679
|
case 50:
|
680
|
-
#line 681 "template.c"
|
680
|
+
#line 681 "ext/xrb/template.c"
|
681
681
|
switch( (*p) ) {
|
682
682
|
case 34: goto st23;
|
683
683
|
case 35: goto st29;
|
@@ -701,7 +701,7 @@ case 30:
|
|
701
701
|
goto st31;
|
702
702
|
goto st30;
|
703
703
|
tr49:
|
704
|
-
#line 17 "
|
704
|
+
#line 17 "parsers/xrb/template.rl"
|
705
705
|
{{stack[top++] = 31;goto st21;}}
|
706
706
|
goto st31;
|
707
707
|
st31:
|
@@ -710,7 +710,7 @@ st31:
|
|
710
710
|
if ( ++p == pe )
|
711
711
|
goto _test_eof31;
|
712
712
|
case 31:
|
713
|
-
#line 714 "template.c"
|
713
|
+
#line 714 "ext/xrb/template.c"
|
714
714
|
switch( (*p) ) {
|
715
715
|
case 34: goto st25;
|
716
716
|
case 123: goto tr49;
|
@@ -718,29 +718,29 @@ case 31:
|
|
718
718
|
}
|
719
719
|
goto st31;
|
720
720
|
tr50:
|
721
|
-
#line 20 "
|
721
|
+
#line 20 "parsers/xrb/template.rl"
|
722
722
|
{{cs = stack[--top];goto _again;}}
|
723
723
|
goto st51;
|
724
724
|
st51:
|
725
725
|
if ( ++p == pe )
|
726
726
|
goto _test_eof51;
|
727
727
|
case 51:
|
728
|
-
#line 729 "template.c"
|
728
|
+
#line 729 "ext/xrb/template.c"
|
729
729
|
if ( (*p) == 39 )
|
730
730
|
goto st31;
|
731
731
|
goto st30;
|
732
732
|
tr32:
|
733
|
-
#line 20 "
|
733
|
+
#line 20 "parsers/xrb/template.rl"
|
734
734
|
{{cs = stack[--top];goto _again;}}
|
735
735
|
goto st52;
|
736
736
|
st52:
|
737
737
|
if ( ++p == pe )
|
738
738
|
goto _test_eof52;
|
739
739
|
case 52:
|
740
|
-
#line 741 "template.c"
|
740
|
+
#line 741 "ext/xrb/template.c"
|
741
741
|
goto st0;
|
742
742
|
tr54:
|
743
|
-
#line 17 "
|
743
|
+
#line 17 "parsers/xrb/template.rl"
|
744
744
|
{{stack[top++] = 32;goto st21;}}
|
745
745
|
goto st32;
|
746
746
|
st32:
|
@@ -749,7 +749,7 @@ st32:
|
|
749
749
|
if ( ++p == pe )
|
750
750
|
goto _test_eof32;
|
751
751
|
case 32:
|
752
|
-
#line 753 "template.c"
|
752
|
+
#line 753 "ext/xrb/template.c"
|
753
753
|
switch( (*p) ) {
|
754
754
|
case 34: goto st33;
|
755
755
|
case 39: goto st41;
|
@@ -758,7 +758,7 @@ case 32:
|
|
758
758
|
}
|
759
759
|
goto st32;
|
760
760
|
tr70:
|
761
|
-
#line 13 "
|
761
|
+
#line 13 "parsers/xrb/template.rl"
|
762
762
|
{{stack[top++] = 33;goto st21;}}
|
763
763
|
goto st33;
|
764
764
|
st33:
|
@@ -767,20 +767,20 @@ st33:
|
|
767
767
|
if ( ++p == pe )
|
768
768
|
goto _test_eof33;
|
769
769
|
case 33:
|
770
|
-
#line 771 "template.c"
|
770
|
+
#line 771 "ext/xrb/template.c"
|
771
771
|
switch( (*p) ) {
|
772
772
|
case 34: goto st34;
|
773
773
|
case 35: goto st40;
|
774
774
|
}
|
775
775
|
goto st33;
|
776
776
|
tr60:
|
777
|
-
#line 17 "
|
777
|
+
#line 17 "parsers/xrb/template.rl"
|
778
778
|
{{stack[top++] = 34;goto st21;}}
|
779
779
|
goto st34;
|
780
780
|
tr62:
|
781
|
-
#line 13 "
|
781
|
+
#line 13 "parsers/xrb/template.rl"
|
782
782
|
{{stack[top++] = 34;goto st21;}}
|
783
|
-
#line 17 "
|
783
|
+
#line 17 "parsers/xrb/template.rl"
|
784
784
|
{{stack[top++] = 34;goto st21;}}
|
785
785
|
goto st34;
|
786
786
|
st34:
|
@@ -789,7 +789,7 @@ st34:
|
|
789
789
|
if ( ++p == pe )
|
790
790
|
goto _test_eof34;
|
791
791
|
case 34:
|
792
|
-
#line 793 "template.c"
|
792
|
+
#line 793 "ext/xrb/template.c"
|
793
793
|
switch( (*p) ) {
|
794
794
|
case 35: goto st35;
|
795
795
|
case 39: goto st36;
|
@@ -809,7 +809,7 @@ case 35:
|
|
809
809
|
}
|
810
810
|
goto st34;
|
811
811
|
tr69:
|
812
|
-
#line 13 "
|
812
|
+
#line 13 "parsers/xrb/template.rl"
|
813
813
|
{{stack[top++] = 36;goto st21;}}
|
814
814
|
goto st36;
|
815
815
|
st36:
|
@@ -818,7 +818,7 @@ st36:
|
|
818
818
|
if ( ++p == pe )
|
819
819
|
goto _test_eof36;
|
820
820
|
case 36:
|
821
|
-
#line 822 "template.c"
|
821
|
+
#line 822 "ext/xrb/template.c"
|
822
822
|
switch( (*p) ) {
|
823
823
|
case 34: goto st37;
|
824
824
|
case 35: goto st39;
|
@@ -826,13 +826,13 @@ case 36:
|
|
826
826
|
}
|
827
827
|
goto st36;
|
828
828
|
tr66:
|
829
|
-
#line 17 "
|
829
|
+
#line 17 "parsers/xrb/template.rl"
|
830
830
|
{{stack[top++] = 37;goto st21;}}
|
831
831
|
goto st37;
|
832
832
|
tr68:
|
833
|
-
#line 13 "
|
833
|
+
#line 13 "parsers/xrb/template.rl"
|
834
834
|
{{stack[top++] = 37;goto st21;}}
|
835
|
-
#line 17 "
|
835
|
+
#line 17 "parsers/xrb/template.rl"
|
836
836
|
{{stack[top++] = 37;goto st21;}}
|
837
837
|
goto st37;
|
838
838
|
st37:
|
@@ -841,7 +841,7 @@ st37:
|
|
841
841
|
if ( ++p == pe )
|
842
842
|
goto _test_eof37;
|
843
843
|
case 37:
|
844
|
-
#line 845 "template.c"
|
844
|
+
#line 845 "ext/xrb/template.c"
|
845
845
|
switch( (*p) ) {
|
846
846
|
case 35: goto st38;
|
847
847
|
case 123: goto tr66;
|
@@ -860,22 +860,22 @@ case 38:
|
|
860
860
|
goto st37;
|
861
861
|
tr67:
|
862
862
|
cs = 53;
|
863
|
-
#line 31 "template.rl"
|
863
|
+
#line 31 "ext/xrb/template.rl"
|
864
864
|
{
|
865
865
|
expression.end = p;
|
866
866
|
}
|
867
|
-
#line 35 "template.rl"
|
867
|
+
#line 35 "ext/xrb/template.rl"
|
868
868
|
{
|
869
869
|
rb_funcall(delegate, id_expression, 1, XRB_Token_string(expression, encoding));
|
870
870
|
}
|
871
|
-
#line 21 "
|
871
|
+
#line 21 "parsers/xrb/template.rl"
|
872
872
|
{cs = 43;}
|
873
873
|
goto _again;
|
874
874
|
st53:
|
875
875
|
if ( ++p == pe )
|
876
876
|
goto _test_eof53;
|
877
877
|
case 53:
|
878
|
-
#line 879 "template.c"
|
878
|
+
#line 879 "ext/xrb/template.c"
|
879
879
|
switch( (*p) ) {
|
880
880
|
case 34: goto st37;
|
881
881
|
case 35: goto st39;
|
@@ -895,22 +895,22 @@ case 39:
|
|
895
895
|
goto st36;
|
896
896
|
tr61:
|
897
897
|
cs = 54;
|
898
|
-
#line 31 "template.rl"
|
898
|
+
#line 31 "ext/xrb/template.rl"
|
899
899
|
{
|
900
900
|
expression.end = p;
|
901
901
|
}
|
902
|
-
#line 35 "template.rl"
|
902
|
+
#line 35 "ext/xrb/template.rl"
|
903
903
|
{
|
904
904
|
rb_funcall(delegate, id_expression, 1, XRB_Token_string(expression, encoding));
|
905
905
|
}
|
906
|
-
#line 21 "
|
906
|
+
#line 21 "parsers/xrb/template.rl"
|
907
907
|
{cs = 43;}
|
908
908
|
goto _again;
|
909
909
|
st54:
|
910
910
|
if ( ++p == pe )
|
911
911
|
goto _test_eof54;
|
912
912
|
case 54:
|
913
|
-
#line 914 "template.c"
|
913
|
+
#line 914 "ext/xrb/template.c"
|
914
914
|
switch( (*p) ) {
|
915
915
|
case 34: goto st34;
|
916
916
|
case 35: goto st40;
|
@@ -934,7 +934,7 @@ case 41:
|
|
934
934
|
goto st42;
|
935
935
|
goto st41;
|
936
936
|
tr72:
|
937
|
-
#line 17 "
|
937
|
+
#line 17 "parsers/xrb/template.rl"
|
938
938
|
{{stack[top++] = 42;goto st21;}}
|
939
939
|
goto st42;
|
940
940
|
st42:
|
@@ -943,7 +943,7 @@ st42:
|
|
943
943
|
if ( ++p == pe )
|
944
944
|
goto _test_eof42;
|
945
945
|
case 42:
|
946
|
-
#line 947 "template.c"
|
946
|
+
#line 947 "ext/xrb/template.c"
|
947
947
|
switch( (*p) ) {
|
948
948
|
case 34: goto st36;
|
949
949
|
case 123: goto tr72;
|
@@ -952,43 +952,43 @@ case 42:
|
|
952
952
|
goto st42;
|
953
953
|
tr73:
|
954
954
|
cs = 55;
|
955
|
-
#line 31 "template.rl"
|
955
|
+
#line 31 "ext/xrb/template.rl"
|
956
956
|
{
|
957
957
|
expression.end = p;
|
958
958
|
}
|
959
|
-
#line 35 "template.rl"
|
959
|
+
#line 35 "ext/xrb/template.rl"
|
960
960
|
{
|
961
961
|
rb_funcall(delegate, id_expression, 1, XRB_Token_string(expression, encoding));
|
962
962
|
}
|
963
|
-
#line 21 "
|
963
|
+
#line 21 "parsers/xrb/template.rl"
|
964
964
|
{cs = 43;}
|
965
965
|
goto _again;
|
966
966
|
st55:
|
967
967
|
if ( ++p == pe )
|
968
968
|
goto _test_eof55;
|
969
969
|
case 55:
|
970
|
-
#line 971 "template.c"
|
970
|
+
#line 971 "ext/xrb/template.c"
|
971
971
|
if ( (*p) == 39 )
|
972
972
|
goto st42;
|
973
973
|
goto st41;
|
974
974
|
tr55:
|
975
975
|
cs = 56;
|
976
|
-
#line 31 "template.rl"
|
976
|
+
#line 31 "ext/xrb/template.rl"
|
977
977
|
{
|
978
978
|
expression.end = p;
|
979
979
|
}
|
980
|
-
#line 35 "template.rl"
|
980
|
+
#line 35 "ext/xrb/template.rl"
|
981
981
|
{
|
982
982
|
rb_funcall(delegate, id_expression, 1, XRB_Token_string(expression, encoding));
|
983
983
|
}
|
984
|
-
#line 21 "
|
984
|
+
#line 21 "parsers/xrb/template.rl"
|
985
985
|
{cs = 43;}
|
986
986
|
goto _again;
|
987
987
|
st56:
|
988
988
|
if ( ++p == pe )
|
989
989
|
goto _test_eof56;
|
990
990
|
case 56:
|
991
|
-
#line 992 "template.c"
|
991
|
+
#line 992 "ext/xrb/template.c"
|
992
992
|
goto st0;
|
993
993
|
}
|
994
994
|
_test_eof43: cs = 43; goto _test_eof;
|
@@ -1075,7 +1075,7 @@ case 56:
|
|
1075
1075
|
case 18:
|
1076
1076
|
case 19:
|
1077
1077
|
case 20:
|
1078
|
-
#line 23 "template.rl"
|
1078
|
+
#line 23 "ext/xrb/template.rl"
|
1079
1079
|
{
|
1080
1080
|
XRB_raise_error("failed to parse instruction", buffer, p-s);
|
1081
1081
|
}
|
@@ -1091,19 +1091,19 @@ case 56:
|
|
1091
1091
|
case 40:
|
1092
1092
|
case 41:
|
1093
1093
|
case 42:
|
1094
|
-
#line 39 "template.rl"
|
1094
|
+
#line 39 "ext/xrb/template.rl"
|
1095
1095
|
{
|
1096
1096
|
XRB_raise_error("failed to parse expression", buffer, p-s);
|
1097
1097
|
}
|
1098
1098
|
break;
|
1099
|
-
#line 1100 "template.c"
|
1099
|
+
#line 1100 "ext/xrb/template.c"
|
1100
1100
|
}
|
1101
1101
|
}
|
1102
1102
|
|
1103
1103
|
_out: {}
|
1104
1104
|
}
|
1105
1105
|
|
1106
|
-
#line 70 "template.rl"
|
1106
|
+
#line 70 "ext/xrb/template.rl"
|
1107
1107
|
|
1108
1108
|
|
1109
1109
|
if (p != eof) {
|
data/ext/xrb/xrb.c
CHANGED
@@ -16,7 +16,7 @@ void XRB_raise_error(const char * message, VALUE buffer, size_t offset) {
|
|
16
16
|
rb_exc_raise(exception);
|
17
17
|
}
|
18
18
|
|
19
|
-
void Init_XRB_Extension() {
|
19
|
+
void Init_XRB_Extension(void) {
|
20
20
|
id_open_tag_begin = rb_intern("open_tag_begin");
|
21
21
|
id_open_tag_end = rb_intern("open_tag_end");
|
22
22
|
id_close_tag = rb_intern("close_tag");
|
@@ -56,7 +56,7 @@ void Init_XRB_Extension() {
|
|
56
56
|
rb_XRB_Native = rb_define_module_under(rb_XRB, "Native");
|
57
57
|
rb_gc_register_mark_object(rb_XRB_Native);
|
58
58
|
|
59
|
-
|
59
|
+
Init_XRB_escape();
|
60
60
|
|
61
61
|
rb_XRB_ParseError = rb_const_get_at(rb_XRB, rb_intern("ParseError"));
|
62
62
|
rb_gc_register_mark_object(rb_XRB_ParseError);
|
@@ -68,5 +68,5 @@ void Init_XRB_Extension() {
|
|
68
68
|
rb_XRB_Tag = rb_const_get_at(rb_XRB, rb_intern("Tag"));
|
69
69
|
rb_gc_register_mark_object(rb_XRB_Tag);
|
70
70
|
|
71
|
-
|
71
|
+
Init_XRB_Tag();
|
72
72
|
}
|