nokogiri 1.6.3.1-x86-mingw32 → 1.6.4-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +7 -2
- data/CHANGELOG.ja.rdoc +16 -0
- data/CHANGELOG.rdoc +16 -0
- data/Gemfile +2 -2
- data/Manifest.txt +2 -11
- data/README.ja.rdoc +2 -2
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/build_all +1 -1
- data/dependencies.yml +1 -1
- data/ext/nokogiri/extconf.rb +115 -82
- data/ext/nokogiri/nokogiri.c +4 -0
- data/ext/nokogiri/xml_io.c +10 -6
- data/ext/nokogiri/xml_syntax_error.c +2 -1
- data/lib/nokogiri/1.9/nokogiri.so +0 -0
- data/lib/nokogiri/2.0/nokogiri.so +0 -0
- data/lib/nokogiri/2.1/nokogiri.so +0 -0
- data/lib/nokogiri/css/parser.rb +175 -165
- data/lib/nokogiri/css/parser.y +8 -2
- data/lib/nokogiri/css/tokenizer.rb +1 -1
- data/lib/nokogiri/css/tokenizer.rex +1 -1
- data/lib/nokogiri/version.rb +3 -1
- data/test/css/test_parser.rb +5 -0
- data/test/css/test_tokenizer.rb +17 -0
- data/test/html/test_document.rb +5 -5
- data/test/html/test_document_fragment.rb +5 -0
- data/test/xml/test_builder.rb +1 -1
- data/test/xml/test_document.rb +1 -9
- data/test/xml/test_entity_reference.rb +9 -3
- data/test/xml/test_node.rb +1 -1
- data/test/xml/test_syntax_error.rb +18 -0
- data/test/xml/test_xpath.rb +2 -0
- data/test_all +2 -2
- metadata +9 -9
data/ext/nokogiri/nokogiri.c
CHANGED
@@ -99,10 +99,14 @@ void Init_nokogiri()
|
|
99
99
|
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_USE_PACKAGED_LIBRARIES"), Qtrue);
|
100
100
|
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATH));
|
101
101
|
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXSLT_PATH));
|
102
|
+
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATCHES"), rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATCHES), " "));
|
103
|
+
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATCHES"), rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXSLT_PATCHES), " "));
|
102
104
|
#else
|
103
105
|
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_USE_PACKAGED_LIBRARIES"), Qfalse);
|
104
106
|
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), Qnil);
|
105
107
|
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATH"), Qnil);
|
108
|
+
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATCHES"), Qnil);
|
109
|
+
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATCHES"), Qnil);
|
106
110
|
#endif
|
107
111
|
|
108
112
|
#ifdef LIBXML_ICONV_ENABLED
|
data/ext/nokogiri/xml_io.c
CHANGED
@@ -7,7 +7,7 @@ VALUE read_check(VALUE *args) {
|
|
7
7
|
}
|
8
8
|
|
9
9
|
VALUE read_failed(void) {
|
10
|
-
return
|
10
|
+
return Qundef;
|
11
11
|
}
|
12
12
|
|
13
13
|
int io_read_callback(void * ctx, char * buffer, int len) {
|
@@ -19,7 +19,8 @@ int io_read_callback(void * ctx, char * buffer, int len) {
|
|
19
19
|
|
20
20
|
string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
|
21
21
|
|
22
|
-
if(NIL_P(string)) return 0;
|
22
|
+
if (NIL_P(string)) return 0;
|
23
|
+
if (string == Qundef) return -1;
|
23
24
|
|
24
25
|
str_len = (size_t)RSTRING_LEN(string);
|
25
26
|
safe_len = str_len > (size_t)len ? (size_t)len : str_len;
|
@@ -33,17 +34,20 @@ VALUE write_check(VALUE *args) {
|
|
33
34
|
}
|
34
35
|
|
35
36
|
VALUE write_failed(void) {
|
36
|
-
return
|
37
|
+
return Qundef;
|
37
38
|
}
|
38
39
|
|
39
40
|
int io_write_callback(void * ctx, char * buffer, int len) {
|
40
|
-
VALUE args[2];
|
41
|
+
VALUE args[2], size;
|
41
42
|
|
42
43
|
args[0] = (VALUE)ctx;
|
43
44
|
args[1] = rb_str_new(buffer, (long)len);
|
44
45
|
|
45
|
-
rb_rescue(write_check, (VALUE)args, write_failed, 0);
|
46
|
-
|
46
|
+
size = rb_rescue(write_check, (VALUE)args, write_failed, 0);
|
47
|
+
|
48
|
+
if (size == Qundef) return -1;
|
49
|
+
|
50
|
+
return NUM2INT(size);
|
47
51
|
}
|
48
52
|
|
49
53
|
int io_close_callback(void * ctx) {
|
@@ -3,6 +3,7 @@
|
|
3
3
|
void Nokogiri_error_array_pusher(void * ctx, xmlErrorPtr error)
|
4
4
|
{
|
5
5
|
VALUE list = (VALUE)ctx;
|
6
|
+
Check_Type(list, T_ARRAY);
|
6
7
|
rb_ary_push(list, Nokogiri_wrap_xml_syntax_error(error));
|
7
8
|
}
|
8
9
|
|
@@ -17,7 +18,7 @@ VALUE Nokogiri_wrap_xml_syntax_error(xmlErrorPtr error)
|
|
17
18
|
|
18
19
|
klass = cNokogiriXmlSyntaxError;
|
19
20
|
|
20
|
-
if (error->domain == XML_FROM_XPATH) {
|
21
|
+
if (error && error->domain == XML_FROM_XPATH) {
|
21
22
|
VALUE xpath = rb_const_get(mNokogiriXml, rb_intern("XPath"));
|
22
23
|
klass = rb_const_get(xpath, rb_intern("SyntaxError"));
|
23
24
|
}
|
Binary file
|
Binary file
|
Binary file
|
data/lib/nokogiri/css/parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.12
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -14,183 +14,187 @@ module Nokogiri
|
|
14
14
|
##### State transition tables begin ###
|
15
15
|
|
16
16
|
racc_action_table = [
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
nil,
|
34
|
-
|
35
|
-
|
36
|
-
5,
|
37
|
-
nil,
|
17
|
+
24, 93, 56, 57, 33, 55, 94, 23, 24, 22,
|
18
|
+
12, 93, 33, 27, 35, 52, 88, 22, -23, 25,
|
19
|
+
92, 98, 23, 33, 26, 18, 20, 25, 27, 86,
|
20
|
+
23, 24, 26, 18, 20, 33, 27, 11, 39, 24,
|
21
|
+
22, 23, 89, 33, 18, 101, 100, 27, 22, 12,
|
22
|
+
25, 24, 95, 23, 90, 26, 18, 20, 25, 27,
|
23
|
+
66, 23, 24, 26, 18, 20, 33, 27, 91, 90,
|
24
|
+
51, 22, 96, 85, 33, 26, 33, -23, 33, 56,
|
25
|
+
87, 25, 60, 99, 23, 74, 26, 18, 20, 39,
|
26
|
+
27, 39, 23, 39, 23, 18, 23, 18, 27, 18,
|
27
|
+
27, 33, 27, 33, 56, 87, 22, 60, 56, 87,
|
28
|
+
102, 60, 56, 87, 33, 60, 39, 24, 39, 23,
|
29
|
+
103, 23, 18, 20, 18, 27, 46, 27, 49, 39,
|
30
|
+
93, 44, 23, 105, 33, 18, 51, 45, 27, 33,
|
31
|
+
-23, 26, 108, 56, 58, 109, 60, nil, nil, 39,
|
32
|
+
nil, nil, 23, nil, 39, 18, nil, 23, 27, nil,
|
33
|
+
18, 20, nil, 27, 82, 83, nil, nil, nil, 82,
|
34
|
+
83, nil, nil, nil, nil, 78, 79, 80, nil, 81,
|
35
|
+
78, 79, 80, 77, 81, 4, 5, 10, 77, 4,
|
36
|
+
5, 43, nil, nil, nil, 6, nil, 8, 7, 6,
|
37
|
+
nil, 8, 7, 4, 5, 10, nil, nil, nil, nil,
|
38
|
+
nil, nil, nil, 6, nil, 8, 7 ]
|
38
39
|
|
39
40
|
racc_action_check = [
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
nil,
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
nil,
|
41
|
+
42, 58, 24, 24, 42, 24, 57, 15, 43, 42,
|
42
|
+
64, 57, 43, 15, 11, 24, 53, 43, 58, 42,
|
43
|
+
56, 64, 42, 14, 42, 42, 42, 43, 42, 50,
|
44
|
+
43, 3, 43, 43, 43, 3, 43, 1, 14, 9,
|
45
|
+
3, 14, 54, 9, 14, 76, 76, 14, 9, 1,
|
46
|
+
3, 27, 59, 3, 60, 3, 3, 3, 9, 3,
|
47
|
+
27, 9, 12, 9, 9, 9, 12, 9, 55, 55,
|
48
|
+
27, 12, 61, 49, 28, 27, 62, 46, 30, 92,
|
49
|
+
92, 12, 92, 75, 12, 45, 12, 12, 12, 28,
|
50
|
+
12, 62, 28, 30, 62, 28, 30, 62, 28, 30,
|
51
|
+
62, 39, 30, 32, 90, 90, 39, 90, 51, 51,
|
52
|
+
84, 51, 93, 93, 31, 93, 39, 23, 32, 39,
|
53
|
+
86, 32, 39, 39, 32, 39, 23, 32, 23, 31,
|
54
|
+
87, 18, 31, 91, 29, 31, 23, 21, 31, 25,
|
55
|
+
22, 23, 94, 25, 25, 105, 25, nil, nil, 29,
|
56
|
+
nil, nil, 29, nil, 25, 29, nil, 25, 29, nil,
|
57
|
+
25, 25, nil, 25, 48, 48, nil, nil, nil, 47,
|
58
|
+
47, nil, nil, nil, nil, 48, 48, 48, nil, 48,
|
59
|
+
47, 47, 47, 48, 47, 0, 0, 0, 47, 17,
|
60
|
+
17, 17, nil, nil, nil, 0, nil, 0, 0, 17,
|
61
|
+
nil, 17, 17, 26, 26, 26, nil, nil, nil, nil,
|
62
|
+
nil, nil, nil, 26, nil, 26, 26 ]
|
61
63
|
|
62
64
|
racc_action_pointer = [
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
nil,
|
68
|
-
|
69
|
-
|
70
|
-
nil, nil,
|
71
|
-
nil,
|
72
|
-
|
73
|
-
nil, nil,
|
65
|
+
178, 37, nil, 29, nil, nil, nil, nil, nil, 37,
|
66
|
+
nil, 14, 60, nil, 17, -17, nil, 182, 120, nil,
|
67
|
+
nil, 108, 111, 115, -8, 133, 196, 49, 68, 128,
|
68
|
+
72, 108, 97, nil, nil, nil, nil, nil, nil, 95,
|
69
|
+
nil, nil, -2, 6, nil, 74, 48, 166, 161, 48,
|
70
|
+
0, 98, nil, -7, 19, 57, 8, -1, -11, 29,
|
71
|
+
42, 49, 70, nil, -2, nil, nil, nil, nil, nil,
|
72
|
+
nil, nil, nil, nil, nil, 58, 35, nil, nil, nil,
|
73
|
+
nil, nil, nil, nil, 85, nil, 109, 118, nil, nil,
|
74
|
+
94, 126, 69, 102, 129, nil, nil, nil, nil, nil,
|
75
|
+
nil, nil, nil, nil, nil, 132, nil, nil, nil, nil ]
|
74
76
|
|
75
77
|
racc_action_default = [
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-28, -35, -
|
78
|
+
-74, -75, -2, -24, -4, -5, -6, -7, -8, -24,
|
79
|
+
-73, -75, -24, -3, -47, -10, -13, -17, -75, -19,
|
80
|
+
-20, -75, -22, -24, -75, -24, -74, -75, -53, -54,
|
81
|
+
-55, -56, -57, -58, -14, 110, -1, -9, -46, -24,
|
82
|
+
-11, -12, -24, -24, -18, -75, -29, -61, -61, -75,
|
83
|
+
-75, -75, -30, -75, -75, -38, -39, -40, -22, -75,
|
84
|
+
-38, -75, -70, -72, -75, -44, -45, -48, -49, -50,
|
85
|
+
-51, -52, -15, -16, -21, -75, -75, -62, -63, -64,
|
86
|
+
-65, -66, -67, -68, -75, -27, -75, -40, -31, -32,
|
87
|
+
-75, -43, -75, -75, -75, -33, -69, -71, -34, -25,
|
88
|
+
-59, -60, -26, -28, -35, -75, -36, -37, -42, -41 ]
|
87
89
|
|
88
90
|
racc_goto_table = [
|
89
|
-
|
90
|
-
|
91
|
-
|
91
|
+
53, 38, 13, 1, 41, 48, 62, 40, 34, 65,
|
92
|
+
50, 36, 63, 75, 84, 67, 68, 69, 70, 71,
|
93
|
+
62, 47, 37, 42, 54, nil, 63, nil, nil, 64,
|
92
94
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
93
|
-
nil,
|
95
|
+
nil, 72, 73, nil, nil, nil, nil, nil, nil, 97,
|
94
96
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
95
|
-
nil, nil, nil, nil, nil, nil,
|
97
|
+
nil, nil, nil, nil, nil, nil, 104, nil, 106, 107 ]
|
96
98
|
|
97
99
|
racc_goto_check = [
|
98
|
-
|
99
|
-
|
100
|
-
|
100
|
+
18, 12, 2, 1, 11, 9, 7, 10, 2, 9,
|
101
|
+
15, 2, 12, 17, 17, 12, 12, 12, 12, 12,
|
102
|
+
7, 16, 8, 5, 19, nil, 12, nil, nil, 1,
|
101
103
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
102
|
-
nil,
|
104
|
+
nil, 2, 2, nil, nil, nil, nil, nil, nil, 12,
|
103
105
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
104
|
-
nil, nil, nil, nil, nil, nil,
|
106
|
+
nil, nil, nil, nil, nil, nil, 18, nil, 18, 18 ]
|
105
107
|
|
106
108
|
racc_goto_pointer = [
|
107
|
-
nil,
|
108
|
-
-
|
109
|
-
nil, nil, nil ]
|
109
|
+
nil, 3, -1, nil, nil, 6, nil, -19, 8, -18,
|
110
|
+
-8, -11, -13, nil, nil, -13, -2, -34, -24, 0,
|
111
|
+
nil, nil, nil, nil ]
|
110
112
|
|
111
113
|
racc_goto_default = [
|
112
|
-
nil, nil, 3,
|
113
|
-
|
114
|
-
|
114
|
+
nil, nil, nil, 2, 3, 9, 17, 14, nil, 15,
|
115
|
+
31, 30, 16, 29, 19, 21, nil, nil, 59, nil,
|
116
|
+
28, 32, 76, 61 ]
|
115
117
|
|
116
118
|
racc_reduce_table = [
|
117
119
|
0, 0, :racc_error,
|
118
120
|
3, 32, :_reduce_1,
|
119
121
|
1, 32, :_reduce_2,
|
120
|
-
|
121
|
-
1,
|
122
|
-
1,
|
123
|
-
1,
|
124
|
-
1,
|
125
|
-
1,
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
2,
|
130
|
-
|
131
|
-
|
132
|
-
|
122
|
+
2, 32, :_reduce_3,
|
123
|
+
1, 36, :_reduce_4,
|
124
|
+
1, 36, :_reduce_5,
|
125
|
+
1, 36, :_reduce_6,
|
126
|
+
1, 36, :_reduce_7,
|
127
|
+
1, 36, :_reduce_8,
|
128
|
+
2, 37, :_reduce_9,
|
129
|
+
1, 37, :_reduce_none,
|
130
|
+
2, 37, :_reduce_11,
|
131
|
+
2, 37, :_reduce_12,
|
132
|
+
1, 37, :_reduce_13,
|
133
|
+
2, 34, :_reduce_14,
|
134
|
+
3, 33, :_reduce_15,
|
133
135
|
3, 33, :_reduce_16,
|
134
136
|
1, 33, :_reduce_none,
|
135
|
-
2,
|
136
|
-
1, 37, :_reduce_none,
|
137
|
-
1, 37, :_reduce_20,
|
138
|
-
3, 44, :_reduce_21,
|
139
|
-
1, 44, :_reduce_22,
|
140
|
-
1, 45, :_reduce_23,
|
141
|
-
0, 45, :_reduce_none,
|
142
|
-
4, 41, :_reduce_25,
|
143
|
-
4, 41, :_reduce_26,
|
144
|
-
3, 41, :_reduce_27,
|
145
|
-
3, 46, :_reduce_28,
|
146
|
-
1, 46, :_reduce_29,
|
147
|
-
2, 39, :_reduce_30,
|
148
|
-
3, 39, :_reduce_31,
|
149
|
-
3, 39, :_reduce_32,
|
150
|
-
3, 39, :_reduce_33,
|
151
|
-
3, 39, :_reduce_34,
|
152
|
-
3, 48, :_reduce_35,
|
153
|
-
3, 48, :_reduce_36,
|
154
|
-
3, 48, :_reduce_37,
|
155
|
-
1, 48, :_reduce_none,
|
156
|
-
1, 48, :_reduce_none,
|
157
|
-
1, 48, :_reduce_40,
|
158
|
-
4, 49, :_reduce_41,
|
159
|
-
3, 49, :_reduce_42,
|
160
|
-
2, 49, :_reduce_43,
|
161
|
-
2, 40, :_reduce_44,
|
162
|
-
2, 40, :_reduce_45,
|
137
|
+
2, 44, :_reduce_18,
|
163
138
|
1, 38, :_reduce_none,
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
1,
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
1,
|
183
|
-
1,
|
184
|
-
1,
|
185
|
-
|
186
|
-
3,
|
187
|
-
|
188
|
-
2,
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
139
|
+
1, 38, :_reduce_20,
|
140
|
+
3, 45, :_reduce_21,
|
141
|
+
1, 45, :_reduce_22,
|
142
|
+
1, 46, :_reduce_23,
|
143
|
+
0, 46, :_reduce_none,
|
144
|
+
4, 42, :_reduce_25,
|
145
|
+
4, 42, :_reduce_26,
|
146
|
+
3, 42, :_reduce_27,
|
147
|
+
3, 47, :_reduce_28,
|
148
|
+
1, 47, :_reduce_29,
|
149
|
+
2, 40, :_reduce_30,
|
150
|
+
3, 40, :_reduce_31,
|
151
|
+
3, 40, :_reduce_32,
|
152
|
+
3, 40, :_reduce_33,
|
153
|
+
3, 40, :_reduce_34,
|
154
|
+
3, 49, :_reduce_35,
|
155
|
+
3, 49, :_reduce_36,
|
156
|
+
3, 49, :_reduce_37,
|
157
|
+
1, 49, :_reduce_none,
|
158
|
+
1, 49, :_reduce_none,
|
159
|
+
1, 49, :_reduce_40,
|
160
|
+
4, 50, :_reduce_41,
|
161
|
+
3, 50, :_reduce_42,
|
162
|
+
2, 50, :_reduce_43,
|
163
|
+
2, 41, :_reduce_44,
|
164
|
+
2, 41, :_reduce_45,
|
165
|
+
1, 39, :_reduce_none,
|
166
|
+
0, 39, :_reduce_none,
|
167
|
+
2, 43, :_reduce_48,
|
168
|
+
2, 43, :_reduce_49,
|
169
|
+
2, 43, :_reduce_50,
|
170
|
+
2, 43, :_reduce_51,
|
171
|
+
2, 43, :_reduce_52,
|
172
|
+
1, 43, :_reduce_none,
|
173
|
+
1, 43, :_reduce_none,
|
174
|
+
1, 43, :_reduce_none,
|
175
|
+
1, 43, :_reduce_none,
|
176
|
+
1, 43, :_reduce_none,
|
177
|
+
1, 51, :_reduce_58,
|
178
|
+
2, 48, :_reduce_59,
|
179
|
+
2, 48, :_reduce_60,
|
180
|
+
0, 48, :_reduce_none,
|
181
|
+
1, 53, :_reduce_62,
|
182
|
+
1, 53, :_reduce_63,
|
183
|
+
1, 53, :_reduce_64,
|
184
|
+
1, 53, :_reduce_65,
|
185
|
+
1, 53, :_reduce_66,
|
186
|
+
1, 53, :_reduce_67,
|
187
|
+
1, 53, :_reduce_68,
|
188
|
+
3, 52, :_reduce_69,
|
189
|
+
1, 54, :_reduce_none,
|
190
|
+
2, 54, :_reduce_none,
|
191
|
+
1, 54, :_reduce_none,
|
192
|
+
1, 35, :_reduce_none,
|
193
|
+
0, 35, :_reduce_none ]
|
194
|
+
|
195
|
+
racc_reduce_n = 75
|
196
|
+
|
197
|
+
racc_shift_n = 110
|
194
198
|
|
195
199
|
racc_token_table = {
|
196
200
|
false => 0,
|
@@ -281,6 +285,7 @@ Racc_token_to_s_table = [
|
|
281
285
|
"selector",
|
282
286
|
"simple_selector_1toN",
|
283
287
|
"prefixless_combinator_selector",
|
288
|
+
"optional_S",
|
284
289
|
"combinator",
|
285
290
|
"simple_selector",
|
286
291
|
"element_name",
|
@@ -319,7 +324,7 @@ def _reduce_2(val, _values, result)
|
|
319
324
|
end
|
320
325
|
|
321
326
|
def _reduce_3(val, _values, result)
|
322
|
-
result = val.flatten
|
327
|
+
result = [val.last].flatten
|
323
328
|
result
|
324
329
|
end
|
325
330
|
|
@@ -344,16 +349,11 @@ def _reduce_7(val, _values, result)
|
|
344
349
|
end
|
345
350
|
|
346
351
|
def _reduce_8(val, _values, result)
|
347
|
-
result = :DESCENDANT_SELECTOR
|
348
|
-
result
|
349
|
-
end
|
350
|
-
|
351
|
-
def _reduce_9(val, _values, result)
|
352
352
|
result = :CHILD_SELECTOR
|
353
353
|
result
|
354
354
|
end
|
355
355
|
|
356
|
-
def
|
356
|
+
def _reduce_9(val, _values, result)
|
357
357
|
result = if val[1].nil?
|
358
358
|
val.first
|
359
359
|
else
|
@@ -363,21 +363,21 @@ def _reduce_10(val, _values, result)
|
|
363
363
|
result
|
364
364
|
end
|
365
365
|
|
366
|
-
# reduce
|
366
|
+
# reduce 10 omitted
|
367
367
|
|
368
|
-
def
|
368
|
+
def _reduce_11(val, _values, result)
|
369
369
|
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
370
370
|
|
371
371
|
result
|
372
372
|
end
|
373
373
|
|
374
|
-
def
|
374
|
+
def _reduce_12(val, _values, result)
|
375
375
|
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
376
376
|
|
377
377
|
result
|
378
378
|
end
|
379
379
|
|
380
|
-
def
|
380
|
+
def _reduce_13(val, _values, result)
|
381
381
|
result = Node.new(:CONDITIONAL_SELECTOR,
|
382
382
|
[Node.new(:ELEMENT_NAME, ['*']), val.first]
|
383
383
|
)
|
@@ -385,18 +385,24 @@ def _reduce_14(val, _values, result)
|
|
385
385
|
result
|
386
386
|
end
|
387
387
|
|
388
|
-
def
|
388
|
+
def _reduce_14(val, _values, result)
|
389
389
|
result = Node.new(val.first, [nil, val.last])
|
390
390
|
|
391
391
|
result
|
392
392
|
end
|
393
393
|
|
394
|
-
def
|
394
|
+
def _reduce_15(val, _values, result)
|
395
395
|
result = Node.new(val[1], [val.first, val.last])
|
396
396
|
|
397
397
|
result
|
398
398
|
end
|
399
399
|
|
400
|
+
def _reduce_16(val, _values, result)
|
401
|
+
result = Node.new(:DESCENDANT_SELECTOR, [val.first, val.last])
|
402
|
+
|
403
|
+
result
|
404
|
+
end
|
405
|
+
|
400
406
|
# reduce 17 omitted
|
401
407
|
|
402
408
|
def _reduce_18(val, _values, result)
|
@@ -706,6 +712,10 @@ end
|
|
706
712
|
|
707
713
|
# reduce 72 omitted
|
708
714
|
|
715
|
+
# reduce 73 omitted
|
716
|
+
|
717
|
+
# reduce 74 omitted
|
718
|
+
|
709
719
|
def _reduce_none(val, _values, result)
|
710
720
|
val[0]
|
711
721
|
end
|