nokogiri 1.6.1-java → 1.6.2-java
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/.editorconfig +17 -0
- data/.travis.yml +6 -6
- data/CHANGELOG.ja.rdoc +61 -8
- data/CHANGELOG.rdoc +58 -3
- data/Gemfile +3 -3
- data/Manifest.txt +57 -1
- data/README.ja.rdoc +22 -17
- data/README.rdoc +23 -18
- data/ROADMAP.md +1 -2
- data/Rakefile +162 -58
- data/build_all +56 -31
- data/dependencies.yml +3 -3
- data/ext/java/nokogiri/NokogiriService.java +9 -5
- data/ext/java/nokogiri/XmlDocument.java +95 -54
- data/ext/java/nokogiri/XmlNode.java +93 -42
- data/ext/java/nokogiri/XmlReader.java +1 -1
- data/ext/java/nokogiri/XmlSaxParserContext.java +33 -0
- data/ext/java/nokogiri/XmlSchema.java +4 -2
- data/ext/java/nokogiri/XmlXpathContext.java +118 -76
- data/ext/java/nokogiri/internals/IgnoreSchemaErrorsErrorHandler.java +20 -0
- data/ext/java/nokogiri/internals/NokogiriHandler.java +3 -10
- data/ext/java/nokogiri/internals/NokogiriHelpers.java +40 -23
- data/ext/java/nokogiri/internals/NokogiriNamespaceCache.java +59 -54
- data/ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java +1 -1
- data/ext/java/nokogiri/internals/ParserContext.java +1 -4
- data/ext/java/nokogiri/internals/SaveContextVisitor.java +6 -2
- data/ext/java/nokogiri/internals/c14n/AttrCompare.java +119 -0
- data/ext/java/nokogiri/internals/c14n/C14nHelper.java +159 -0
- data/ext/java/nokogiri/internals/c14n/CanonicalFilter.java +37 -0
- data/ext/java/nokogiri/internals/c14n/CanonicalizationException.java +93 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer.java +252 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer11.java +639 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer11_OmitComments.java +38 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer11_WithComments.java +38 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315.java +368 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315Excl.java +295 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315ExclOmitComments.java +40 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315ExclWithComments.java +44 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315OmitComments.java +44 -0
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315WithComments.java +43 -0
- data/ext/java/nokogiri/internals/c14n/CanonicalizerBase.java +630 -0
- data/ext/java/nokogiri/internals/c14n/CanonicalizerPhysical.java +173 -0
- data/ext/java/nokogiri/internals/c14n/CanonicalizerSpi.java +76 -0
- data/ext/java/nokogiri/internals/c14n/Constants.java +42 -0
- data/ext/java/nokogiri/internals/c14n/ElementProxy.java +293 -0
- data/ext/java/nokogiri/internals/c14n/HelperNodeList.java +93 -0
- data/ext/java/nokogiri/internals/c14n/IgnoreAllErrorHandler.java +79 -0
- data/ext/java/nokogiri/internals/c14n/InclusiveNamespaces.java +165 -0
- data/ext/java/nokogiri/internals/c14n/InvalidCanonicalizerException.java +76 -0
- data/ext/java/nokogiri/internals/c14n/NameSpaceSymbTable.java +402 -0
- data/ext/java/nokogiri/internals/c14n/NodeFilter.java +51 -0
- data/ext/java/nokogiri/internals/c14n/UtfHelpper.java +179 -0
- data/ext/java/nokogiri/internals/c14n/XMLUtils.java +507 -0
- data/ext/nokogiri/extconf.rb +429 -128
- data/ext/nokogiri/html_document.c +2 -2
- data/ext/nokogiri/nokogiri.c +6 -1
- data/ext/nokogiri/xml_document.c +5 -4
- data/ext/nokogiri/xml_node.c +76 -7
- data/ext/nokogiri/xml_reader.c +1 -1
- data/ext/nokogiri/xml_sax_parser_context.c +40 -0
- data/ext/nokogiri/xml_syntax_error.c +10 -5
- data/ext/nokogiri/xml_syntax_error.h +1 -1
- data/ext/nokogiri/xml_xpath_context.c +2 -14
- data/ext/nokogiri/xslt_stylesheet.c +1 -1
- data/lib/nokogiri.rb +31 -22
- data/lib/nokogiri/css/node.rb +0 -50
- data/lib/nokogiri/css/parser.rb +213 -218
- data/lib/nokogiri/css/parser.y +21 -30
- data/lib/nokogiri/css/xpath_visitor.rb +62 -14
- data/lib/nokogiri/html/document.rb +97 -18
- data/lib/nokogiri/html/sax/parser.rb +2 -2
- data/lib/nokogiri/nokogiri.jar +0 -0
- data/lib/nokogiri/version.rb +1 -1
- data/lib/nokogiri/xml/builder.rb +1 -1
- data/lib/nokogiri/xml/document.rb +2 -2
- data/lib/nokogiri/xml/dtd.rb +10 -0
- data/lib/nokogiri/xml/node.rb +26 -1
- data/lib/nokogiri/xml/sax/parser.rb +1 -1
- data/ports/patches/libxml2/0001-Fix-parser-local-buffers-size-problems.patch +265 -0
- data/ports/patches/libxml2/0002-Fix-entities-local-buffers-size-problems.patch +102 -0
- data/ports/patches/libxml2/0003-Fix-an-error-in-previous-commit.patch +26 -0
- data/ports/patches/libxml2/0004-Fix-potential-out-of-bound-access.patch +26 -0
- data/ports/patches/libxml2/0005-Detect-excessive-entities-expansion-upon-replacement.patch +158 -0
- data/ports/patches/libxml2/0006-Do-not-fetch-external-parsed-entities.patch +78 -0
- data/ports/patches/libxml2/0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch +480 -0
- data/ports/patches/libxml2/0008-Improve-handling-of-xmlStopParser.patch +315 -0
- data/ports/patches/libxml2/0009-Fix-a-couple-of-return-without-value.patch +37 -0
- data/ports/patches/libxslt/0001-Adding-doc-update-related-to-1.1.28.patch +222 -0
- data/ports/patches/libxslt/0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch +53 -0
- data/ports/patches/libxslt/0003-Initialize-pseudo-random-number-generator-with-curre.patch +60 -0
- data/ports/patches/libxslt/0004-EXSLT-function-str-replace-is-broken-as-is.patch +42 -0
- data/ports/patches/libxslt/0006-Fix-str-padding-to-work-with-UTF-8-strings.patch +164 -0
- data/ports/patches/libxslt/0007-Separate-function-for-predicate-matching-in-patterns.patch +587 -0
- data/ports/patches/libxslt/0008-Fix-direct-pattern-matching.patch +80 -0
- data/ports/patches/libxslt/0009-Fix-certain-patterns-with-predicates.patch +185 -0
- data/ports/patches/libxslt/0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch +126 -0
- data/ports/patches/libxslt/0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch +25 -0
- data/ports/patches/libxslt/0014-Fix-for-bug-436589.patch +43 -0
- data/ports/patches/libxslt/0015-Fix-mkdir-for-mingw.patch +41 -0
- data/suppressions/README.txt +1 -0
- data/suppressions/nokogiri_ree-1.8.7.358.supp +61 -0
- data/suppressions/nokogiri_ruby-1.8.7.370.supp +0 -0
- data/suppressions/nokogiri_ruby-1.9.2.320.supp +28 -0
- data/suppressions/nokogiri_ruby-1.9.3.327.supp +28 -0
- data/test/css/test_nthiness.rb +65 -2
- data/test/css/test_parser.rb +27 -10
- data/test/css/test_tokenizer.rb +1 -1
- data/test/css/test_xpath_visitor.rb +6 -1
- data/test/files/atom.xml +344 -0
- data/test/files/shift_jis_no_charset.html +9 -0
- data/test/helper.rb +10 -0
- data/test/html/test_document.rb +74 -7
- data/test/html/test_document_encoding.rb +10 -0
- data/test/html/test_document_fragment.rb +9 -3
- data/test/namespaces/test_namespaces_aliased_default.rb +24 -0
- data/test/namespaces/test_namespaces_in_cloned_doc.rb +31 -0
- data/test/namespaces/test_namespaces_preservation.rb +31 -0
- data/test/test_nokogiri.rb +6 -0
- data/test/test_reader.rb +7 -4
- data/test/test_xslt_transforms.rb +25 -0
- data/test/xml/sax/test_parser.rb +16 -0
- data/test/xml/sax/test_parser_context.rb +9 -0
- data/test/xml/test_builder.rb +9 -0
- data/test/xml/test_c14n.rb +12 -2
- data/test/xml/test_document.rb +66 -0
- data/test/xml/test_document_fragment.rb +5 -0
- data/test/xml/test_dtd.rb +84 -0
- data/test/xml/test_entity_reference.rb +3 -3
- data/test/xml/test_node.rb +21 -3
- data/test/xml/test_node_attributes.rb +17 -0
- data/test/xml/test_schema.rb +26 -0
- data/test/xml/test_text.rb +15 -0
- data/test/xml/test_xpath.rb +87 -0
- data/test_all +3 -3
- metadata +119 -68
- data/tasks/cross_compile.rb +0 -134
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.9
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -14,96 +14,104 @@ module Nokogiri
|
|
14
14
|
##### State transition tables begin ###
|
15
15
|
|
16
16
|
racc_action_table = [
|
17
|
-
21,
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
24,
|
27
|
-
|
28
|
-
20,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
17
|
+
21, 31, 20, 32, 30, 4, 5, 7, 24, 19,
|
18
|
+
92, 21, 90, 32, 95, 6, 91, 9, 8, 22,
|
19
|
+
62, 90, 20, 85, 23, 15, 17, 21, 24, -23,
|
20
|
+
47, 30, 4, 5, 7, 23, 19, 52, 84, 21,
|
21
|
+
56, 89, 6, 30, 9, 8, 22, 83, 19, 20,
|
22
|
+
21, 23, 15, 17, 30, 24, 98, 97, 22, 19,
|
23
|
+
68, 20, 21, 23, 15, 17, 30, 24, 86, 22,
|
24
|
+
87, 19, 20, 93, 23, 15, 17, 30, 24, 30,
|
25
|
+
82, 22, 52, 84, 20, 56, 23, 15, 17, -23,
|
26
|
+
24, 30, 35, 30, 35, 20, 19, 20, 15, 96,
|
27
|
+
15, 24, -23, 24, 30, 99, 35, 21, 35, 20,
|
28
|
+
100, 20, 15, 17, 15, 24, 42, 24, 45, 35,
|
29
|
+
30, 30, 20, 88, 87, 15, 47, 90, 24, 71,
|
30
|
+
102, 23, 30, 40, 41, 35, 35, 105, 20, 20,
|
31
|
+
106, 15, 15, nil, 24, 24, nil, 35, nil, nil,
|
32
|
+
20, 79, 80, 15, 30, nil, 24, nil, 52, 54,
|
33
|
+
nil, 56, 75, 76, 77, nil, 78, nil, nil, 35,
|
34
|
+
74, nil, 20, 79, 80, 15, 17, nil, 24, nil,
|
35
|
+
52, 53, nil, 51, 75, 76, 77, nil, 78, 4,
|
36
|
+
5, 7, 74, 48, 52, 84, nil, 56, nil, 6,
|
37
|
+
nil, 9, 8, 52, 84, nil, 56 ]
|
34
38
|
|
35
39
|
racc_action_check = [
|
36
|
-
0,
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
27,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
40
|
+
0, 1, 11, 60, 0, 0, 0, 0, 11, 0,
|
41
|
+
55, 24, 54, 1, 60, 0, 53, 0, 0, 0,
|
42
|
+
24, 53, 0, 49, 0, 0, 0, 23, 0, 54,
|
43
|
+
24, 23, 23, 23, 23, 24, 23, 89, 89, 13,
|
44
|
+
89, 52, 23, 13, 23, 23, 23, 46, 13, 23,
|
45
|
+
39, 23, 23, 23, 39, 23, 73, 73, 13, 39,
|
46
|
+
31, 13, 32, 13, 13, 13, 32, 13, 50, 39,
|
47
|
+
56, 32, 39, 57, 39, 39, 39, 27, 39, 28,
|
48
|
+
45, 32, 47, 47, 32, 47, 32, 32, 32, 19,
|
49
|
+
32, 35, 27, 10, 28, 27, 35, 28, 27, 72,
|
50
|
+
28, 27, 42, 28, 29, 81, 35, 20, 10, 35,
|
51
|
+
83, 10, 35, 35, 10, 35, 20, 10, 20, 29,
|
52
|
+
26, 58, 29, 51, 51, 29, 20, 84, 29, 41,
|
53
|
+
88, 20, 25, 15, 18, 26, 58, 91, 26, 58,
|
54
|
+
102, 26, 58, nil, 26, 58, nil, 25, nil, nil,
|
55
|
+
25, 43, 43, 25, 22, nil, 25, nil, 22, 22,
|
56
|
+
nil, 22, 43, 43, 43, nil, 43, nil, nil, 22,
|
57
|
+
43, nil, 22, 44, 44, 22, 22, nil, 22, nil,
|
58
|
+
21, 21, nil, 21, 44, 44, 44, nil, 44, 14,
|
59
|
+
14, 14, 44, 21, 87, 87, nil, 87, nil, 14,
|
60
|
+
nil, 14, 14, 90, 90, nil, 90 ]
|
53
61
|
|
54
62
|
racc_action_pointer = [
|
55
|
-
-2,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
nil, nil, nil, nil, nil, nil, nil,
|
62
|
-
nil, nil,
|
63
|
-
nil,
|
64
|
-
|
65
|
-
nil,
|
63
|
+
-2, 1, nil, nil, nil, nil, nil, nil, nil, nil,
|
64
|
+
87, -22, nil, 37, 182, 122, nil, nil, 105, 60,
|
65
|
+
105, 170, 148, 25, 9, 126, 114, 71, 73, 98,
|
66
|
+
nil, 60, 60, nil, nil, 85, nil, nil, nil, 48,
|
67
|
+
nil, 118, 73, 148, 170, 55, 18, 72, nil, 0,
|
68
|
+
45, 112, 29, 9, 0, -13, 58, 50, 115, nil,
|
69
|
+
-9, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
70
|
+
nil, nil, 74, 46, nil, nil, nil, nil, nil, nil,
|
71
|
+
nil, 80, nil, 99, 115, nil, nil, 184, 123, 27,
|
72
|
+
193, 124, nil, nil, nil, nil, nil, nil, nil, nil,
|
73
|
+
nil, nil, 127, nil, nil, nil, nil ]
|
66
74
|
|
67
75
|
racc_action_default = [
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
76
|
+
-24, -73, -2, -3, -4, -5, -6, -7, -8, -9,
|
77
|
+
-47, -11, -14, -24, -17, -73, -19, -20, -73, -22,
|
78
|
+
-24, -73, -24, -24, -73, -53, -54, -55, -56, -57,
|
79
|
+
-58, -73, -24, -10, -46, -24, -12, -13, -15, -24,
|
80
|
+
-18, -73, -29, -61, -61, -73, -73, -73, -30, -73,
|
81
|
+
-73, -38, -39, -40, -22, -73, -38, -73, -70, -72,
|
82
|
+
-73, -44, -45, -48, -49, -50, -51, -52, 107, -1,
|
83
|
+
-16, -21, -73, -73, -62, -63, -64, -65, -66, -67,
|
84
|
+
-68, -73, -27, -73, -40, -31, -32, -73, -43, -73,
|
85
|
+
-73, -73, -33, -69, -71, -34, -25, -59, -60, -26,
|
86
|
+
-28, -35, -73, -36, -37, -42, -41 ]
|
79
87
|
|
80
88
|
racc_goto_table = [
|
81
|
-
49,
|
82
|
-
|
83
|
-
|
84
|
-
70, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
89
|
+
49, 34, 38, 44, 1, 72, 81, 61, 37, 58,
|
90
|
+
36, 46, 43, 59, 33, 39, 63, 64, 65, 66,
|
91
|
+
67, 69, 58, 50, nil, nil, 59, 60, 70, nil,
|
85
92
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
93
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 94,
|
86
94
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
87
|
-
|
95
|
+
nil, nil, nil, nil, nil, nil, 101, nil, 103, 104 ]
|
88
96
|
|
89
97
|
racc_goto_check = [
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
2, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
98
|
+
17, 11, 2, 8, 1, 16, 16, 8, 10, 6,
|
99
|
+
9, 14, 15, 11, 7, 4, 11, 11, 11, 11,
|
100
|
+
11, 2, 6, 18, nil, nil, 11, 1, 2, nil,
|
94
101
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
102
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 11,
|
95
103
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
96
|
-
|
104
|
+
nil, nil, nil, nil, nil, nil, 17, nil, 17, 17 ]
|
97
105
|
|
98
106
|
racc_goto_pointer = [
|
99
|
-
nil,
|
100
|
-
|
101
|
-
nil, nil,
|
107
|
+
nil, 4, -11, nil, 1, nil, -13, 4, -17, -1,
|
108
|
+
-3, -9, nil, nil, -9, -8, -38, -21, 2, nil,
|
109
|
+
nil, nil, nil ]
|
102
110
|
|
103
111
|
racc_goto_default = [
|
104
|
-
nil, nil, 3, 2, 13, 14, 10, nil,
|
105
|
-
|
106
|
-
|
112
|
+
nil, nil, 3, 2, 13, 14, 10, nil, 11, 28,
|
113
|
+
27, 12, 26, 16, 18, nil, nil, 55, nil, 25,
|
114
|
+
29, 73, 57 ]
|
107
115
|
|
108
116
|
racc_reduce_table = [
|
109
117
|
0, 0, :racc_error,
|
@@ -117,73 +125,72 @@ racc_reduce_table = [
|
|
117
125
|
1, 35, :_reduce_8,
|
118
126
|
1, 35, :_reduce_9,
|
119
127
|
2, 36, :_reduce_10,
|
120
|
-
3, 36, :_reduce_11,
|
121
|
-
2, 36, :_reduce_12,
|
122
128
|
1, 36, :_reduce_none,
|
123
|
-
2, 36, :
|
124
|
-
2, 36, :
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
3, 33, :_reduce_19,
|
129
|
+
2, 36, :_reduce_12,
|
130
|
+
2, 36, :_reduce_13,
|
131
|
+
1, 36, :_reduce_14,
|
132
|
+
2, 34, :_reduce_15,
|
133
|
+
3, 33, :_reduce_16,
|
129
134
|
1, 33, :_reduce_none,
|
130
|
-
2,
|
135
|
+
2, 43, :_reduce_18,
|
131
136
|
1, 37, :_reduce_none,
|
132
|
-
1, 37, :
|
133
|
-
3,
|
134
|
-
1,
|
135
|
-
1,
|
136
|
-
0,
|
137
|
-
4,
|
138
|
-
4,
|
139
|
-
3,
|
140
|
-
3,
|
141
|
-
1,
|
142
|
-
2,
|
143
|
-
3,
|
144
|
-
3,
|
145
|
-
3,
|
146
|
-
3,
|
147
|
-
3,
|
148
|
-
3,
|
149
|
-
3,
|
150
|
-
1,
|
151
|
-
1,
|
152
|
-
1,
|
153
|
-
4,
|
154
|
-
3,
|
155
|
-
2,
|
156
|
-
2,
|
157
|
-
2,
|
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,
|
158
163
|
1, 38, :_reduce_none,
|
159
164
|
0, 38, :_reduce_none,
|
160
|
-
2,
|
161
|
-
2,
|
162
|
-
2,
|
163
|
-
2,
|
164
|
-
|
165
|
-
1,
|
166
|
-
1,
|
167
|
-
1,
|
168
|
-
1,
|
169
|
-
|
170
|
-
|
171
|
-
|
165
|
+
2, 42, :_reduce_48,
|
166
|
+
2, 42, :_reduce_49,
|
167
|
+
2, 42, :_reduce_50,
|
168
|
+
2, 42, :_reduce_51,
|
169
|
+
2, 42, :_reduce_52,
|
170
|
+
1, 42, :_reduce_none,
|
171
|
+
1, 42, :_reduce_none,
|
172
|
+
1, 42, :_reduce_none,
|
173
|
+
1, 42, :_reduce_none,
|
174
|
+
1, 42, :_reduce_none,
|
175
|
+
1, 50, :_reduce_58,
|
176
|
+
2, 47, :_reduce_59,
|
177
|
+
2, 47, :_reduce_60,
|
178
|
+
0, 47, :_reduce_none,
|
179
|
+
1, 52, :_reduce_62,
|
172
180
|
1, 52, :_reduce_63,
|
173
181
|
1, 52, :_reduce_64,
|
174
182
|
1, 52, :_reduce_65,
|
175
183
|
1, 52, :_reduce_66,
|
176
184
|
1, 52, :_reduce_67,
|
177
185
|
1, 52, :_reduce_68,
|
178
|
-
|
179
|
-
3, 40, :_reduce_70,
|
186
|
+
3, 51, :_reduce_69,
|
180
187
|
1, 53, :_reduce_none,
|
181
188
|
2, 53, :_reduce_none,
|
182
189
|
1, 53, :_reduce_none ]
|
183
190
|
|
184
|
-
racc_reduce_n =
|
191
|
+
racc_reduce_n = 73
|
185
192
|
|
186
|
-
racc_shift_n =
|
193
|
+
racc_shift_n = 107
|
187
194
|
|
188
195
|
racc_token_table = {
|
189
196
|
false => 0,
|
@@ -278,19 +285,19 @@ Racc_token_to_s_table = [
|
|
278
285
|
"simple_selector",
|
279
286
|
"element_name",
|
280
287
|
"hcap_0toN",
|
281
|
-
"hcap_1toN",
|
282
|
-
"negation",
|
283
288
|
"function",
|
284
289
|
"pseudo",
|
285
290
|
"attrib",
|
291
|
+
"hcap_1toN",
|
286
292
|
"class",
|
287
293
|
"namespaced_ident",
|
288
294
|
"namespace",
|
289
295
|
"attrib_name",
|
290
296
|
"attrib_val_0or1",
|
291
297
|
"expr",
|
292
|
-
"
|
298
|
+
"nth",
|
293
299
|
"attribute_id",
|
300
|
+
"negation",
|
294
301
|
"eql_incl_dash",
|
295
302
|
"negation_arg" ]
|
296
303
|
|
@@ -356,16 +363,7 @@ def _reduce_10(val, _values, result)
|
|
356
363
|
result
|
357
364
|
end
|
358
365
|
|
359
|
-
|
360
|
-
result = Node.new(:CONDITIONAL_SELECTOR,
|
361
|
-
[
|
362
|
-
val.first,
|
363
|
-
Node.new(:COMBINATOR, [val[1], val.last])
|
364
|
-
]
|
365
|
-
)
|
366
|
-
|
367
|
-
result
|
368
|
-
end
|
366
|
+
# reduce 11 omitted
|
369
367
|
|
370
368
|
def _reduce_12(val, _values, result)
|
371
369
|
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
@@ -373,32 +371,13 @@ def _reduce_12(val, _values, result)
|
|
373
371
|
result
|
374
372
|
end
|
375
373
|
|
376
|
-
|
377
|
-
|
378
|
-
def _reduce_14(val, _values, result)
|
374
|
+
def _reduce_13(val, _values, result)
|
379
375
|
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
380
376
|
|
381
377
|
result
|
382
378
|
end
|
383
379
|
|
384
|
-
def
|
385
|
-
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
386
|
-
|
387
|
-
result
|
388
|
-
end
|
389
|
-
|
390
|
-
def _reduce_16(val, _values, result)
|
391
|
-
result = Node.new(:CONDITIONAL_SELECTOR,
|
392
|
-
[
|
393
|
-
Node.new(:ELEMENT_NAME, ['*']),
|
394
|
-
Node.new(:COMBINATOR, val)
|
395
|
-
]
|
396
|
-
)
|
397
|
-
|
398
|
-
result
|
399
|
-
end
|
400
|
-
|
401
|
-
def _reduce_17(val, _values, result)
|
380
|
+
def _reduce_14(val, _values, result)
|
402
381
|
result = Node.new(:CONDITIONAL_SELECTOR,
|
403
382
|
[Node.new(:ELEMENT_NAME, ['*']), val.first]
|
404
383
|
)
|
@@ -406,33 +385,33 @@ def _reduce_17(val, _values, result)
|
|
406
385
|
result
|
407
386
|
end
|
408
387
|
|
409
|
-
def
|
388
|
+
def _reduce_15(val, _values, result)
|
410
389
|
result = Node.new(val.first, [nil, val.last])
|
411
390
|
|
412
391
|
result
|
413
392
|
end
|
414
393
|
|
415
|
-
def
|
394
|
+
def _reduce_16(val, _values, result)
|
416
395
|
result = Node.new(val[1], [val.first, val.last])
|
417
396
|
|
418
397
|
result
|
419
398
|
end
|
420
399
|
|
421
|
-
# reduce
|
400
|
+
# reduce 17 omitted
|
422
401
|
|
423
|
-
def
|
402
|
+
def _reduce_18(val, _values, result)
|
424
403
|
result = Node.new(:CLASS_CONDITION, [val[1]])
|
425
404
|
result
|
426
405
|
end
|
427
406
|
|
428
|
-
# reduce
|
407
|
+
# reduce 19 omitted
|
429
408
|
|
430
|
-
def
|
409
|
+
def _reduce_20(val, _values, result)
|
431
410
|
result = Node.new(:ELEMENT_NAME, val)
|
432
411
|
result
|
433
412
|
end
|
434
413
|
|
435
|
-
def
|
414
|
+
def _reduce_21(val, _values, result)
|
436
415
|
result = Node.new(:ELEMENT_NAME,
|
437
416
|
[[val.first, val.last].compact.join(':')]
|
438
417
|
)
|
@@ -440,21 +419,21 @@ def _reduce_24(val, _values, result)
|
|
440
419
|
result
|
441
420
|
end
|
442
421
|
|
443
|
-
def
|
422
|
+
def _reduce_22(val, _values, result)
|
444
423
|
name = @namespaces.key?('xmlns') ? "xmlns:#{val.first}" : val.first
|
445
424
|
result = Node.new(:ELEMENT_NAME, [name])
|
446
425
|
|
447
426
|
result
|
448
427
|
end
|
449
428
|
|
450
|
-
def
|
429
|
+
def _reduce_23(val, _values, result)
|
451
430
|
result = val[0]
|
452
431
|
result
|
453
432
|
end
|
454
433
|
|
455
|
-
# reduce
|
434
|
+
# reduce 24 omitted
|
456
435
|
|
457
|
-
def
|
436
|
+
def _reduce_25(val, _values, result)
|
458
437
|
result = Node.new(:ATTRIBUTE_CONDITION,
|
459
438
|
[val[1]] + (val[2] || [])
|
460
439
|
)
|
@@ -462,7 +441,7 @@ def _reduce_28(val, _values, result)
|
|
462
441
|
result
|
463
442
|
end
|
464
443
|
|
465
|
-
def
|
444
|
+
def _reduce_26(val, _values, result)
|
466
445
|
result = Node.new(:ATTRIBUTE_CONDITION,
|
467
446
|
[val[1]] + (val[2] || [])
|
468
447
|
)
|
@@ -470,7 +449,7 @@ def _reduce_29(val, _values, result)
|
|
470
449
|
result
|
471
450
|
end
|
472
451
|
|
473
|
-
def
|
452
|
+
def _reduce_27(val, _values, result)
|
474
453
|
# Non standard, but hpricot supports it.
|
475
454
|
result = Node.new(:PSEUDO_CLASS,
|
476
455
|
[Node.new(:FUNCTION, ['nth-child(', val[1]])]
|
@@ -479,7 +458,7 @@ def _reduce_30(val, _values, result)
|
|
479
458
|
result
|
480
459
|
end
|
481
460
|
|
482
|
-
def
|
461
|
+
def _reduce_28(val, _values, result)
|
483
462
|
result = Node.new(:ELEMENT_NAME,
|
484
463
|
[[val.first, val.last].compact.join(':')]
|
485
464
|
)
|
@@ -487,7 +466,7 @@ def _reduce_31(val, _values, result)
|
|
487
466
|
result
|
488
467
|
end
|
489
468
|
|
490
|
-
def
|
469
|
+
def _reduce_29(val, _values, result)
|
491
470
|
# Default namespace is not applied to attributes.
|
492
471
|
# So we don't add prefix "xmlns:" as in namespaced_ident.
|
493
472
|
result = Node.new(:ELEMENT_NAME, [val.first])
|
@@ -495,62 +474,62 @@ def _reduce_32(val, _values, result)
|
|
495
474
|
result
|
496
475
|
end
|
497
476
|
|
498
|
-
def
|
477
|
+
def _reduce_30(val, _values, result)
|
499
478
|
result = Node.new(:FUNCTION, [val.first.strip])
|
500
479
|
|
501
480
|
result
|
502
481
|
end
|
503
482
|
|
504
|
-
def
|
483
|
+
def _reduce_31(val, _values, result)
|
505
484
|
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
506
485
|
|
507
486
|
result
|
508
487
|
end
|
509
488
|
|
510
|
-
def
|
489
|
+
def _reduce_32(val, _values, result)
|
511
490
|
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
512
491
|
|
513
492
|
result
|
514
493
|
end
|
515
494
|
|
516
|
-
def
|
495
|
+
def _reduce_33(val, _values, result)
|
517
496
|
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
518
497
|
|
519
498
|
result
|
520
499
|
end
|
521
500
|
|
522
|
-
def
|
501
|
+
def _reduce_34(val, _values, result)
|
523
502
|
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
524
503
|
|
525
504
|
result
|
526
505
|
end
|
527
506
|
|
528
|
-
def
|
507
|
+
def _reduce_35(val, _values, result)
|
529
508
|
result = [val.first, val.last]
|
530
509
|
result
|
531
510
|
end
|
532
511
|
|
533
|
-
def
|
512
|
+
def _reduce_36(val, _values, result)
|
534
513
|
result = [val.first, val.last]
|
535
514
|
result
|
536
515
|
end
|
537
516
|
|
538
|
-
def
|
517
|
+
def _reduce_37(val, _values, result)
|
539
518
|
result = [val.first, val.last]
|
540
519
|
result
|
541
520
|
end
|
542
521
|
|
543
|
-
# reduce
|
522
|
+
# reduce 38 omitted
|
544
523
|
|
545
|
-
# reduce
|
524
|
+
# reduce 39 omitted
|
546
525
|
|
547
|
-
def
|
526
|
+
def _reduce_40(val, _values, result)
|
548
527
|
if val[0] == 'even'
|
549
528
|
val = ["2","n","+","0"]
|
550
|
-
result = Node.new(:
|
529
|
+
result = Node.new(:NTH, val)
|
551
530
|
elsif val[0] == 'odd'
|
552
531
|
val = ["2","n","+","1"]
|
553
|
-
result = Node.new(:
|
532
|
+
result = Node.new(:NTH, val)
|
554
533
|
else
|
555
534
|
# This is not CSS standard. It allows us to support this:
|
556
535
|
# assert_xpath("//a[foo(., @href)]", @parser.parse('a:foo(@href)'))
|
@@ -562,9 +541,9 @@ def _reduce_43(val, _values, result)
|
|
562
541
|
result
|
563
542
|
end
|
564
543
|
|
565
|
-
def
|
544
|
+
def _reduce_41(val, _values, result)
|
566
545
|
if val[1] == 'n'
|
567
|
-
result = Node.new(:
|
546
|
+
result = Node.new(:NTH, val)
|
568
547
|
else
|
569
548
|
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
570
549
|
end
|
@@ -572,15 +551,15 @@ def _reduce_44(val, _values, result)
|
|
572
551
|
result
|
573
552
|
end
|
574
553
|
|
575
|
-
def
|
554
|
+
def _reduce_42(val, _values, result)
|
576
555
|
# n+3, -n+3
|
577
556
|
if val[0] == 'n'
|
578
557
|
val.unshift("1")
|
579
|
-
result = Node.new(:
|
558
|
+
result = Node.new(:NTH, val)
|
580
559
|
elsif val[0] == '-n'
|
581
560
|
val[0] = 'n'
|
582
561
|
val.unshift("-1")
|
583
|
-
result = Node.new(:
|
562
|
+
result = Node.new(:NTH, val)
|
584
563
|
else
|
585
564
|
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
586
565
|
end
|
@@ -588,11 +567,19 @@ def _reduce_45(val, _values, result)
|
|
588
567
|
result
|
589
568
|
end
|
590
569
|
|
591
|
-
def
|
592
|
-
|
570
|
+
def _reduce_43(val, _values, result)
|
571
|
+
# 5n, -5n, 10n-1
|
572
|
+
n = val[1]
|
573
|
+
if n[0, 2] == 'n-'
|
574
|
+
val[1] = 'n'
|
575
|
+
val << "-"
|
576
|
+
# b is contained in n as n is the string "n-b"
|
577
|
+
val << n[2, n.size]
|
578
|
+
result = Node.new(:NTH, val)
|
579
|
+
elsif n == 'n'
|
593
580
|
val << "+"
|
594
581
|
val << "0"
|
595
|
-
result = Node.new(:
|
582
|
+
result = Node.new(:NTH, val)
|
596
583
|
else
|
597
584
|
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
598
585
|
end
|
@@ -600,117 +587,125 @@ def _reduce_46(val, _values, result)
|
|
600
587
|
result
|
601
588
|
end
|
602
589
|
|
603
|
-
def
|
590
|
+
def _reduce_44(val, _values, result)
|
604
591
|
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
605
592
|
|
606
593
|
result
|
607
594
|
end
|
608
595
|
|
609
|
-
def
|
596
|
+
def _reduce_45(val, _values, result)
|
610
597
|
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
611
598
|
result
|
612
599
|
end
|
613
600
|
|
614
|
-
# reduce
|
601
|
+
# reduce 46 omitted
|
615
602
|
|
616
|
-
# reduce
|
603
|
+
# reduce 47 omitted
|
617
604
|
|
618
|
-
def
|
605
|
+
def _reduce_48(val, _values, result)
|
619
606
|
result = Node.new(:COMBINATOR, val)
|
620
607
|
|
621
608
|
result
|
622
609
|
end
|
623
610
|
|
624
|
-
def
|
611
|
+
def _reduce_49(val, _values, result)
|
612
|
+
result = Node.new(:COMBINATOR, val)
|
613
|
+
|
614
|
+
result
|
615
|
+
end
|
616
|
+
|
617
|
+
def _reduce_50(val, _values, result)
|
625
618
|
result = Node.new(:COMBINATOR, val)
|
626
619
|
|
627
620
|
result
|
628
621
|
end
|
629
622
|
|
630
|
-
def
|
623
|
+
def _reduce_51(val, _values, result)
|
631
624
|
result = Node.new(:COMBINATOR, val)
|
632
625
|
|
633
626
|
result
|
634
627
|
end
|
635
628
|
|
636
|
-
def
|
629
|
+
def _reduce_52(val, _values, result)
|
637
630
|
result = Node.new(:COMBINATOR, val)
|
638
631
|
|
639
632
|
result
|
640
633
|
end
|
641
634
|
|
635
|
+
# reduce 53 omitted
|
636
|
+
|
637
|
+
# reduce 54 omitted
|
638
|
+
|
642
639
|
# reduce 55 omitted
|
643
640
|
|
644
641
|
# reduce 56 omitted
|
645
642
|
|
646
643
|
# reduce 57 omitted
|
647
644
|
|
648
|
-
|
649
|
-
|
650
|
-
def _reduce_59(val, _values, result)
|
645
|
+
def _reduce_58(val, _values, result)
|
651
646
|
result = Node.new(:ID, val)
|
652
647
|
result
|
653
648
|
end
|
654
649
|
|
655
|
-
def
|
650
|
+
def _reduce_59(val, _values, result)
|
656
651
|
result = [val.first, val[1]]
|
657
652
|
result
|
658
653
|
end
|
659
654
|
|
660
|
-
def
|
655
|
+
def _reduce_60(val, _values, result)
|
661
656
|
result = [val.first, val[1]]
|
662
657
|
result
|
663
658
|
end
|
664
659
|
|
665
|
-
# reduce
|
660
|
+
# reduce 61 omitted
|
666
661
|
|
667
|
-
def
|
662
|
+
def _reduce_62(val, _values, result)
|
668
663
|
result = :equal
|
669
664
|
result
|
670
665
|
end
|
671
666
|
|
672
|
-
def
|
667
|
+
def _reduce_63(val, _values, result)
|
673
668
|
result = :prefix_match
|
674
669
|
result
|
675
670
|
end
|
676
671
|
|
677
|
-
def
|
672
|
+
def _reduce_64(val, _values, result)
|
678
673
|
result = :suffix_match
|
679
674
|
result
|
680
675
|
end
|
681
676
|
|
682
|
-
def
|
677
|
+
def _reduce_65(val, _values, result)
|
683
678
|
result = :substring_match
|
684
679
|
result
|
685
680
|
end
|
686
681
|
|
687
|
-
def
|
682
|
+
def _reduce_66(val, _values, result)
|
688
683
|
result = :not_equal
|
689
684
|
result
|
690
685
|
end
|
691
686
|
|
692
|
-
def
|
687
|
+
def _reduce_67(val, _values, result)
|
693
688
|
result = :includes
|
694
689
|
result
|
695
690
|
end
|
696
691
|
|
697
|
-
def
|
692
|
+
def _reduce_68(val, _values, result)
|
698
693
|
result = :dash_match
|
699
694
|
result
|
700
695
|
end
|
701
696
|
|
702
|
-
def
|
697
|
+
def _reduce_69(val, _values, result)
|
703
698
|
result = Node.new(:NOT, [val[1]])
|
704
699
|
|
705
700
|
result
|
706
701
|
end
|
707
702
|
|
703
|
+
# reduce 70 omitted
|
704
|
+
|
708
705
|
# reduce 71 omitted
|
709
706
|
|
710
707
|
# reduce 72 omitted
|
711
708
|
|
712
|
-
# reduce 73 omitted
|
713
|
-
|
714
709
|
def _reduce_none(val, _values, result)
|
715
710
|
val[0]
|
716
711
|
end
|