oga 3.4 → 3.5
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/README.md +1 -1
- data/ext/c/lexer.c +68 -65
- data/ext/c/lexer.rl +15 -12
- data/ext/java/org/liboga/xml/Lexer.java +5 -5
- data/lib/oga/version.rb +1 -1
- data/lib/oga/xml/node_set.rb +1 -1
- data/lib/oga/xpath/lexer.rb +5 -5
- data/lib/oga.rb +2 -0
- data/oga.gemspec +2 -2
- metadata +6 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 95760872af2afe9aad5500fa57ccd09573579a9d7dc21f994bb172e5e5111239
|
|
4
|
+
data.tar.gz: 7399851f22cc17095917ec1b9a54c3e8ebd7caaec5bf57755ea81fa7099ca6ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b97d320a14e3fa0176bfb98b65545e2f534064d28186157d4cfab1a98eb9eed99506e794010b7e532cc0df616293d520d46816f62876e84011491c0fb9bf4446
|
|
7
|
+
data.tar.gz: a31f7f2ebaa1c93f50d2aa0ebcc0b8c6cc49813851211e249dfe2c046f386c8377a4c7a8e8cf06871ca4d94394eefdefc95103c04c73bc98627788b5d2ab1f55
|
data/README.md
CHANGED
|
@@ -266,7 +266,7 @@ well as complicating the parsing internals of Oga. As a result I have decided
|
|
|
266
266
|
that Oga _does not_ insert these tags when left out.
|
|
267
267
|
|
|
268
268
|
A more in depth explanation can be found here:
|
|
269
|
-
<https://
|
|
269
|
+
<https://github.com/yorickpeterse/oga/issues/98>
|
|
270
270
|
|
|
271
271
|
## Documentation
|
|
272
272
|
|
data/ext/c/lexer.c
CHANGED
|
@@ -70,7 +70,7 @@ void liboga_xml_lexer_callback_simple(VALUE self, VALUE name)
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
#line
|
|
73
|
+
#line 69 "ext/c/lexer.c"
|
|
74
74
|
static const int c_lexer_start = 35;
|
|
75
75
|
static const int c_lexer_first_final = 35;
|
|
76
76
|
static const int c_lexer_error = 0;
|
|
@@ -98,6 +98,17 @@ static const int c_lexer_en_main = 35;
|
|
|
98
98
|
|
|
99
99
|
#line 70 "ext/c/lexer.rl"
|
|
100
100
|
|
|
101
|
+
static size_t oga_xml_lexer_memsize(const void *state)
|
|
102
|
+
{
|
|
103
|
+
return state ? sizeof(OgaLexerState) : 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static const rb_data_type_t oga_xml_lexer_data_type = {
|
|
107
|
+
"Oga::XML::Lexer",
|
|
108
|
+
{NULL, RUBY_DEFAULT_FREE, oga_xml_lexer_memsize,},
|
|
109
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
|
110
|
+
};
|
|
111
|
+
|
|
101
112
|
/**
|
|
102
113
|
* Lexes the String specifies as the method argument. Token values have the
|
|
103
114
|
* same encoding as the input value.
|
|
@@ -154,12 +165,12 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
|
|
|
154
165
|
ID id_on_xml_decl_end = rb_intern("on_xml_decl_end");
|
|
155
166
|
ID id_on_xml_decl_start = rb_intern("on_xml_decl_start");
|
|
156
167
|
|
|
157
|
-
|
|
168
|
+
TypedData_Get_Struct(self, OgaLexerState, &oga_xml_lexer_data_type, state);
|
|
158
169
|
|
|
159
170
|
lines = state->lines;
|
|
160
171
|
|
|
161
172
|
|
|
162
|
-
#line
|
|
173
|
+
#line 165 "ext/c/lexer.c"
|
|
163
174
|
{
|
|
164
175
|
if ( p == pe )
|
|
165
176
|
goto _test_eof;
|
|
@@ -395,7 +406,7 @@ st35:
|
|
|
395
406
|
case 35:
|
|
396
407
|
#line 1 "NONE"
|
|
397
408
|
{ts = p;}
|
|
398
|
-
#line
|
|
409
|
+
#line 388 "ext/c/lexer.c"
|
|
399
410
|
if ( (*p) == 60 )
|
|
400
411
|
goto tr46;
|
|
401
412
|
goto tr45;
|
|
@@ -407,7 +418,7 @@ st36:
|
|
|
407
418
|
if ( ++p == pe )
|
|
408
419
|
goto _test_eof36;
|
|
409
420
|
case 36:
|
|
410
|
-
#line
|
|
421
|
+
#line 398 "ext/c/lexer.c"
|
|
411
422
|
switch( (*p) ) {
|
|
412
423
|
case 33: goto st1;
|
|
413
424
|
case 47: goto tr50;
|
|
@@ -519,7 +530,7 @@ st37:
|
|
|
519
530
|
if ( ++p == pe )
|
|
520
531
|
goto _test_eof37;
|
|
521
532
|
case 37:
|
|
522
|
-
#line
|
|
533
|
+
#line 508 "ext/c/lexer.c"
|
|
523
534
|
switch( (*p) ) {
|
|
524
535
|
case 13: goto tr11;
|
|
525
536
|
case 32: goto tr11;
|
|
@@ -606,7 +617,7 @@ st38:
|
|
|
606
617
|
if ( ++p == pe )
|
|
607
618
|
goto _test_eof38;
|
|
608
619
|
case 38:
|
|
609
|
-
#line
|
|
620
|
+
#line 590 "ext/c/lexer.c"
|
|
610
621
|
switch( (*p) ) {
|
|
611
622
|
case 47: goto tr20;
|
|
612
623
|
case 58: goto st17;
|
|
@@ -674,7 +685,7 @@ st40:
|
|
|
674
685
|
if ( ++p == pe )
|
|
675
686
|
goto _test_eof40;
|
|
676
687
|
case 40:
|
|
677
|
-
#line
|
|
688
|
+
#line 655 "ext/c/lexer.c"
|
|
678
689
|
switch( (*p) ) {
|
|
679
690
|
case 47: goto tr54;
|
|
680
691
|
case 58: goto st17;
|
|
@@ -703,7 +714,7 @@ st41:
|
|
|
703
714
|
if ( ++p == pe )
|
|
704
715
|
goto _test_eof41;
|
|
705
716
|
case 41:
|
|
706
|
-
#line
|
|
717
|
+
#line 681 "ext/c/lexer.c"
|
|
707
718
|
switch( (*p) ) {
|
|
708
719
|
case 47: goto tr54;
|
|
709
720
|
case 58: goto st17;
|
|
@@ -765,7 +776,7 @@ st42:
|
|
|
765
776
|
case 42:
|
|
766
777
|
#line 1 "NONE"
|
|
767
778
|
{ts = p;}
|
|
768
|
-
#line
|
|
779
|
+
#line 737 "ext/c/lexer.c"
|
|
769
780
|
if ( (*p) == 45 )
|
|
770
781
|
goto tr58;
|
|
771
782
|
goto tr57;
|
|
@@ -779,7 +790,7 @@ st43:
|
|
|
779
790
|
if ( ++p == pe )
|
|
780
791
|
goto _test_eof43;
|
|
781
792
|
case 43:
|
|
782
|
-
#line
|
|
793
|
+
#line 749 "ext/c/lexer.c"
|
|
783
794
|
if ( (*p) == 45 )
|
|
784
795
|
goto tr59;
|
|
785
796
|
goto tr57;
|
|
@@ -795,7 +806,7 @@ st44:
|
|
|
795
806
|
if ( ++p == pe )
|
|
796
807
|
goto _test_eof44;
|
|
797
808
|
case 44:
|
|
798
|
-
#line
|
|
809
|
+
#line 762 "ext/c/lexer.c"
|
|
799
810
|
if ( (*p) == 45 )
|
|
800
811
|
goto st18;
|
|
801
812
|
goto tr59;
|
|
@@ -849,7 +860,7 @@ st45:
|
|
|
849
860
|
case 45:
|
|
850
861
|
#line 1 "NONE"
|
|
851
862
|
{ts = p;}
|
|
852
|
-
#line
|
|
863
|
+
#line 810 "ext/c/lexer.c"
|
|
853
864
|
if ( (*p) == 93 )
|
|
854
865
|
goto tr62;
|
|
855
866
|
goto tr61;
|
|
@@ -863,7 +874,7 @@ st46:
|
|
|
863
874
|
if ( ++p == pe )
|
|
864
875
|
goto _test_eof46;
|
|
865
876
|
case 46:
|
|
866
|
-
#line
|
|
877
|
+
#line 822 "ext/c/lexer.c"
|
|
867
878
|
if ( (*p) == 93 )
|
|
868
879
|
goto tr63;
|
|
869
880
|
goto tr61;
|
|
@@ -879,7 +890,7 @@ st47:
|
|
|
879
890
|
if ( ++p == pe )
|
|
880
891
|
goto _test_eof47;
|
|
881
892
|
case 47:
|
|
882
|
-
#line
|
|
893
|
+
#line 835 "ext/c/lexer.c"
|
|
883
894
|
if ( (*p) == 93 )
|
|
884
895
|
goto st19;
|
|
885
896
|
goto tr63;
|
|
@@ -920,7 +931,7 @@ st48:
|
|
|
920
931
|
case 48:
|
|
921
932
|
#line 1 "NONE"
|
|
922
933
|
{ts = p;}
|
|
923
|
-
#line
|
|
934
|
+
#line 871 "ext/c/lexer.c"
|
|
924
935
|
if ( (*p) == 63 )
|
|
925
936
|
goto tr66;
|
|
926
937
|
goto tr65;
|
|
@@ -934,7 +945,7 @@ st49:
|
|
|
934
945
|
if ( ++p == pe )
|
|
935
946
|
goto _test_eof49;
|
|
936
947
|
case 49:
|
|
937
|
-
#line
|
|
948
|
+
#line 883 "ext/c/lexer.c"
|
|
938
949
|
if ( (*p) == 63 )
|
|
939
950
|
goto tr67;
|
|
940
951
|
goto tr65;
|
|
@@ -948,7 +959,7 @@ st50:
|
|
|
948
959
|
if ( ++p == pe )
|
|
949
960
|
goto _test_eof50;
|
|
950
961
|
case 50:
|
|
951
|
-
#line
|
|
962
|
+
#line 895 "ext/c/lexer.c"
|
|
952
963
|
if ( (*p) == 62 )
|
|
953
964
|
goto tr68;
|
|
954
965
|
goto tr67;
|
|
@@ -981,7 +992,7 @@ st51:
|
|
|
981
992
|
case 51:
|
|
982
993
|
#line 1 "NONE"
|
|
983
994
|
{ts = p;}
|
|
984
|
-
#line
|
|
995
|
+
#line 923 "ext/c/lexer.c"
|
|
985
996
|
if ( (*p) == 39 )
|
|
986
997
|
goto tr70;
|
|
987
998
|
goto tr69;
|
|
@@ -995,7 +1006,7 @@ st52:
|
|
|
995
1006
|
if ( ++p == pe )
|
|
996
1007
|
goto _test_eof52;
|
|
997
1008
|
case 52:
|
|
998
|
-
#line
|
|
1009
|
+
#line 935 "ext/c/lexer.c"
|
|
999
1010
|
if ( (*p) == 39 )
|
|
1000
1011
|
goto tr71;
|
|
1001
1012
|
goto tr69;
|
|
@@ -1028,7 +1039,7 @@ st53:
|
|
|
1028
1039
|
case 53:
|
|
1029
1040
|
#line 1 "NONE"
|
|
1030
1041
|
{ts = p;}
|
|
1031
|
-
#line
|
|
1042
|
+
#line 963 "ext/c/lexer.c"
|
|
1032
1043
|
if ( (*p) == 34 )
|
|
1033
1044
|
goto tr73;
|
|
1034
1045
|
goto tr72;
|
|
@@ -1042,7 +1053,7 @@ st54:
|
|
|
1042
1053
|
if ( ++p == pe )
|
|
1043
1054
|
goto _test_eof54;
|
|
1044
1055
|
case 54:
|
|
1045
|
-
#line
|
|
1056
|
+
#line 975 "ext/c/lexer.c"
|
|
1046
1057
|
if ( (*p) == 34 )
|
|
1047
1058
|
goto tr74;
|
|
1048
1059
|
goto tr72;
|
|
@@ -1072,7 +1083,7 @@ st55:
|
|
|
1072
1083
|
case 55:
|
|
1073
1084
|
#line 1 "NONE"
|
|
1074
1085
|
{ts = p;}
|
|
1075
|
-
#line
|
|
1086
|
+
#line 1000 "ext/c/lexer.c"
|
|
1076
1087
|
if ( (*p) == 93 )
|
|
1077
1088
|
goto tr76;
|
|
1078
1089
|
goto tr75;
|
|
@@ -1086,7 +1097,7 @@ st56:
|
|
|
1086
1097
|
if ( ++p == pe )
|
|
1087
1098
|
goto _test_eof56;
|
|
1088
1099
|
case 56:
|
|
1089
|
-
#line
|
|
1100
|
+
#line 1012 "ext/c/lexer.c"
|
|
1090
1101
|
if ( (*p) == 93 )
|
|
1091
1102
|
goto tr77;
|
|
1092
1103
|
goto tr75;
|
|
@@ -1165,7 +1176,7 @@ st57:
|
|
|
1165
1176
|
case 57:
|
|
1166
1177
|
#line 1 "NONE"
|
|
1167
1178
|
{ts = p;}
|
|
1168
|
-
#line
|
|
1179
|
+
#line 1079 "ext/c/lexer.c"
|
|
1169
1180
|
switch( (*p) ) {
|
|
1170
1181
|
case 9: goto tr79;
|
|
1171
1182
|
case 10: goto tr81;
|
|
@@ -1210,7 +1221,7 @@ st58:
|
|
|
1210
1221
|
if ( ++p == pe )
|
|
1211
1222
|
goto _test_eof58;
|
|
1212
1223
|
case 58:
|
|
1213
|
-
#line
|
|
1224
|
+
#line 1119 "ext/c/lexer.c"
|
|
1214
1225
|
switch( (*p) ) {
|
|
1215
1226
|
case 47: goto tr89;
|
|
1216
1227
|
case 96: goto tr89;
|
|
@@ -1530,7 +1541,7 @@ st70:
|
|
|
1530
1541
|
case 70:
|
|
1531
1542
|
#line 1 "NONE"
|
|
1532
1543
|
{ts = p;}
|
|
1533
|
-
#line
|
|
1544
|
+
#line 1427 "ext/c/lexer.c"
|
|
1534
1545
|
switch( (*p) ) {
|
|
1535
1546
|
case 34: goto tr103;
|
|
1536
1547
|
case 39: goto tr104;
|
|
@@ -1560,7 +1571,7 @@ st71:
|
|
|
1560
1571
|
if ( ++p == pe )
|
|
1561
1572
|
goto _test_eof71;
|
|
1562
1573
|
case 71:
|
|
1563
|
-
#line
|
|
1574
|
+
#line 1455 "ext/c/lexer.c"
|
|
1564
1575
|
switch( (*p) ) {
|
|
1565
1576
|
case 47: goto tr106;
|
|
1566
1577
|
case 96: goto tr106;
|
|
@@ -1587,7 +1598,7 @@ st72:
|
|
|
1587
1598
|
if ( ++p == pe )
|
|
1588
1599
|
goto _test_eof72;
|
|
1589
1600
|
case 72:
|
|
1590
|
-
#line
|
|
1601
|
+
#line 1480 "ext/c/lexer.c"
|
|
1591
1602
|
if ( (*p) == 62 )
|
|
1592
1603
|
goto tr109;
|
|
1593
1604
|
goto tr108;
|
|
@@ -1624,7 +1635,7 @@ st73:
|
|
|
1624
1635
|
case 73:
|
|
1625
1636
|
#line 1 "NONE"
|
|
1626
1637
|
{ts = p;}
|
|
1627
|
-
#line
|
|
1638
|
+
#line 1512 "ext/c/lexer.c"
|
|
1628
1639
|
switch( (*p) ) {
|
|
1629
1640
|
case 47: goto st0;
|
|
1630
1641
|
case 96: goto st0;
|
|
@@ -1706,7 +1717,7 @@ st75:
|
|
|
1706
1717
|
case 75:
|
|
1707
1718
|
#line 1 "NONE"
|
|
1708
1719
|
{ts = p;}
|
|
1709
|
-
#line
|
|
1720
|
+
#line 1585 "ext/c/lexer.c"
|
|
1710
1721
|
switch( (*p) ) {
|
|
1711
1722
|
case 47: goto tr114;
|
|
1712
1723
|
case 62: goto tr115;
|
|
@@ -1734,7 +1745,7 @@ st76:
|
|
|
1734
1745
|
if ( ++p == pe )
|
|
1735
1746
|
goto _test_eof76;
|
|
1736
1747
|
case 76:
|
|
1737
|
-
#line
|
|
1748
|
+
#line 1611 "ext/c/lexer.c"
|
|
1738
1749
|
switch( (*p) ) {
|
|
1739
1750
|
case 47: goto tr116;
|
|
1740
1751
|
case 58: goto tr118;
|
|
@@ -1812,7 +1823,7 @@ st77:
|
|
|
1812
1823
|
case 77:
|
|
1813
1824
|
#line 1 "NONE"
|
|
1814
1825
|
{ts = p;}
|
|
1815
|
-
#line
|
|
1826
|
+
#line 1681 "ext/c/lexer.c"
|
|
1816
1827
|
switch( (*p) ) {
|
|
1817
1828
|
case 13: goto tr121;
|
|
1818
1829
|
case 32: goto tr120;
|
|
@@ -1832,7 +1843,7 @@ st78:
|
|
|
1832
1843
|
if ( ++p == pe )
|
|
1833
1844
|
goto _test_eof78;
|
|
1834
1845
|
case 78:
|
|
1835
|
-
#line
|
|
1846
|
+
#line 1699 "ext/c/lexer.c"
|
|
1836
1847
|
if ( (*p) == 10 )
|
|
1837
1848
|
goto tr120;
|
|
1838
1849
|
goto tr123;
|
|
@@ -1861,7 +1872,7 @@ st79:
|
|
|
1861
1872
|
case 79:
|
|
1862
1873
|
#line 1 "NONE"
|
|
1863
1874
|
{ts = p;}
|
|
1864
|
-
#line
|
|
1875
|
+
#line 1723 "ext/c/lexer.c"
|
|
1865
1876
|
switch( (*p) ) {
|
|
1866
1877
|
case 13: goto tr125;
|
|
1867
1878
|
case 32: goto tr125;
|
|
@@ -1915,7 +1926,7 @@ st81:
|
|
|
1915
1926
|
case 81:
|
|
1916
1927
|
#line 1 "NONE"
|
|
1917
1928
|
{ts = p;}
|
|
1918
|
-
#line
|
|
1929
|
+
#line 1771 "ext/c/lexer.c"
|
|
1919
1930
|
switch( (*p) ) {
|
|
1920
1931
|
case 34: goto tr128;
|
|
1921
1932
|
case 39: goto tr129;
|
|
@@ -1992,7 +2003,7 @@ st82:
|
|
|
1992
2003
|
case 82:
|
|
1993
2004
|
#line 1 "NONE"
|
|
1994
2005
|
{ts = p;}
|
|
1995
|
-
#line
|
|
2006
|
+
#line 1834 "ext/c/lexer.c"
|
|
1996
2007
|
switch( (*p) ) {
|
|
1997
2008
|
case 10: goto tr132;
|
|
1998
2009
|
case 13: goto st84;
|
|
@@ -2077,7 +2088,7 @@ st87:
|
|
|
2077
2088
|
if ( ++p == pe )
|
|
2078
2089
|
goto _test_eof87;
|
|
2079
2090
|
case 87:
|
|
2080
|
-
#line
|
|
2091
|
+
#line 1917 "ext/c/lexer.c"
|
|
2081
2092
|
switch( (*p) ) {
|
|
2082
2093
|
case 47: goto tr144;
|
|
2083
2094
|
case 58: goto st20;
|
|
@@ -2211,7 +2222,7 @@ st89:
|
|
|
2211
2222
|
case 89:
|
|
2212
2223
|
#line 1 "NONE"
|
|
2213
2224
|
{ts = p;}
|
|
2214
|
-
#line
|
|
2225
|
+
#line 2038 "ext/c/lexer.c"
|
|
2215
2226
|
switch( (*p) ) {
|
|
2216
2227
|
case 10: goto tr148;
|
|
2217
2228
|
case 13: goto st91;
|
|
@@ -2295,7 +2306,7 @@ st94:
|
|
|
2295
2306
|
if ( ++p == pe )
|
|
2296
2307
|
goto _test_eof94;
|
|
2297
2308
|
case 94:
|
|
2298
|
-
#line
|
|
2309
|
+
#line 2120 "ext/c/lexer.c"
|
|
2299
2310
|
switch( (*p) ) {
|
|
2300
2311
|
case 47: goto tr159;
|
|
2301
2312
|
case 58: goto st21;
|
|
@@ -2412,7 +2423,7 @@ st96:
|
|
|
2412
2423
|
case 96:
|
|
2413
2424
|
#line 1 "NONE"
|
|
2414
2425
|
{ts = p;}
|
|
2415
|
-
#line
|
|
2426
|
+
#line 2231 "ext/c/lexer.c"
|
|
2416
2427
|
if ( (*p) == 60 )
|
|
2417
2428
|
goto tr162;
|
|
2418
2429
|
goto tr161;
|
|
@@ -2426,7 +2437,7 @@ st97:
|
|
|
2426
2437
|
if ( ++p == pe )
|
|
2427
2438
|
goto _test_eof97;
|
|
2428
2439
|
case 97:
|
|
2429
|
-
#line
|
|
2440
|
+
#line 2243 "ext/c/lexer.c"
|
|
2430
2441
|
if ( (*p) == 60 )
|
|
2431
2442
|
goto tr164;
|
|
2432
2443
|
goto tr161;
|
|
@@ -2442,7 +2453,7 @@ st98:
|
|
|
2442
2453
|
if ( ++p == pe )
|
|
2443
2454
|
goto _test_eof98;
|
|
2444
2455
|
case 98:
|
|
2445
|
-
#line
|
|
2456
|
+
#line 2256 "ext/c/lexer.c"
|
|
2446
2457
|
switch( (*p) ) {
|
|
2447
2458
|
case 60: goto tr164;
|
|
2448
2459
|
case 64: goto tr161;
|
|
@@ -2475,7 +2486,7 @@ st99:
|
|
|
2475
2486
|
if ( ++p == pe )
|
|
2476
2487
|
goto _test_eof99;
|
|
2477
2488
|
case 99:
|
|
2478
|
-
#line
|
|
2489
|
+
#line 2286 "ext/c/lexer.c"
|
|
2479
2490
|
switch( (*p) ) {
|
|
2480
2491
|
case 60: goto tr164;
|
|
2481
2492
|
case 64: goto tr161;
|
|
@@ -2539,7 +2550,7 @@ st100:
|
|
|
2539
2550
|
case 100:
|
|
2540
2551
|
#line 1 "NONE"
|
|
2541
2552
|
{ts = p;}
|
|
2542
|
-
#line
|
|
2553
|
+
#line 2344 "ext/c/lexer.c"
|
|
2543
2554
|
if ( (*p) == 60 )
|
|
2544
2555
|
goto tr168;
|
|
2545
2556
|
goto tr167;
|
|
@@ -2553,7 +2564,7 @@ st101:
|
|
|
2553
2564
|
if ( ++p == pe )
|
|
2554
2565
|
goto _test_eof101;
|
|
2555
2566
|
case 101:
|
|
2556
|
-
#line
|
|
2567
|
+
#line 2356 "ext/c/lexer.c"
|
|
2557
2568
|
if ( (*p) == 60 )
|
|
2558
2569
|
goto tr169;
|
|
2559
2570
|
goto tr167;
|
|
@@ -2569,7 +2580,7 @@ st102:
|
|
|
2569
2580
|
if ( ++p == pe )
|
|
2570
2581
|
goto _test_eof102;
|
|
2571
2582
|
case 102:
|
|
2572
|
-
#line
|
|
2583
|
+
#line 2369 "ext/c/lexer.c"
|
|
2573
2584
|
switch( (*p) ) {
|
|
2574
2585
|
case 47: goto st22;
|
|
2575
2586
|
case 60: goto tr171;
|
|
@@ -2634,7 +2645,7 @@ st103:
|
|
|
2634
2645
|
if ( ++p == pe )
|
|
2635
2646
|
goto _test_eof103;
|
|
2636
2647
|
case 103:
|
|
2637
|
-
#line
|
|
2648
|
+
#line 2432 "ext/c/lexer.c"
|
|
2638
2649
|
if ( (*p) == 60 )
|
|
2639
2650
|
goto tr171;
|
|
2640
2651
|
goto tr169;
|
|
@@ -2681,7 +2692,7 @@ st104:
|
|
|
2681
2692
|
case 104:
|
|
2682
2693
|
#line 1 "NONE"
|
|
2683
2694
|
{ts = p;}
|
|
2684
|
-
#line
|
|
2695
|
+
#line 2473 "ext/c/lexer.c"
|
|
2685
2696
|
if ( (*p) == 60 )
|
|
2686
2697
|
goto tr173;
|
|
2687
2698
|
goto tr172;
|
|
@@ -2695,7 +2706,7 @@ st105:
|
|
|
2695
2706
|
if ( ++p == pe )
|
|
2696
2707
|
goto _test_eof105;
|
|
2697
2708
|
case 105:
|
|
2698
|
-
#line
|
|
2709
|
+
#line 2485 "ext/c/lexer.c"
|
|
2699
2710
|
if ( (*p) == 60 )
|
|
2700
2711
|
goto tr174;
|
|
2701
2712
|
goto tr172;
|
|
@@ -2711,7 +2722,7 @@ st106:
|
|
|
2711
2722
|
if ( ++p == pe )
|
|
2712
2723
|
goto _test_eof106;
|
|
2713
2724
|
case 106:
|
|
2714
|
-
#line
|
|
2725
|
+
#line 2498 "ext/c/lexer.c"
|
|
2715
2726
|
switch( (*p) ) {
|
|
2716
2727
|
case 47: goto st29;
|
|
2717
2728
|
case 60: goto tr176;
|
|
@@ -2769,7 +2780,7 @@ st107:
|
|
|
2769
2780
|
if ( ++p == pe )
|
|
2770
2781
|
goto _test_eof107;
|
|
2771
2782
|
case 107:
|
|
2772
|
-
#line
|
|
2783
|
+
#line 2554 "ext/c/lexer.c"
|
|
2773
2784
|
if ( (*p) == 60 )
|
|
2774
2785
|
goto tr176;
|
|
2775
2786
|
goto tr174;
|
|
@@ -2980,7 +2991,7 @@ case 107:
|
|
|
2980
2991
|
_out: {}
|
|
2981
2992
|
}
|
|
2982
2993
|
|
|
2983
|
-
#line
|
|
2994
|
+
#line 143 "ext/c/lexer.rl"
|
|
2984
2995
|
|
|
2985
2996
|
state->lines = lines;
|
|
2986
2997
|
|
|
@@ -2994,7 +3005,7 @@ VALUE oga_xml_lexer_reset(VALUE self)
|
|
|
2994
3005
|
{
|
|
2995
3006
|
OgaLexerState *state;
|
|
2996
3007
|
|
|
2997
|
-
|
|
3008
|
+
TypedData_Get_Struct(self, OgaLexerState, &oga_xml_lexer_data_type, state);
|
|
2998
3009
|
|
|
2999
3010
|
state->act = 0;
|
|
3000
3011
|
state->cs = c_lexer_start;
|
|
@@ -3004,27 +3015,19 @@ VALUE oga_xml_lexer_reset(VALUE self)
|
|
|
3004
3015
|
return Qnil;
|
|
3005
3016
|
}
|
|
3006
3017
|
|
|
3007
|
-
/**
|
|
3008
|
-
* Frees the associated lexer state struct.
|
|
3009
|
-
*/
|
|
3010
|
-
void oga_xml_lexer_free(void *state)
|
|
3011
|
-
{
|
|
3012
|
-
free((OgaLexerState *) state);
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
3018
|
/**
|
|
3016
3019
|
* Allocates and wraps the C lexer state struct. This state is used to keep
|
|
3017
3020
|
* track of the current position, line numbers, etc.
|
|
3018
3021
|
*/
|
|
3019
3022
|
VALUE oga_xml_lexer_allocate(VALUE klass)
|
|
3020
3023
|
{
|
|
3021
|
-
OgaLexerState *state
|
|
3024
|
+
OgaLexerState *state;
|
|
3022
3025
|
|
|
3023
|
-
return
|
|
3026
|
+
return TypedData_Make_Struct(klass, OgaLexerState, &oga_xml_lexer_data_type, state);
|
|
3024
3027
|
}
|
|
3025
3028
|
|
|
3026
3029
|
|
|
3027
|
-
#line
|
|
3030
|
+
#line 184 "ext/c/lexer.rl"
|
|
3028
3031
|
|
|
3029
3032
|
|
|
3030
3033
|
void Init_liboga_xml_lexer()
|
data/ext/c/lexer.rl
CHANGED
|
@@ -68,6 +68,17 @@ void liboga_xml_lexer_callback_simple(VALUE self, VALUE name)
|
|
|
68
68
|
|
|
69
69
|
%% write data;
|
|
70
70
|
|
|
71
|
+
static size_t oga_xml_lexer_memsize(const void *state)
|
|
72
|
+
{
|
|
73
|
+
return state ? sizeof(OgaLexerState) : 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static const rb_data_type_t oga_xml_lexer_data_type = {
|
|
77
|
+
"Oga::XML::Lexer",
|
|
78
|
+
{NULL, RUBY_DEFAULT_FREE, oga_xml_lexer_memsize,},
|
|
79
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
|
80
|
+
};
|
|
81
|
+
|
|
71
82
|
/**
|
|
72
83
|
* Lexes the String specifies as the method argument. Token values have the
|
|
73
84
|
* same encoding as the input value.
|
|
@@ -124,7 +135,7 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
|
|
|
124
135
|
ID id_on_xml_decl_end = rb_intern("on_xml_decl_end");
|
|
125
136
|
ID id_on_xml_decl_start = rb_intern("on_xml_decl_start");
|
|
126
137
|
|
|
127
|
-
|
|
138
|
+
TypedData_Get_Struct(self, OgaLexerState, &oga_xml_lexer_data_type, state);
|
|
128
139
|
|
|
129
140
|
lines = state->lines;
|
|
130
141
|
|
|
@@ -142,7 +153,7 @@ VALUE oga_xml_lexer_reset(VALUE self)
|
|
|
142
153
|
{
|
|
143
154
|
OgaLexerState *state;
|
|
144
155
|
|
|
145
|
-
|
|
156
|
+
TypedData_Get_Struct(self, OgaLexerState, &oga_xml_lexer_data_type, state);
|
|
146
157
|
|
|
147
158
|
state->act = 0;
|
|
148
159
|
state->cs = c_lexer_start;
|
|
@@ -152,23 +163,15 @@ VALUE oga_xml_lexer_reset(VALUE self)
|
|
|
152
163
|
return Qnil;
|
|
153
164
|
}
|
|
154
165
|
|
|
155
|
-
/**
|
|
156
|
-
* Frees the associated lexer state struct.
|
|
157
|
-
*/
|
|
158
|
-
void oga_xml_lexer_free(void *state)
|
|
159
|
-
{
|
|
160
|
-
free((OgaLexerState *) state);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
166
|
/**
|
|
164
167
|
* Allocates and wraps the C lexer state struct. This state is used to keep
|
|
165
168
|
* track of the current position, line numbers, etc.
|
|
166
169
|
*/
|
|
167
170
|
VALUE oga_xml_lexer_allocate(VALUE klass)
|
|
168
171
|
{
|
|
169
|
-
OgaLexerState *state
|
|
172
|
+
OgaLexerState *state;
|
|
170
173
|
|
|
171
|
-
return
|
|
174
|
+
return TypedData_Make_Struct(klass, OgaLexerState, &oga_xml_lexer_data_type, state);
|
|
172
175
|
}
|
|
173
176
|
|
|
174
177
|
%%{
|
|
@@ -39,7 +39,7 @@ public class Lexer extends RubyObject
|
|
|
39
39
|
private Ruby runtime;
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
// line
|
|
42
|
+
// line 40 "ext/java/org/liboga/xml/Lexer.java"
|
|
43
43
|
private static byte[] init__java_lexer_actions_0()
|
|
44
44
|
{
|
|
45
45
|
return new byte [] {
|
|
@@ -487,7 +487,7 @@ static final int java_lexer_en_main = 35;
|
|
|
487
487
|
String id_on_xml_decl_start = "on_xml_decl_start";
|
|
488
488
|
|
|
489
489
|
|
|
490
|
-
// line
|
|
490
|
+
// line 486 "ext/java/org/liboga/xml/Lexer.java"
|
|
491
491
|
{
|
|
492
492
|
int _klen;
|
|
493
493
|
int _trans = 0;
|
|
@@ -516,7 +516,7 @@ case 1:
|
|
|
516
516
|
// line 1 "NONE"
|
|
517
517
|
{ts = p;}
|
|
518
518
|
break;
|
|
519
|
-
// line
|
|
519
|
+
// line 515 "ext/java/org/liboga/xml/Lexer.java"
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
|
|
@@ -1348,7 +1348,7 @@ case 3:
|
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
break;
|
|
1351
|
-
// line
|
|
1351
|
+
// line 1347 "ext/java/org/liboga/xml/Lexer.java"
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
@@ -1362,7 +1362,7 @@ case 2:
|
|
|
1362
1362
|
// line 1 "NONE"
|
|
1363
1363
|
{ts = -1;}
|
|
1364
1364
|
break;
|
|
1365
|
-
// line
|
|
1365
|
+
// line 1361 "ext/java/org/liboga/xml/Lexer.java"
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
1368
|
|
data/lib/oga/version.rb
CHANGED
data/lib/oga/xml/node_set.rb
CHANGED
data/lib/oga/xpath/lexer.rb
CHANGED
|
@@ -36,7 +36,7 @@ module Oga
|
|
|
36
36
|
# @api private
|
|
37
37
|
class Lexer
|
|
38
38
|
|
|
39
|
-
# line
|
|
39
|
+
# line 37 "lib/oga/xpath/lexer.rb"
|
|
40
40
|
class << self
|
|
41
41
|
attr_accessor :_xpath_lexer_trans_keys
|
|
42
42
|
private :_xpath_lexer_trans_keys, :_xpath_lexer_trans_keys=
|
|
@@ -2044,7 +2044,7 @@ self.xpath_lexer_en_main = 22;
|
|
|
2044
2044
|
_xpath_lexer_trans_targs = self.class.send(:_xpath_lexer_trans_targs)
|
|
2045
2045
|
|
|
2046
2046
|
|
|
2047
|
-
# line
|
|
2047
|
+
# line 2043 "lib/oga/xpath/lexer.rb"
|
|
2048
2048
|
begin
|
|
2049
2049
|
testEof = false
|
|
2050
2050
|
_slen, _trans, _keys, _inds, _acts, _nacts = nil
|
|
@@ -2072,7 +2072,7 @@ begin
|
|
|
2072
2072
|
begin
|
|
2073
2073
|
ts = p
|
|
2074
2074
|
end
|
|
2075
|
-
# line
|
|
2075
|
+
# line 2071 "lib/oga/xpath/lexer.rb"
|
|
2076
2076
|
end
|
|
2077
2077
|
_keys = cs << 1
|
|
2078
2078
|
_inds = _xpath_lexer_index_offsets[cs]
|
|
@@ -2470,7 +2470,7 @@ te = p+1
|
|
|
2470
2470
|
# line 199 "lib/oga/xpath/lexer.rl"
|
|
2471
2471
|
begin
|
|
2472
2472
|
act = 6; end
|
|
2473
|
-
# line
|
|
2473
|
+
# line 2469 "lib/oga/xpath/lexer.rb"
|
|
2474
2474
|
end
|
|
2475
2475
|
end
|
|
2476
2476
|
end
|
|
@@ -2484,7 +2484,7 @@ ts = nil; end
|
|
|
2484
2484
|
begin
|
|
2485
2485
|
act = 0
|
|
2486
2486
|
end
|
|
2487
|
-
# line
|
|
2487
|
+
# line 2483 "lib/oga/xpath/lexer.rb"
|
|
2488
2488
|
end
|
|
2489
2489
|
|
|
2490
2490
|
if cs == 0
|
data/lib/oga.rb
CHANGED
data/oga.gemspec
CHANGED
|
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
|
6
6
|
s.authors = ['Yorick Peterse']
|
|
7
7
|
s.email = 'yorickpeterse@gmail.com'
|
|
8
8
|
s.summary = 'Oga is an XML/HTML parser written in Ruby.'
|
|
9
|
-
s.homepage = 'https://
|
|
9
|
+
s.homepage = 'https://github.com/yorickpeterse/oga/'
|
|
10
10
|
s.description = s.summary
|
|
11
11
|
s.license = 'MPL-2.0'
|
|
12
12
|
|
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
|
32
32
|
s.required_ruby_version = '>= 2.3.0'
|
|
33
33
|
|
|
34
34
|
s.add_dependency 'ast'
|
|
35
|
-
s.add_dependency 'ruby-ll', '~> 2.
|
|
35
|
+
s.add_dependency 'ruby-ll', '~> 2.2'
|
|
36
36
|
|
|
37
37
|
s.add_development_dependency 'rake'
|
|
38
38
|
s.add_development_dependency 'rspec', ['~> 3.0']
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oga
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '3.
|
|
4
|
+
version: '3.5'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yorick Peterse
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ast
|
|
@@ -30,14 +29,14 @@ dependencies:
|
|
|
30
29
|
requirements:
|
|
31
30
|
- - "~>"
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '2.
|
|
32
|
+
version: '2.2'
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '2.
|
|
39
|
+
version: '2.2'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: rake
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -206,11 +205,10 @@ files:
|
|
|
206
205
|
- lib/oga/xpath/lexer.rb
|
|
207
206
|
- lib/oga/xpath/parser.rb
|
|
208
207
|
- oga.gemspec
|
|
209
|
-
homepage: https://
|
|
208
|
+
homepage: https://github.com/yorickpeterse/oga/
|
|
210
209
|
licenses:
|
|
211
210
|
- MPL-2.0
|
|
212
211
|
metadata: {}
|
|
213
|
-
post_install_message:
|
|
214
212
|
rdoc_options: []
|
|
215
213
|
require_paths:
|
|
216
214
|
- lib
|
|
@@ -225,8 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
225
223
|
- !ruby/object:Gem::Version
|
|
226
224
|
version: '0'
|
|
227
225
|
requirements: []
|
|
228
|
-
rubygems_version: 3.
|
|
229
|
-
signing_key:
|
|
226
|
+
rubygems_version: 3.6.7
|
|
230
227
|
specification_version: 4
|
|
231
228
|
summary: Oga is an XML/HTML parser written in Ruby.
|
|
232
229
|
test_files: []
|