nokogiri 1.12.5-x64-mingw32 → 1.13.3-x64-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/Gemfile +2 -0
- data/README.md +9 -7
- data/bin/nokogiri +63 -50
- data/dependencies.yml +11 -62
- data/ext/nokogiri/extconf.rb +64 -37
- data/ext/nokogiri/include/libexslt/exslt.h +6 -0
- data/ext/nokogiri/include/libexslt/exsltconfig.h +1 -1
- data/ext/nokogiri/include/libexslt/exsltexports.h +3 -3
- data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +1 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +5 -5
- data/ext/nokogiri/include/libxslt/extensions.h +1 -1
- data/ext/nokogiri/include/libxslt/preproc.h +1 -1
- data/ext/nokogiri/include/libxslt/xsltInternals.h +15 -11
- data/ext/nokogiri/include/libxslt/xsltconfig.h +4 -4
- data/ext/nokogiri/xml_document.c +35 -35
- data/ext/nokogiri/xml_document_fragment.c +0 -2
- data/ext/nokogiri/xml_dtd.c +2 -2
- data/ext/nokogiri/xml_encoding_handler.c +25 -11
- data/ext/nokogiri/xml_node.c +638 -333
- data/ext/nokogiri/xml_reader.c +37 -11
- data/ext/nokogiri/xml_xpath_context.c +72 -49
- data/ext/nokogiri/xslt_stylesheet.c +107 -9
- data/lib/nokogiri/2.6/nokogiri.so +0 -0
- data/lib/nokogiri/2.7/nokogiri.so +0 -0
- data/lib/nokogiri/3.0/nokogiri.so +0 -0
- data/lib/nokogiri/class_resolver.rb +67 -0
- data/lib/nokogiri/css/node.rb +9 -8
- data/lib/nokogiri/css/parser.rb +360 -341
- data/lib/nokogiri/css/parser.y +249 -244
- data/lib/nokogiri/css/parser_extras.rb +20 -20
- data/lib/nokogiri/css/syntax_error.rb +1 -0
- data/lib/nokogiri/css/tokenizer.rb +4 -3
- data/lib/nokogiri/css/tokenizer.rex +3 -2
- data/lib/nokogiri/css/xpath_visitor.rb +179 -82
- data/lib/nokogiri/css.rb +38 -6
- data/lib/nokogiri/decorators/slop.rb +8 -7
- data/lib/nokogiri/extension.rb +1 -1
- data/lib/nokogiri/gumbo.rb +1 -0
- data/lib/nokogiri/html.rb +16 -10
- data/lib/nokogiri/html4/builder.rb +1 -0
- data/lib/nokogiri/html4/document.rb +84 -75
- data/lib/nokogiri/html4/document_fragment.rb +11 -7
- data/lib/nokogiri/html4/element_description.rb +1 -0
- data/lib/nokogiri/html4/element_description_defaults.rb +426 -520
- data/lib/nokogiri/html4/entity_lookup.rb +2 -1
- data/lib/nokogiri/html4/sax/parser.rb +2 -1
- data/lib/nokogiri/html4/sax/parser_context.rb +1 -0
- data/lib/nokogiri/html4/sax/push_parser.rb +7 -7
- data/lib/nokogiri/html4.rb +11 -5
- data/lib/nokogiri/html5/document.rb +24 -10
- data/lib/nokogiri/html5/document_fragment.rb +5 -2
- data/lib/nokogiri/html5/node.rb +6 -3
- data/lib/nokogiri/html5.rb +68 -64
- data/lib/nokogiri/jruby/dependencies.rb +10 -9
- data/lib/nokogiri/syntax_error.rb +1 -0
- data/lib/nokogiri/version/constant.rb +2 -1
- data/lib/nokogiri/version/info.rb +19 -13
- data/lib/nokogiri/version.rb +1 -0
- data/lib/nokogiri/xml/attr.rb +5 -3
- data/lib/nokogiri/xml/attribute_decl.rb +2 -1
- data/lib/nokogiri/xml/builder.rb +32 -32
- data/lib/nokogiri/xml/cdata.rb +2 -1
- data/lib/nokogiri/xml/character_data.rb +1 -0
- data/lib/nokogiri/xml/document.rb +139 -103
- data/lib/nokogiri/xml/document_fragment.rb +41 -38
- data/lib/nokogiri/xml/dtd.rb +3 -2
- data/lib/nokogiri/xml/element_content.rb +1 -0
- data/lib/nokogiri/xml/element_decl.rb +2 -1
- data/lib/nokogiri/xml/entity_decl.rb +3 -2
- data/lib/nokogiri/xml/entity_reference.rb +1 -0
- data/lib/nokogiri/xml/namespace.rb +2 -0
- data/lib/nokogiri/xml/node/save_options.rb +6 -3
- data/lib/nokogiri/xml/node.rb +512 -348
- data/lib/nokogiri/xml/node_set.rb +46 -54
- data/lib/nokogiri/xml/notation.rb +12 -0
- data/lib/nokogiri/xml/parse_options.rb +11 -7
- data/lib/nokogiri/xml/pp/character_data.rb +8 -6
- data/lib/nokogiri/xml/pp/node.rb +24 -26
- data/lib/nokogiri/xml/pp.rb +1 -0
- data/lib/nokogiri/xml/processing_instruction.rb +2 -1
- data/lib/nokogiri/xml/reader.rb +17 -19
- data/lib/nokogiri/xml/relax_ng.rb +1 -0
- data/lib/nokogiri/xml/sax/document.rb +20 -19
- data/lib/nokogiri/xml/sax/parser.rb +36 -34
- data/lib/nokogiri/xml/sax/parser_context.rb +7 -3
- data/lib/nokogiri/xml/sax/push_parser.rb +5 -5
- data/lib/nokogiri/xml/sax.rb +1 -0
- data/lib/nokogiri/xml/schema.rb +7 -6
- data/lib/nokogiri/xml/searchable.rb +93 -62
- data/lib/nokogiri/xml/syntax_error.rb +4 -4
- data/lib/nokogiri/xml/text.rb +1 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +2 -1
- data/lib/nokogiri/xml/xpath.rb +12 -0
- data/lib/nokogiri/xml/xpath_context.rb +2 -3
- data/lib/nokogiri/xml.rb +3 -3
- data/lib/nokogiri/xslt/stylesheet.rb +1 -0
- data/lib/nokogiri/xslt.rb +21 -13
- data/lib/nokogiri.rb +19 -16
- data/lib/xsd/xmlparser/nokogiri.rb +25 -24
- metadata +122 -51
- data/lib/nokogiri/2.5/nokogiri.so +0 -0
data/lib/nokogiri/css/parser.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
3
|
# DO NOT MODIFY!!!!
|
4
|
-
# This file is automatically generated by Racc 1.
|
4
|
+
# This file is automatically generated by Racc 1.6.0
|
5
5
|
# from Racc grammar file "".
|
6
6
|
#
|
7
7
|
|
@@ -10,6 +10,14 @@ require 'racc/parser.rb'
|
|
10
10
|
|
11
11
|
require_relative "parser_extras"
|
12
12
|
|
13
|
+
module Nokogiri
|
14
|
+
module CSS
|
15
|
+
# :nodoc: all
|
16
|
+
class Parser < Racc::Parser
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
13
21
|
module Nokogiri
|
14
22
|
module CSS
|
15
23
|
class Parser < Racc::Parser
|
@@ -31,190 +39,204 @@ end
|
|
31
39
|
##### State transition tables begin ###
|
32
40
|
|
33
41
|
racc_action_table = [
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
27,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
nil,
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
nil,
|
42
|
+
27, 11, 38, 99, 36, 12, 40, 26, 48, 25,
|
43
|
+
49, 27, 100, 12, 30, 36, 105, 99, -26, 28,
|
44
|
+
25, -26, 26, 27, 29, 14, 21, 23, 80, 30,
|
45
|
+
28, 36, 72, 26, -26, 29, 14, 21, 23, 27,
|
46
|
+
30, 91, 56, 36, 97, 96, 43, 29, 25, 26,
|
47
|
+
27, 92, 94, 21, 36, 95, 30, 98, 28, 25,
|
48
|
+
101, 26, 102, 29, 14, 21, 23, 96, 30, 28,
|
49
|
+
36, 36, 26, 103, 29, 14, 21, 23, 27, 30,
|
50
|
+
108, 107, 36, 109, 106, 43, 43, 25, 26, 26,
|
51
|
+
27, 110, 21, 21, 111, 30, 30, 28, 99, 50,
|
52
|
+
26, 53, 29, 14, 21, 23, 36, 30, 36, 56,
|
53
|
+
61, 64, 113, 66, 29, 14, 116, 36, 118, 36,
|
54
|
+
nil, 43, nil, 43, 26, nil, 26, 14, 21, 23,
|
55
|
+
21, 30, 43, 30, 43, 26, nil, 26, 36, 21,
|
56
|
+
36, 21, 30, 25, 30, nil, nil, nil, nil, nil,
|
57
|
+
nil, 61, 62, 43, 60, 43, 26, nil, 26, nil,
|
58
|
+
21, 23, 21, 30, 57, 30, 88, 89, 14, nil,
|
59
|
+
nil, 88, 89, nil, nil, nil, nil, 84, 85, 86,
|
60
|
+
nil, 87, 84, 85, 86, 83, 87, nil, 61, 93,
|
61
|
+
83, 66, 61, 93, nil, 66, 61, 93, nil, 66,
|
62
|
+
61, 93, nil, 66, nil, 14, nil, 61, 93, 14,
|
63
|
+
66, nil, nil, 14, nil, nil, nil, 14, 4, 5,
|
64
|
+
10, nil, nil, nil, 14, 4, 5, 47, 6, nil,
|
65
|
+
8, 7, 4, 5, 10, 6, nil, 8, 7, nil,
|
66
|
+
nil, nil, 6, nil, 8, 7 ]
|
56
67
|
|
57
68
|
racc_action_check = [
|
58
|
-
3,
|
59
|
-
|
60
|
-
|
61
|
-
9,
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
nil,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
nil,
|
69
|
+
3, 1, 11, 64, 3, 70, 14, 17, 21, 3,
|
70
|
+
24, 9, 62, 1, 17, 9, 70, 62, 25, 3,
|
71
|
+
9, 64, 3, 30, 3, 3, 3, 3, 49, 3,
|
72
|
+
9, 16, 30, 9, 50, 9, 9, 9, 9, 12,
|
73
|
+
9, 53, 30, 12, 60, 60, 16, 30, 12, 16,
|
74
|
+
46, 54, 58, 16, 46, 59, 16, 61, 12, 46,
|
75
|
+
63, 12, 65, 12, 12, 12, 12, 66, 12, 46,
|
76
|
+
31, 32, 46, 67, 46, 46, 46, 46, 47, 46,
|
77
|
+
82, 82, 47, 82, 81, 31, 32, 47, 31, 32,
|
78
|
+
26, 90, 31, 32, 92, 31, 32, 47, 93, 26,
|
79
|
+
47, 26, 47, 47, 47, 47, 28, 47, 33, 26,
|
80
|
+
28, 28, 97, 28, 26, 26, 100, 34, 113, 35,
|
81
|
+
nil, 28, nil, 33, 28, nil, 33, 28, 28, 28,
|
82
|
+
33, 28, 34, 33, 35, 34, nil, 35, 43, 34,
|
83
|
+
68, 35, 34, 43, 35, nil, nil, nil, nil, nil,
|
84
|
+
nil, 27, 27, 43, 27, 68, 43, nil, 68, nil,
|
85
|
+
43, 43, 68, 43, 27, 68, 51, 51, 27, nil,
|
86
|
+
nil, 52, 52, nil, nil, nil, nil, 51, 51, 51,
|
87
|
+
nil, 51, 52, 52, 52, 51, 52, nil, 56, 56,
|
88
|
+
52, 56, 96, 96, nil, 96, 98, 98, nil, 98,
|
89
|
+
99, 99, nil, 99, nil, 56, nil, 101, 101, 96,
|
90
|
+
101, nil, nil, 98, nil, nil, nil, 99, 0, 0,
|
91
|
+
0, nil, nil, nil, 101, 20, 20, 20, 0, nil,
|
92
|
+
0, 0, 29, 29, 29, 20, nil, 20, 20, nil,
|
93
|
+
nil, nil, 29, nil, 29, 29 ]
|
80
94
|
|
81
95
|
racc_action_pointer = [
|
82
|
-
|
83
|
-
nil,
|
84
|
-
|
85
|
-
|
86
|
-
nil, nil,
|
87
|
-
|
88
|
-
|
89
|
-
nil, nil, nil, nil, nil,
|
90
|
-
nil, nil, nil, nil,
|
91
|
-
|
92
|
-
|
93
|
-
nil ]
|
96
|
+
211, 1, nil, -2, nil, nil, nil, nil, nil, 9,
|
97
|
+
nil, 2, 37, nil, -5, nil, 25, -17, nil, nil,
|
98
|
+
218, -3, nil, nil, -20, -12, 88, 141, 100, 225,
|
99
|
+
21, 64, 65, 102, 111, 113, nil, nil, nil, nil,
|
100
|
+
nil, nil, nil, 132, nil, nil, 48, 76, nil, 17,
|
101
|
+
4, 163, 168, 16, 21, nil, 178, nil, 29, 32,
|
102
|
+
33, 45, 5, 48, -9, 39, 55, 50, 134, nil,
|
103
|
+
-7, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
104
|
+
nil, 59, 70, nil, nil, nil, nil, nil, nil, nil,
|
105
|
+
66, nil, 83, 86, nil, nil, 182, 105, 186, 190,
|
106
|
+
103, 197, nil, nil, nil, nil, nil, nil, nil, nil,
|
107
|
+
nil, nil, nil, 105, nil, nil, nil, nil, nil ]
|
94
108
|
|
95
109
|
racc_action_default = [
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-20, -
|
99
|
-
-
|
100
|
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-41 ]
|
110
|
+
-81, -82, -2, -27, -4, -5, -6, -7, -8, -27,
|
111
|
+
-80, -82, -27, -3, -82, -10, -53, -12, -15, -16,
|
112
|
+
-20, -82, -22, -23, -82, -25, -27, -82, -27, -81,
|
113
|
+
-82, -59, -60, -61, -62, -63, -64, -17, 119, -1,
|
114
|
+
-9, -11, -52, -27, -13, -14, -27, -27, -21, -82,
|
115
|
+
-32, -68, -68, -82, -82, -33, -82, -34, -82, -82,
|
116
|
+
-43, -44, -45, -46, -25, -82, -43, -82, -77, -79,
|
117
|
+
-82, -50, -51, -54, -55, -56, -57, -58, -18, -19,
|
118
|
+
-24, -82, -82, -69, -70, -71, -72, -73, -74, -75,
|
119
|
+
-82, -30, -82, -45, -35, -36, -82, -49, -82, -82,
|
120
|
+
-82, -82, -37, -76, -78, -38, -28, -65, -66, -67,
|
121
|
+
-29, -31, -39, -82, -40, -41, -48, -42, -47 ]
|
108
122
|
|
109
123
|
racc_goto_table = [
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
nil, nil,
|
114
|
-
nil,
|
115
|
-
|
116
|
-
nil, nil, nil, nil, nil, nil,
|
124
|
+
58, 42, 13, 1, 46, 52, 19, 68, 37, 71,
|
125
|
+
41, 39, 19, 69, 44, 19, 73, 74, 75, 76,
|
126
|
+
77, 45, 68, 81, 90, 54, 51, 59, 69, 55,
|
127
|
+
nil, nil, 70, nil, nil, nil, nil, nil, nil, nil,
|
128
|
+
nil, nil, nil, nil, nil, 78, 79, nil, nil, 19,
|
129
|
+
19, nil, nil, 104, nil, nil, nil, nil, nil, nil,
|
130
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 112,
|
131
|
+
nil, 114, 115, nil, 117 ]
|
117
132
|
|
118
133
|
racc_goto_check = [
|
119
|
-
|
120
|
-
10, 2,
|
121
|
-
|
122
|
-
nil, nil,
|
123
|
-
nil,
|
124
|
-
|
125
|
-
nil, nil, nil, nil, nil, nil,
|
134
|
+
20, 14, 2, 1, 5, 11, 7, 9, 2, 11,
|
135
|
+
10, 2, 7, 14, 12, 7, 14, 14, 14, 14,
|
136
|
+
14, 13, 9, 19, 19, 17, 18, 21, 14, 7,
|
137
|
+
nil, nil, 1, nil, nil, nil, nil, nil, nil, nil,
|
138
|
+
nil, nil, nil, nil, nil, 2, 2, nil, nil, 7,
|
139
|
+
7, nil, nil, 14, nil, nil, nil, nil, nil, nil,
|
140
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 20,
|
141
|
+
nil, 20, 20, nil, 20 ]
|
126
142
|
|
127
143
|
racc_goto_pointer = [
|
128
|
-
nil, 3, -1, nil, nil, -
|
129
|
-
-
|
130
|
-
nil, nil, nil, nil ]
|
144
|
+
nil, 3, -1, nil, nil, -16, nil, 3, nil, -21,
|
145
|
+
-6, -21, -3, 4, -15, nil, nil, -1, 0, -28,
|
146
|
+
-27, 0, nil, nil, nil, nil ]
|
131
147
|
|
132
148
|
racc_goto_default = [
|
133
|
-
nil, nil, nil, 2, 3, 9,
|
134
|
-
|
135
|
-
|
149
|
+
nil, nil, nil, 2, 3, 9, 15, 63, 20, 16,
|
150
|
+
nil, 17, 34, 33, 18, 32, 22, 24, nil, nil,
|
151
|
+
65, nil, 31, 35, 82, 67 ]
|
136
152
|
|
137
153
|
racc_reduce_table = [
|
138
154
|
0, 0, :racc_error,
|
139
|
-
3,
|
140
|
-
1,
|
141
|
-
2,
|
142
|
-
1,
|
143
|
-
1,
|
144
|
-
1,
|
145
|
-
1,
|
146
|
-
1,
|
147
|
-
2,
|
148
|
-
1,
|
149
|
-
2,
|
150
|
-
|
151
|
-
|
152
|
-
2,
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
1,
|
159
|
-
|
160
|
-
1,
|
161
|
-
1,
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
3,
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
3,
|
174
|
-
3,
|
175
|
-
3,
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
3,
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
1,
|
185
|
-
|
186
|
-
|
187
|
-
2,
|
188
|
-
2,
|
189
|
-
2,
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
1,
|
202
|
-
1,
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
1,
|
208
|
-
|
209
|
-
1,
|
210
|
-
|
211
|
-
1,
|
212
|
-
1,
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
155
|
+
3, 33, :_reduce_1,
|
156
|
+
1, 33, :_reduce_2,
|
157
|
+
2, 33, :_reduce_3,
|
158
|
+
1, 37, :_reduce_4,
|
159
|
+
1, 37, :_reduce_5,
|
160
|
+
1, 37, :_reduce_6,
|
161
|
+
1, 37, :_reduce_7,
|
162
|
+
1, 37, :_reduce_8,
|
163
|
+
2, 38, :_reduce_9,
|
164
|
+
1, 39, :_reduce_10,
|
165
|
+
2, 40, :_reduce_11,
|
166
|
+
1, 40, :_reduce_none,
|
167
|
+
2, 40, :_reduce_13,
|
168
|
+
2, 40, :_reduce_14,
|
169
|
+
1, 40, :_reduce_15,
|
170
|
+
1, 40, :_reduce_none,
|
171
|
+
2, 35, :_reduce_17,
|
172
|
+
3, 34, :_reduce_18,
|
173
|
+
3, 34, :_reduce_19,
|
174
|
+
1, 34, :_reduce_none,
|
175
|
+
2, 47, :_reduce_21,
|
176
|
+
1, 41, :_reduce_none,
|
177
|
+
1, 41, :_reduce_23,
|
178
|
+
3, 48, :_reduce_24,
|
179
|
+
1, 48, :_reduce_25,
|
180
|
+
1, 49, :_reduce_26,
|
181
|
+
0, 49, :_reduce_none,
|
182
|
+
4, 45, :_reduce_28,
|
183
|
+
4, 45, :_reduce_29,
|
184
|
+
3, 45, :_reduce_30,
|
185
|
+
3, 50, :_reduce_31,
|
186
|
+
1, 50, :_reduce_32,
|
187
|
+
1, 50, :_reduce_none,
|
188
|
+
2, 43, :_reduce_34,
|
189
|
+
3, 43, :_reduce_35,
|
190
|
+
3, 43, :_reduce_36,
|
191
|
+
3, 43, :_reduce_37,
|
192
|
+
3, 43, :_reduce_38,
|
193
|
+
3, 52, :_reduce_39,
|
194
|
+
3, 52, :_reduce_40,
|
195
|
+
3, 52, :_reduce_41,
|
196
|
+
3, 52, :_reduce_42,
|
197
|
+
1, 52, :_reduce_none,
|
198
|
+
1, 52, :_reduce_none,
|
199
|
+
1, 52, :_reduce_45,
|
200
|
+
1, 52, :_reduce_none,
|
201
|
+
4, 53, :_reduce_47,
|
202
|
+
3, 53, :_reduce_48,
|
203
|
+
2, 53, :_reduce_49,
|
204
|
+
2, 44, :_reduce_50,
|
205
|
+
2, 44, :_reduce_51,
|
206
|
+
1, 42, :_reduce_none,
|
207
|
+
0, 42, :_reduce_none,
|
208
|
+
2, 46, :_reduce_54,
|
209
|
+
2, 46, :_reduce_55,
|
210
|
+
2, 46, :_reduce_56,
|
211
|
+
2, 46, :_reduce_57,
|
212
|
+
2, 46, :_reduce_58,
|
213
|
+
1, 46, :_reduce_none,
|
214
|
+
1, 46, :_reduce_none,
|
215
|
+
1, 46, :_reduce_none,
|
216
|
+
1, 46, :_reduce_none,
|
217
|
+
1, 46, :_reduce_none,
|
218
|
+
1, 54, :_reduce_64,
|
219
|
+
2, 51, :_reduce_65,
|
220
|
+
2, 51, :_reduce_66,
|
221
|
+
2, 51, :_reduce_67,
|
222
|
+
0, 51, :_reduce_none,
|
223
|
+
1, 56, :_reduce_69,
|
224
|
+
1, 56, :_reduce_70,
|
225
|
+
1, 56, :_reduce_71,
|
226
|
+
1, 56, :_reduce_72,
|
227
|
+
1, 56, :_reduce_73,
|
228
|
+
1, 56, :_reduce_74,
|
229
|
+
1, 56, :_reduce_75,
|
230
|
+
3, 55, :_reduce_76,
|
231
|
+
1, 57, :_reduce_none,
|
232
|
+
2, 57, :_reduce_none,
|
233
|
+
1, 57, :_reduce_none,
|
234
|
+
1, 36, :_reduce_none,
|
235
|
+
0, 36, :_reduce_none ]
|
236
|
+
|
237
|
+
racc_reduce_n = 82
|
238
|
+
|
239
|
+
racc_shift_n = 119
|
218
240
|
|
219
241
|
racc_token_table = {
|
220
242
|
false => 0,
|
@@ -244,12 +266,13 @@ racc_token_table = {
|
|
244
266
|
:LSQUARE => 24,
|
245
267
|
:RSQUARE => 25,
|
246
268
|
:HAS => 26,
|
247
|
-
"
|
248
|
-
"
|
249
|
-
"
|
250
|
-
"
|
269
|
+
"@" => 27,
|
270
|
+
"." => 28,
|
271
|
+
"*" => 29,
|
272
|
+
"|" => 30,
|
273
|
+
":" => 31 }
|
251
274
|
|
252
|
-
racc_nt_base =
|
275
|
+
racc_nt_base = 32
|
253
276
|
|
254
277
|
racc_use_result_var = true
|
255
278
|
|
@@ -297,6 +320,7 @@ Racc_token_to_s_table = [
|
|
297
320
|
"LSQUARE",
|
298
321
|
"RSQUARE",
|
299
322
|
"HAS",
|
323
|
+
"\"@\"",
|
300
324
|
"\".\"",
|
301
325
|
"\"*\"",
|
302
326
|
"\"|\"",
|
@@ -307,6 +331,8 @@ Racc_token_to_s_table = [
|
|
307
331
|
"prefixless_combinator_selector",
|
308
332
|
"optional_S",
|
309
333
|
"combinator",
|
334
|
+
"xpath_attribute_name",
|
335
|
+
"xpath_attribute",
|
310
336
|
"simple_selector",
|
311
337
|
"element_name",
|
312
338
|
"hcap_0toN",
|
@@ -333,7 +359,7 @@ Racc_debug_parser = false
|
|
333
359
|
# reduce 0 omitted
|
334
360
|
|
335
361
|
def _reduce_1(val, _values, result)
|
336
|
-
|
362
|
+
result = [val[0], val[2]].flatten
|
337
363
|
|
338
364
|
result
|
339
365
|
end
|
@@ -344,7 +370,7 @@ def _reduce_2(val, _values, result)
|
|
344
370
|
end
|
345
371
|
|
346
372
|
def _reduce_3(val, _values, result)
|
347
|
-
result = [val
|
373
|
+
result = [val[1]].flatten
|
348
374
|
result
|
349
375
|
end
|
350
376
|
|
@@ -374,373 +400,366 @@ def _reduce_8(val, _values, result)
|
|
374
400
|
end
|
375
401
|
|
376
402
|
def _reduce_9(val, _values, result)
|
377
|
-
|
378
|
-
val.first
|
379
|
-
else
|
380
|
-
Node.new(:CONDITIONAL_SELECTOR, [val.first, val[1]])
|
381
|
-
end
|
382
|
-
|
403
|
+
result = val[1]
|
383
404
|
result
|
384
405
|
end
|
385
406
|
|
386
|
-
|
387
|
-
|
388
|
-
def _reduce_11(val, _values, result)
|
389
|
-
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
390
|
-
|
407
|
+
def _reduce_10(val, _values, result)
|
408
|
+
result = Node.new(:ATTRIB_NAME, [val[0]])
|
391
409
|
result
|
392
410
|
end
|
393
411
|
|
394
|
-
def
|
395
|
-
|
412
|
+
def _reduce_11(val, _values, result)
|
413
|
+
result = if val[1].nil?
|
414
|
+
val[0]
|
415
|
+
else
|
416
|
+
Node.new(:CONDITIONAL_SELECTOR, [val[0], val[1]])
|
417
|
+
end
|
396
418
|
|
397
419
|
result
|
398
420
|
end
|
399
421
|
|
400
|
-
|
401
|
-
result = Node.new(:CONDITIONAL_SELECTOR,
|
402
|
-
[Node.new(:ELEMENT_NAME, ['*']), val.first]
|
403
|
-
)
|
422
|
+
# reduce 12 omitted
|
404
423
|
|
424
|
+
def _reduce_13(val, _values, result)
|
425
|
+
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
405
426
|
result
|
406
427
|
end
|
407
428
|
|
408
429
|
def _reduce_14(val, _values, result)
|
409
|
-
|
410
|
-
|
430
|
+
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
411
431
|
result
|
412
432
|
end
|
413
433
|
|
414
434
|
def _reduce_15(val, _values, result)
|
415
|
-
|
435
|
+
result = Node.new(:CONDITIONAL_SELECTOR, [Node.new(:ELEMENT_NAME, ['*']), val[0]])
|
436
|
+
result
|
437
|
+
end
|
438
|
+
|
439
|
+
# reduce 16 omitted
|
416
440
|
|
441
|
+
def _reduce_17(val, _values, result)
|
442
|
+
result = Node.new(val[0], [nil, val[1]])
|
417
443
|
result
|
418
444
|
end
|
419
445
|
|
420
|
-
def
|
421
|
-
|
446
|
+
def _reduce_18(val, _values, result)
|
447
|
+
result = Node.new(val[1], [val[0], val[2]])
|
448
|
+
result
|
449
|
+
end
|
422
450
|
|
451
|
+
def _reduce_19(val, _values, result)
|
452
|
+
result = Node.new(:DESCENDANT_SELECTOR, [val[0], val[2]])
|
423
453
|
result
|
424
454
|
end
|
425
455
|
|
426
|
-
# reduce
|
456
|
+
# reduce 20 omitted
|
427
457
|
|
428
|
-
def
|
458
|
+
def _reduce_21(val, _values, result)
|
429
459
|
result = Node.new(:CLASS_CONDITION, [unescape_css_identifier(val[1])])
|
430
460
|
result
|
431
461
|
end
|
432
462
|
|
433
|
-
# reduce
|
463
|
+
# reduce 22 omitted
|
434
464
|
|
435
|
-
def
|
465
|
+
def _reduce_23(val, _values, result)
|
436
466
|
result = Node.new(:ELEMENT_NAME, val)
|
437
467
|
result
|
438
468
|
end
|
439
469
|
|
440
|
-
def
|
441
|
-
|
442
|
-
[[val.first, val.last].compact.join(':')]
|
443
|
-
)
|
444
|
-
|
470
|
+
def _reduce_24(val, _values, result)
|
471
|
+
result = Node.new(:ELEMENT_NAME, [[val[0], val[2]].compact.join(':')])
|
445
472
|
result
|
446
473
|
end
|
447
474
|
|
448
|
-
def
|
449
|
-
|
450
|
-
|
475
|
+
def _reduce_25(val, _values, result)
|
476
|
+
name = @namespaces.key?('xmlns') ? "xmlns:#{val[0]}" : val[0]
|
477
|
+
result = Node.new(:ELEMENT_NAME, [name])
|
451
478
|
|
452
479
|
result
|
453
480
|
end
|
454
481
|
|
455
|
-
def
|
482
|
+
def _reduce_26(val, _values, result)
|
456
483
|
result = val[0]
|
457
484
|
result
|
458
485
|
end
|
459
486
|
|
460
|
-
# reduce
|
487
|
+
# reduce 27 omitted
|
461
488
|
|
462
|
-
def
|
463
|
-
|
464
|
-
[val[1]] + (val[2] || [])
|
465
|
-
)
|
489
|
+
def _reduce_28(val, _values, result)
|
490
|
+
result = Node.new(:ATTRIBUTE_CONDITION, [val[1]] + (val[2] || []))
|
466
491
|
|
467
492
|
result
|
468
493
|
end
|
469
494
|
|
470
|
-
def
|
471
|
-
|
472
|
-
[val[1]] + (val[2] || [])
|
473
|
-
)
|
495
|
+
def _reduce_29(val, _values, result)
|
496
|
+
result = Node.new(:ATTRIBUTE_CONDITION, [val[1]] + (val[2] || []))
|
474
497
|
|
475
498
|
result
|
476
499
|
end
|
477
500
|
|
478
|
-
def
|
479
|
-
|
480
|
-
result = Node.new(:PSEUDO_CLASS,
|
481
|
-
[Node.new(:FUNCTION, ['nth-child(', val[1]])]
|
482
|
-
)
|
501
|
+
def _reduce_30(val, _values, result)
|
502
|
+
result = Node.new(:PSEUDO_CLASS, [Node.new(:FUNCTION, ['nth-child(', val[1]])])
|
483
503
|
|
484
504
|
result
|
485
505
|
end
|
486
506
|
|
487
|
-
def
|
488
|
-
|
489
|
-
|
490
|
-
|
507
|
+
def _reduce_31(val, _values, result)
|
508
|
+
result = Node.new(:ATTRIB_NAME, [[val[0], val[2]].compact.join(':')])
|
509
|
+
result
|
510
|
+
end
|
491
511
|
|
512
|
+
def _reduce_32(val, _values, result)
|
513
|
+
result = Node.new(:ATTRIB_NAME, [val[0]])
|
492
514
|
result
|
493
515
|
end
|
494
516
|
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
517
|
+
# reduce 33 omitted
|
518
|
+
|
519
|
+
def _reduce_34(val, _values, result)
|
520
|
+
result = Node.new(:FUNCTION, [val[0].strip])
|
499
521
|
|
500
522
|
result
|
501
523
|
end
|
502
524
|
|
503
|
-
def
|
504
|
-
|
525
|
+
def _reduce_35(val, _values, result)
|
526
|
+
result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
|
505
527
|
|
506
528
|
result
|
507
529
|
end
|
508
530
|
|
509
|
-
def
|
510
|
-
|
531
|
+
def _reduce_36(val, _values, result)
|
532
|
+
result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
|
511
533
|
|
512
534
|
result
|
513
535
|
end
|
514
536
|
|
515
|
-
def
|
516
|
-
|
537
|
+
def _reduce_37(val, _values, result)
|
538
|
+
result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
|
517
539
|
|
518
540
|
result
|
519
541
|
end
|
520
542
|
|
521
|
-
def
|
522
|
-
|
543
|
+
def _reduce_38(val, _values, result)
|
544
|
+
result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
|
523
545
|
|
524
546
|
result
|
525
547
|
end
|
526
548
|
|
527
|
-
def
|
528
|
-
|
529
|
-
|
549
|
+
def _reduce_39(val, _values, result)
|
550
|
+
result = [val[0], val[2]]
|
530
551
|
result
|
531
552
|
end
|
532
553
|
|
533
|
-
def
|
534
|
-
result = [val
|
554
|
+
def _reduce_40(val, _values, result)
|
555
|
+
result = [val[0], val[2]]
|
535
556
|
result
|
536
557
|
end
|
537
558
|
|
538
|
-
def
|
539
|
-
result = [val
|
559
|
+
def _reduce_41(val, _values, result)
|
560
|
+
result = [val[0], val[2]]
|
540
561
|
result
|
541
562
|
end
|
542
563
|
|
543
|
-
def
|
544
|
-
result = [val
|
564
|
+
def _reduce_42(val, _values, result)
|
565
|
+
result = [val[0], val[2]]
|
545
566
|
result
|
546
567
|
end
|
547
568
|
|
548
|
-
# reduce
|
569
|
+
# reduce 43 omitted
|
549
570
|
|
550
|
-
# reduce
|
571
|
+
# reduce 44 omitted
|
551
572
|
|
552
|
-
def
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
# assert_xpath("//a[foo(., @a, b)]", @parser.parse('a:foo(@a, b)'))
|
564
|
-
# assert_xpath("//a[foo(., a, 10)]", @parser.parse('a:foo(a, 10)'))
|
565
|
-
result = val
|
566
|
-
end
|
573
|
+
def _reduce_45(val, _values, result)
|
574
|
+
case val[0]
|
575
|
+
when 'even'
|
576
|
+
result = Node.new(:NTH, ['2','n','+','0'])
|
577
|
+
when 'odd'
|
578
|
+
result = Node.new(:NTH, ['2','n','+','1'])
|
579
|
+
when 'n'
|
580
|
+
result = Node.new(:NTH, ['1','n','+','0'])
|
581
|
+
else
|
582
|
+
result = val
|
583
|
+
end
|
567
584
|
|
568
585
|
result
|
569
586
|
end
|
570
587
|
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
588
|
+
# reduce 46 omitted
|
589
|
+
|
590
|
+
def _reduce_47(val, _values, result)
|
591
|
+
if val[1] == 'n'
|
592
|
+
result = Node.new(:NTH, val)
|
593
|
+
else
|
594
|
+
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
595
|
+
end
|
577
596
|
|
578
597
|
result
|
579
598
|
end
|
580
599
|
|
581
|
-
def
|
600
|
+
def _reduce_48(val, _values, result)
|
582
601
|
# n+3, -n+3
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
602
|
+
if val[0] == 'n'
|
603
|
+
val.unshift("1")
|
604
|
+
result = Node.new(:NTH, val)
|
605
|
+
elsif val[0] == '-n'
|
606
|
+
val[0] = 'n'
|
607
|
+
val.unshift("-1")
|
608
|
+
result = Node.new(:NTH, val)
|
609
|
+
else
|
610
|
+
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
611
|
+
end
|
593
612
|
|
594
613
|
result
|
595
614
|
end
|
596
615
|
|
597
|
-
def
|
616
|
+
def _reduce_49(val, _values, result)
|
598
617
|
# 5n, -5n, 10n-1
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
618
|
+
n = val[1]
|
619
|
+
if n[0, 2] == 'n-'
|
620
|
+
val[1] = 'n'
|
621
|
+
val << "-"
|
622
|
+
# b is contained in n as n is the string "n-b"
|
623
|
+
val << n[2, n.size]
|
624
|
+
result = Node.new(:NTH, val)
|
625
|
+
elsif n == 'n'
|
626
|
+
val << "+"
|
627
|
+
val << "0"
|
628
|
+
result = Node.new(:NTH, val)
|
629
|
+
else
|
630
|
+
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
631
|
+
end
|
613
632
|
|
614
633
|
result
|
615
634
|
end
|
616
635
|
|
617
|
-
def
|
618
|
-
|
636
|
+
def _reduce_50(val, _values, result)
|
637
|
+
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
619
638
|
|
620
639
|
result
|
621
640
|
end
|
622
641
|
|
623
|
-
def
|
642
|
+
def _reduce_51(val, _values, result)
|
624
643
|
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
625
644
|
result
|
626
645
|
end
|
627
646
|
|
628
|
-
# reduce
|
647
|
+
# reduce 52 omitted
|
629
648
|
|
630
|
-
# reduce
|
649
|
+
# reduce 53 omitted
|
631
650
|
|
632
|
-
def
|
633
|
-
|
651
|
+
def _reduce_54(val, _values, result)
|
652
|
+
result = Node.new(:COMBINATOR, val)
|
634
653
|
|
635
654
|
result
|
636
655
|
end
|
637
656
|
|
638
|
-
def
|
639
|
-
|
657
|
+
def _reduce_55(val, _values, result)
|
658
|
+
result = Node.new(:COMBINATOR, val)
|
640
659
|
|
641
660
|
result
|
642
661
|
end
|
643
662
|
|
644
|
-
def
|
645
|
-
|
663
|
+
def _reduce_56(val, _values, result)
|
664
|
+
result = Node.new(:COMBINATOR, val)
|
646
665
|
|
647
666
|
result
|
648
667
|
end
|
649
668
|
|
650
|
-
def
|
651
|
-
|
669
|
+
def _reduce_57(val, _values, result)
|
670
|
+
result = Node.new(:COMBINATOR, val)
|
652
671
|
|
653
672
|
result
|
654
673
|
end
|
655
674
|
|
656
|
-
def
|
657
|
-
|
675
|
+
def _reduce_58(val, _values, result)
|
676
|
+
result = Node.new(:COMBINATOR, val)
|
658
677
|
|
659
678
|
result
|
660
679
|
end
|
661
680
|
|
662
|
-
# reduce
|
681
|
+
# reduce 59 omitted
|
663
682
|
|
664
|
-
# reduce
|
683
|
+
# reduce 60 omitted
|
665
684
|
|
666
|
-
# reduce
|
685
|
+
# reduce 61 omitted
|
667
686
|
|
668
|
-
# reduce
|
687
|
+
# reduce 62 omitted
|
669
688
|
|
670
|
-
# reduce
|
689
|
+
# reduce 63 omitted
|
671
690
|
|
672
|
-
def
|
673
|
-
result = Node.new(:ID, [unescape_css_identifier(val
|
691
|
+
def _reduce_64(val, _values, result)
|
692
|
+
result = Node.new(:ID, [unescape_css_identifier(val[0])])
|
674
693
|
result
|
675
694
|
end
|
676
695
|
|
677
|
-
def
|
678
|
-
result = [val
|
696
|
+
def _reduce_65(val, _values, result)
|
697
|
+
result = [val[0], unescape_css_identifier(val[1])]
|
679
698
|
result
|
680
699
|
end
|
681
700
|
|
682
|
-
def
|
683
|
-
result = [val
|
701
|
+
def _reduce_66(val, _values, result)
|
702
|
+
result = [val[0], unescape_css_string(val[1])]
|
684
703
|
result
|
685
704
|
end
|
686
705
|
|
687
|
-
def
|
688
|
-
result = [val
|
706
|
+
def _reduce_67(val, _values, result)
|
707
|
+
result = [val[0], val[1]]
|
689
708
|
result
|
690
709
|
end
|
691
710
|
|
692
|
-
# reduce
|
711
|
+
# reduce 68 omitted
|
693
712
|
|
694
|
-
def
|
713
|
+
def _reduce_69(val, _values, result)
|
695
714
|
result = :equal
|
696
715
|
result
|
697
716
|
end
|
698
717
|
|
699
|
-
def
|
718
|
+
def _reduce_70(val, _values, result)
|
700
719
|
result = :prefix_match
|
701
720
|
result
|
702
721
|
end
|
703
722
|
|
704
|
-
def
|
723
|
+
def _reduce_71(val, _values, result)
|
705
724
|
result = :suffix_match
|
706
725
|
result
|
707
726
|
end
|
708
727
|
|
709
|
-
def
|
728
|
+
def _reduce_72(val, _values, result)
|
710
729
|
result = :substring_match
|
711
730
|
result
|
712
731
|
end
|
713
732
|
|
714
|
-
def
|
733
|
+
def _reduce_73(val, _values, result)
|
715
734
|
result = :not_equal
|
716
735
|
result
|
717
736
|
end
|
718
737
|
|
719
|
-
def
|
738
|
+
def _reduce_74(val, _values, result)
|
720
739
|
result = :includes
|
721
740
|
result
|
722
741
|
end
|
723
742
|
|
724
|
-
def
|
743
|
+
def _reduce_75(val, _values, result)
|
725
744
|
result = :dash_match
|
726
745
|
result
|
727
746
|
end
|
728
747
|
|
729
|
-
def
|
730
|
-
|
748
|
+
def _reduce_76(val, _values, result)
|
749
|
+
result = Node.new(:NOT, [val[1]])
|
731
750
|
|
732
751
|
result
|
733
752
|
end
|
734
753
|
|
735
|
-
# reduce
|
754
|
+
# reduce 77 omitted
|
736
755
|
|
737
|
-
# reduce
|
756
|
+
# reduce 78 omitted
|
738
757
|
|
739
|
-
# reduce
|
758
|
+
# reduce 79 omitted
|
740
759
|
|
741
|
-
# reduce
|
760
|
+
# reduce 80 omitted
|
742
761
|
|
743
|
-
# reduce
|
762
|
+
# reduce 81 omitted
|
744
763
|
|
745
764
|
def _reduce_none(val, _values, result)
|
746
765
|
val[0]
|