nokogiri 1.18.0.rc1-arm-linux-gnu

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +38 -0
  3. data/LICENSE-DEPENDENCIES.md +2224 -0
  4. data/LICENSE.md +9 -0
  5. data/README.md +293 -0
  6. data/bin/nokogiri +131 -0
  7. data/dependencies.yml +42 -0
  8. data/ext/nokogiri/depend +38 -0
  9. data/ext/nokogiri/extconf.rb +1173 -0
  10. data/ext/nokogiri/gumbo.c +610 -0
  11. data/ext/nokogiri/html4_document.c +171 -0
  12. data/ext/nokogiri/html4_element_description.c +299 -0
  13. data/ext/nokogiri/html4_entity_lookup.c +37 -0
  14. data/ext/nokogiri/html4_sax_parser.c +40 -0
  15. data/ext/nokogiri/html4_sax_parser_context.c +98 -0
  16. data/ext/nokogiri/html4_sax_push_parser.c +96 -0
  17. data/ext/nokogiri/include/libexslt/exslt.h +108 -0
  18. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  19. data/ext/nokogiri/include/libexslt/exsltexports.h +63 -0
  20. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +336 -0
  21. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  22. data/ext/nokogiri/include/libxml2/libxml/SAX.h +202 -0
  23. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +171 -0
  24. data/ext/nokogiri/include/libxml2/libxml/c14n.h +115 -0
  25. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  26. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  27. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  28. data/ext/nokogiri/include/libxml2/libxml/dict.h +82 -0
  29. data/ext/nokogiri/include/libxml2/libxml/encoding.h +244 -0
  30. data/ext/nokogiri/include/libxml2/libxml/entities.h +166 -0
  31. data/ext/nokogiri/include/libxml2/libxml/globals.h +41 -0
  32. data/ext/nokogiri/include/libxml2/libxml/hash.h +251 -0
  33. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  34. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +186 -0
  35. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +98 -0
  36. data/ext/nokogiri/include/libxml2/libxml/parser.h +1390 -0
  37. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +671 -0
  38. data/ext/nokogiri/include/libxml2/libxml/pattern.h +106 -0
  39. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +219 -0
  40. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +959 -0
  41. data/ext/nokogiri/include/libxml2/libxml/schematron.h +143 -0
  42. data/ext/nokogiri/include/libxml2/libxml/threads.h +87 -0
  43. data/ext/nokogiri/include/libxml2/libxml/tree.h +1382 -0
  44. data/ext/nokogiri/include/libxml2/libxml/uri.h +106 -0
  45. data/ext/nokogiri/include/libxml2/libxml/valid.h +477 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +136 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +438 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +962 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +146 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +188 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +436 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +215 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +102 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +249 -0
  58. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +152 -0
  59. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  60. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +366 -0
  61. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +347 -0
  62. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +489 -0
  63. data/ext/nokogiri/include/libxml2/libxml/xpath.h +579 -0
  64. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +633 -0
  65. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +138 -0
  66. data/ext/nokogiri/include/libxslt/attributes.h +39 -0
  67. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  68. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  69. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  70. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  71. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  72. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  73. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  74. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  75. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  76. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  77. data/ext/nokogiri/include/libxslt/security.h +104 -0
  78. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  79. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  80. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  81. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  82. data/ext/nokogiri/include/libxslt/xsltInternals.h +1995 -0
  83. data/ext/nokogiri/include/libxslt/xsltconfig.h +146 -0
  84. data/ext/nokogiri/include/libxslt/xsltexports.h +64 -0
  85. data/ext/nokogiri/include/libxslt/xsltlocale.h +44 -0
  86. data/ext/nokogiri/include/libxslt/xsltutils.h +343 -0
  87. data/ext/nokogiri/libxml2_polyfill.c +114 -0
  88. data/ext/nokogiri/nokogiri.c +294 -0
  89. data/ext/nokogiri/nokogiri.h +238 -0
  90. data/ext/nokogiri/test_global_handlers.c +40 -0
  91. data/ext/nokogiri/xml_attr.c +103 -0
  92. data/ext/nokogiri/xml_attribute_decl.c +70 -0
  93. data/ext/nokogiri/xml_cdata.c +62 -0
  94. data/ext/nokogiri/xml_comment.c +57 -0
  95. data/ext/nokogiri/xml_document.c +784 -0
  96. data/ext/nokogiri/xml_document_fragment.c +29 -0
  97. data/ext/nokogiri/xml_dtd.c +208 -0
  98. data/ext/nokogiri/xml_element_content.c +131 -0
  99. data/ext/nokogiri/xml_element_decl.c +69 -0
  100. data/ext/nokogiri/xml_encoding_handler.c +112 -0
  101. data/ext/nokogiri/xml_entity_decl.c +112 -0
  102. data/ext/nokogiri/xml_entity_reference.c +50 -0
  103. data/ext/nokogiri/xml_namespace.c +181 -0
  104. data/ext/nokogiri/xml_node.c +2459 -0
  105. data/ext/nokogiri/xml_node_set.c +518 -0
  106. data/ext/nokogiri/xml_processing_instruction.c +54 -0
  107. data/ext/nokogiri/xml_reader.c +777 -0
  108. data/ext/nokogiri/xml_relax_ng.c +149 -0
  109. data/ext/nokogiri/xml_sax_parser.c +403 -0
  110. data/ext/nokogiri/xml_sax_parser_context.c +390 -0
  111. data/ext/nokogiri/xml_sax_push_parser.c +206 -0
  112. data/ext/nokogiri/xml_schema.c +226 -0
  113. data/ext/nokogiri/xml_syntax_error.c +93 -0
  114. data/ext/nokogiri/xml_text.c +59 -0
  115. data/ext/nokogiri/xml_xpath_context.c +502 -0
  116. data/ext/nokogiri/xslt_stylesheet.c +421 -0
  117. data/gumbo-parser/CHANGES.md +63 -0
  118. data/gumbo-parser/Makefile +129 -0
  119. data/gumbo-parser/THANKS +27 -0
  120. data/lib/nokogiri/3.1/nokogiri.so +0 -0
  121. data/lib/nokogiri/3.2/nokogiri.so +0 -0
  122. data/lib/nokogiri/3.3/nokogiri.so +0 -0
  123. data/lib/nokogiri/3.4/nokogiri.so +0 -0
  124. data/lib/nokogiri/class_resolver.rb +67 -0
  125. data/lib/nokogiri/css/node.rb +58 -0
  126. data/lib/nokogiri/css/parser.rb +772 -0
  127. data/lib/nokogiri/css/parser.y +277 -0
  128. data/lib/nokogiri/css/parser_extras.rb +36 -0
  129. data/lib/nokogiri/css/selector_cache.rb +38 -0
  130. data/lib/nokogiri/css/syntax_error.rb +9 -0
  131. data/lib/nokogiri/css/tokenizer.rb +155 -0
  132. data/lib/nokogiri/css/tokenizer.rex +57 -0
  133. data/lib/nokogiri/css/xpath_visitor.rb +375 -0
  134. data/lib/nokogiri/css.rb +132 -0
  135. data/lib/nokogiri/decorators/slop.rb +42 -0
  136. data/lib/nokogiri/encoding_handler.rb +57 -0
  137. data/lib/nokogiri/extension.rb +32 -0
  138. data/lib/nokogiri/gumbo.rb +15 -0
  139. data/lib/nokogiri/html.rb +48 -0
  140. data/lib/nokogiri/html4/builder.rb +37 -0
  141. data/lib/nokogiri/html4/document.rb +235 -0
  142. data/lib/nokogiri/html4/document_fragment.rb +166 -0
  143. data/lib/nokogiri/html4/element_description.rb +25 -0
  144. data/lib/nokogiri/html4/element_description_defaults.rb +2040 -0
  145. data/lib/nokogiri/html4/encoding_reader.rb +121 -0
  146. data/lib/nokogiri/html4/entity_lookup.rb +15 -0
  147. data/lib/nokogiri/html4/sax/parser.rb +48 -0
  148. data/lib/nokogiri/html4/sax/parser_context.rb +15 -0
  149. data/lib/nokogiri/html4/sax/push_parser.rb +37 -0
  150. data/lib/nokogiri/html4.rb +42 -0
  151. data/lib/nokogiri/html5/builder.rb +40 -0
  152. data/lib/nokogiri/html5/document.rb +199 -0
  153. data/lib/nokogiri/html5/document_fragment.rb +200 -0
  154. data/lib/nokogiri/html5/node.rb +103 -0
  155. data/lib/nokogiri/html5.rb +368 -0
  156. data/lib/nokogiri/jruby/dependencies.rb +3 -0
  157. data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
  158. data/lib/nokogiri/syntax_error.rb +6 -0
  159. data/lib/nokogiri/version/constant.rb +6 -0
  160. data/lib/nokogiri/version/info.rb +224 -0
  161. data/lib/nokogiri/version.rb +4 -0
  162. data/lib/nokogiri/xml/attr.rb +66 -0
  163. data/lib/nokogiri/xml/attribute_decl.rb +22 -0
  164. data/lib/nokogiri/xml/builder.rb +494 -0
  165. data/lib/nokogiri/xml/cdata.rb +13 -0
  166. data/lib/nokogiri/xml/character_data.rb +9 -0
  167. data/lib/nokogiri/xml/document.rb +514 -0
  168. data/lib/nokogiri/xml/document_fragment.rb +276 -0
  169. data/lib/nokogiri/xml/dtd.rb +34 -0
  170. data/lib/nokogiri/xml/element_content.rb +46 -0
  171. data/lib/nokogiri/xml/element_decl.rb +17 -0
  172. data/lib/nokogiri/xml/entity_decl.rb +23 -0
  173. data/lib/nokogiri/xml/entity_reference.rb +20 -0
  174. data/lib/nokogiri/xml/namespace.rb +57 -0
  175. data/lib/nokogiri/xml/node/save_options.rb +76 -0
  176. data/lib/nokogiri/xml/node.rb +1650 -0
  177. data/lib/nokogiri/xml/node_set.rb +449 -0
  178. data/lib/nokogiri/xml/notation.rb +19 -0
  179. data/lib/nokogiri/xml/parse_options.rb +213 -0
  180. data/lib/nokogiri/xml/pp/character_data.rb +21 -0
  181. data/lib/nokogiri/xml/pp/node.rb +73 -0
  182. data/lib/nokogiri/xml/pp.rb +4 -0
  183. data/lib/nokogiri/xml/processing_instruction.rb +11 -0
  184. data/lib/nokogiri/xml/reader.rb +139 -0
  185. data/lib/nokogiri/xml/relax_ng.rb +75 -0
  186. data/lib/nokogiri/xml/sax/document.rb +258 -0
  187. data/lib/nokogiri/xml/sax/parser.rb +199 -0
  188. data/lib/nokogiri/xml/sax/parser_context.rb +129 -0
  189. data/lib/nokogiri/xml/sax/push_parser.rb +64 -0
  190. data/lib/nokogiri/xml/sax.rb +54 -0
  191. data/lib/nokogiri/xml/schema.rb +140 -0
  192. data/lib/nokogiri/xml/searchable.rb +297 -0
  193. data/lib/nokogiri/xml/syntax_error.rb +94 -0
  194. data/lib/nokogiri/xml/text.rb +11 -0
  195. data/lib/nokogiri/xml/xpath/syntax_error.rb +13 -0
  196. data/lib/nokogiri/xml/xpath.rb +21 -0
  197. data/lib/nokogiri/xml/xpath_context.rb +49 -0
  198. data/lib/nokogiri/xml.rb +65 -0
  199. data/lib/nokogiri/xslt/stylesheet.rb +49 -0
  200. data/lib/nokogiri/xslt.rb +129 -0
  201. data/lib/nokogiri.rb +128 -0
  202. data/lib/xsd/xmlparser/nokogiri.rb +105 -0
  203. metadata +324 -0
@@ -0,0 +1,772 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # DO NOT MODIFY!!!!
4
+ # This file is automatically generated by Racc 1.8.0
5
+ # from Racc grammar file "parser.y".
6
+ #
7
+
8
+ require 'racc/parser.rb'
9
+
10
+
11
+ require_relative "parser_extras"
12
+
13
+ module Nokogiri
14
+ module CSS
15
+ # :nodoc: all
16
+ class Parser < Racc::Parser
17
+ end
18
+ end
19
+ end
20
+
21
+ module Nokogiri
22
+ module CSS
23
+ class Parser < Racc::Parser
24
+
25
+
26
+ def unescape_css_identifier(identifier)
27
+ identifier.gsub(/\\(?:([^0-9a-fA-F])|([0-9a-fA-F]{1,6})\s?)/){ |m| $1 || [$2.hex].pack('U') }
28
+ end
29
+
30
+ def unescape_css_string(str)
31
+ str.gsub(/\\(?:([^0-9a-fA-F])|([0-9a-fA-F]{1,6})\s?)/) do |m|
32
+ if $1=="\n"
33
+ ''
34
+ else
35
+ $1 || [$2.hex].pack('U')
36
+ end
37
+ end
38
+ end
39
+ ##### State transition tables begin ###
40
+
41
+ racc_action_table = [
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 ]
67
+
68
+ racc_action_check = [
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 ]
94
+
95
+ racc_action_pointer = [
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 ]
108
+
109
+ racc_action_default = [
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 ]
122
+
123
+ racc_goto_table = [
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 ]
132
+
133
+ racc_goto_check = [
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 ]
142
+
143
+ racc_goto_pointer = [
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 ]
147
+
148
+ racc_goto_default = [
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 ]
152
+
153
+ racc_reduce_table = [
154
+ 0, 0, :racc_error,
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
240
+
241
+ racc_token_table = {
242
+ false => 0,
243
+ :error => 1,
244
+ :FUNCTION => 2,
245
+ :INCLUDES => 3,
246
+ :DASHMATCH => 4,
247
+ :LBRACE => 5,
248
+ :HASH => 6,
249
+ :PLUS => 7,
250
+ :GREATER => 8,
251
+ :S => 9,
252
+ :STRING => 10,
253
+ :IDENT => 11,
254
+ :COMMA => 12,
255
+ :NUMBER => 13,
256
+ :PREFIXMATCH => 14,
257
+ :SUFFIXMATCH => 15,
258
+ :SUBSTRINGMATCH => 16,
259
+ :TILDE => 17,
260
+ :NOT_EQUAL => 18,
261
+ :SLASH => 19,
262
+ :DOUBLESLASH => 20,
263
+ :NOT => 21,
264
+ :EQUAL => 22,
265
+ :RPAREN => 23,
266
+ :LSQUARE => 24,
267
+ :RSQUARE => 25,
268
+ :HAS => 26,
269
+ "@" => 27,
270
+ "." => 28,
271
+ "*" => 29,
272
+ "|" => 30,
273
+ ":" => 31 }
274
+
275
+ racc_nt_base = 32
276
+
277
+ racc_use_result_var = true
278
+
279
+ Racc_arg = [
280
+ racc_action_table,
281
+ racc_action_check,
282
+ racc_action_default,
283
+ racc_action_pointer,
284
+ racc_goto_table,
285
+ racc_goto_check,
286
+ racc_goto_default,
287
+ racc_goto_pointer,
288
+ racc_nt_base,
289
+ racc_reduce_table,
290
+ racc_token_table,
291
+ racc_shift_n,
292
+ racc_reduce_n,
293
+ racc_use_result_var ]
294
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
295
+
296
+ Racc_token_to_s_table = [
297
+ "$end",
298
+ "error",
299
+ "FUNCTION",
300
+ "INCLUDES",
301
+ "DASHMATCH",
302
+ "LBRACE",
303
+ "HASH",
304
+ "PLUS",
305
+ "GREATER",
306
+ "S",
307
+ "STRING",
308
+ "IDENT",
309
+ "COMMA",
310
+ "NUMBER",
311
+ "PREFIXMATCH",
312
+ "SUFFIXMATCH",
313
+ "SUBSTRINGMATCH",
314
+ "TILDE",
315
+ "NOT_EQUAL",
316
+ "SLASH",
317
+ "DOUBLESLASH",
318
+ "NOT",
319
+ "EQUAL",
320
+ "RPAREN",
321
+ "LSQUARE",
322
+ "RSQUARE",
323
+ "HAS",
324
+ "\"@\"",
325
+ "\".\"",
326
+ "\"*\"",
327
+ "\"|\"",
328
+ "\":\"",
329
+ "$start",
330
+ "selector",
331
+ "simple_selector_1toN",
332
+ "prefixless_combinator_selector",
333
+ "optional_S",
334
+ "combinator",
335
+ "xpath_attribute_name",
336
+ "xpath_attribute",
337
+ "simple_selector",
338
+ "element_name",
339
+ "hcap_0toN",
340
+ "function",
341
+ "pseudo",
342
+ "attrib",
343
+ "hcap_1toN",
344
+ "class",
345
+ "namespaced_ident",
346
+ "namespace",
347
+ "attrib_name",
348
+ "attrib_val_0or1",
349
+ "expr",
350
+ "nth",
351
+ "attribute_id",
352
+ "negation",
353
+ "eql_incl_dash",
354
+ "negation_arg" ]
355
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
356
+
357
+ Racc_debug_parser = false
358
+
359
+ ##### State transition tables end #####
360
+
361
+ # reduce 0 omitted
362
+
363
+ def _reduce_1(val, _values, result)
364
+ result = [val[0], val[2]].flatten
365
+
366
+ result
367
+ end
368
+
369
+ def _reduce_2(val, _values, result)
370
+ result = val.flatten
371
+ result
372
+ end
373
+
374
+ def _reduce_3(val, _values, result)
375
+ result = [val[1]].flatten
376
+ result
377
+ end
378
+
379
+ def _reduce_4(val, _values, result)
380
+ result = :DIRECT_ADJACENT_SELECTOR
381
+ result
382
+ end
383
+
384
+ def _reduce_5(val, _values, result)
385
+ result = :CHILD_SELECTOR
386
+ result
387
+ end
388
+
389
+ def _reduce_6(val, _values, result)
390
+ result = :FOLLOWING_SELECTOR
391
+ result
392
+ end
393
+
394
+ def _reduce_7(val, _values, result)
395
+ result = :DESCENDANT_SELECTOR
396
+ result
397
+ end
398
+
399
+ def _reduce_8(val, _values, result)
400
+ result = :CHILD_SELECTOR
401
+ result
402
+ end
403
+
404
+ def _reduce_9(val, _values, result)
405
+ result = val[1]
406
+ result
407
+ end
408
+
409
+ def _reduce_10(val, _values, result)
410
+ result = Node.new(:ATTRIB_NAME, [val[0]])
411
+ result
412
+ end
413
+
414
+ def _reduce_11(val, _values, result)
415
+ result = if val[1].nil?
416
+ val[0]
417
+ else
418
+ Node.new(:CONDITIONAL_SELECTOR, [val[0], val[1]])
419
+ end
420
+
421
+ result
422
+ end
423
+
424
+ # reduce 12 omitted
425
+
426
+ def _reduce_13(val, _values, result)
427
+ result = Node.new(:CONDITIONAL_SELECTOR, val)
428
+ result
429
+ end
430
+
431
+ def _reduce_14(val, _values, result)
432
+ result = Node.new(:CONDITIONAL_SELECTOR, val)
433
+ result
434
+ end
435
+
436
+ def _reduce_15(val, _values, result)
437
+ result = Node.new(:CONDITIONAL_SELECTOR, [Node.new(:ELEMENT_NAME, ['*']), val[0]])
438
+ result
439
+ end
440
+
441
+ # reduce 16 omitted
442
+
443
+ def _reduce_17(val, _values, result)
444
+ result = Node.new(val[0], [nil, val[1]])
445
+ result
446
+ end
447
+
448
+ def _reduce_18(val, _values, result)
449
+ result = Node.new(val[1], [val[0], val[2]])
450
+ result
451
+ end
452
+
453
+ def _reduce_19(val, _values, result)
454
+ result = Node.new(:DESCENDANT_SELECTOR, [val[0], val[2]])
455
+ result
456
+ end
457
+
458
+ # reduce 20 omitted
459
+
460
+ def _reduce_21(val, _values, result)
461
+ result = Node.new(:CLASS_CONDITION, [unescape_css_identifier(val[1])])
462
+ result
463
+ end
464
+
465
+ # reduce 22 omitted
466
+
467
+ def _reduce_23(val, _values, result)
468
+ result = Node.new(:ELEMENT_NAME, val)
469
+ result
470
+ end
471
+
472
+ def _reduce_24(val, _values, result)
473
+ result = Node.new(:ELEMENT_NAME, [val[0], val[2]])
474
+ result
475
+ end
476
+
477
+ def _reduce_25(val, _values, result)
478
+ name = val[0]
479
+ result = Node.new(:ELEMENT_NAME, [name])
480
+
481
+ result
482
+ end
483
+
484
+ def _reduce_26(val, _values, result)
485
+ result = val[0]
486
+ result
487
+ end
488
+
489
+ # reduce 27 omitted
490
+
491
+ def _reduce_28(val, _values, result)
492
+ result = Node.new(:ATTRIBUTE_CONDITION, [val[1]] + (val[2] || []))
493
+
494
+ result
495
+ end
496
+
497
+ def _reduce_29(val, _values, result)
498
+ result = Node.new(:ATTRIBUTE_CONDITION, [val[1]] + (val[2] || []))
499
+
500
+ result
501
+ end
502
+
503
+ def _reduce_30(val, _values, result)
504
+ result = Node.new(:PSEUDO_CLASS, [Node.new(:FUNCTION, ['nth-child(', val[1]])])
505
+
506
+ result
507
+ end
508
+
509
+ def _reduce_31(val, _values, result)
510
+ result = Node.new(:ATTRIB_NAME, [[val[0], val[2]].compact.join(':')])
511
+ result
512
+ end
513
+
514
+ def _reduce_32(val, _values, result)
515
+ result = Node.new(:ATTRIB_NAME, [val[0]])
516
+ result
517
+ end
518
+
519
+ # reduce 33 omitted
520
+
521
+ def _reduce_34(val, _values, result)
522
+ result = Node.new(:FUNCTION, [val[0].strip])
523
+
524
+ result
525
+ end
526
+
527
+ def _reduce_35(val, _values, result)
528
+ result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
529
+
530
+ result
531
+ end
532
+
533
+ def _reduce_36(val, _values, result)
534
+ result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
535
+
536
+ result
537
+ end
538
+
539
+ def _reduce_37(val, _values, result)
540
+ result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
541
+
542
+ result
543
+ end
544
+
545
+ def _reduce_38(val, _values, result)
546
+ result = Node.new(:FUNCTION, [val[0].strip, val[1]].flatten)
547
+
548
+ result
549
+ end
550
+
551
+ def _reduce_39(val, _values, result)
552
+ result = [val[0], val[2]]
553
+ result
554
+ end
555
+
556
+ def _reduce_40(val, _values, result)
557
+ result = [val[0], val[2]]
558
+ result
559
+ end
560
+
561
+ def _reduce_41(val, _values, result)
562
+ result = [val[0], val[2]]
563
+ result
564
+ end
565
+
566
+ def _reduce_42(val, _values, result)
567
+ result = [val[0], val[2]]
568
+ result
569
+ end
570
+
571
+ # reduce 43 omitted
572
+
573
+ # reduce 44 omitted
574
+
575
+ def _reduce_45(val, _values, result)
576
+ case val[0]
577
+ when 'even'
578
+ result = Node.new(:NTH, ['2','n','+','0'])
579
+ when 'odd'
580
+ result = Node.new(:NTH, ['2','n','+','1'])
581
+ when 'n'
582
+ result = Node.new(:NTH, ['1','n','+','0'])
583
+ else
584
+ result = val
585
+ end
586
+
587
+ result
588
+ end
589
+
590
+ # reduce 46 omitted
591
+
592
+ def _reduce_47(val, _values, result)
593
+ if val[1] == 'n'
594
+ result = Node.new(:NTH, val)
595
+ else
596
+ raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
597
+ end
598
+
599
+ result
600
+ end
601
+
602
+ def _reduce_48(val, _values, result)
603
+ # n+3, -n+3
604
+ if val[0] == 'n'
605
+ val.unshift("1")
606
+ result = Node.new(:NTH, val)
607
+ elsif val[0] == '-n'
608
+ val[0] = 'n'
609
+ val.unshift("-1")
610
+ result = Node.new(:NTH, val)
611
+ else
612
+ raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
613
+ end
614
+
615
+ result
616
+ end
617
+
618
+ def _reduce_49(val, _values, result)
619
+ # 5n, -5n, 10n-1
620
+ n = val[1]
621
+ if n[0, 2] == 'n-'
622
+ val[1] = 'n'
623
+ val << "-"
624
+ # b is contained in n as n is the string "n-b"
625
+ val << n[2, n.size]
626
+ result = Node.new(:NTH, val)
627
+ elsif n == 'n'
628
+ val << "+"
629
+ val << "0"
630
+ result = Node.new(:NTH, val)
631
+ else
632
+ raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
633
+ end
634
+
635
+ result
636
+ end
637
+
638
+ def _reduce_50(val, _values, result)
639
+ result = Node.new(:PSEUDO_CLASS, [val[1]])
640
+
641
+ result
642
+ end
643
+
644
+ def _reduce_51(val, _values, result)
645
+ result = Node.new(:PSEUDO_CLASS, [val[1]])
646
+ result
647
+ end
648
+
649
+ # reduce 52 omitted
650
+
651
+ # reduce 53 omitted
652
+
653
+ def _reduce_54(val, _values, result)
654
+ result = Node.new(:COMBINATOR, val)
655
+
656
+ result
657
+ end
658
+
659
+ def _reduce_55(val, _values, result)
660
+ result = Node.new(:COMBINATOR, val)
661
+
662
+ result
663
+ end
664
+
665
+ def _reduce_56(val, _values, result)
666
+ result = Node.new(:COMBINATOR, val)
667
+
668
+ result
669
+ end
670
+
671
+ def _reduce_57(val, _values, result)
672
+ result = Node.new(:COMBINATOR, val)
673
+
674
+ result
675
+ end
676
+
677
+ def _reduce_58(val, _values, result)
678
+ result = Node.new(:COMBINATOR, val)
679
+
680
+ result
681
+ end
682
+
683
+ # reduce 59 omitted
684
+
685
+ # reduce 60 omitted
686
+
687
+ # reduce 61 omitted
688
+
689
+ # reduce 62 omitted
690
+
691
+ # reduce 63 omitted
692
+
693
+ def _reduce_64(val, _values, result)
694
+ result = Node.new(:ID, [unescape_css_identifier(val[0])])
695
+ result
696
+ end
697
+
698
+ def _reduce_65(val, _values, result)
699
+ result = [val[0], unescape_css_identifier(val[1])]
700
+ result
701
+ end
702
+
703
+ def _reduce_66(val, _values, result)
704
+ result = [val[0], unescape_css_string(val[1])]
705
+ result
706
+ end
707
+
708
+ def _reduce_67(val, _values, result)
709
+ result = [val[0], val[1]]
710
+ result
711
+ end
712
+
713
+ # reduce 68 omitted
714
+
715
+ def _reduce_69(val, _values, result)
716
+ result = :equal
717
+ result
718
+ end
719
+
720
+ def _reduce_70(val, _values, result)
721
+ result = :prefix_match
722
+ result
723
+ end
724
+
725
+ def _reduce_71(val, _values, result)
726
+ result = :suffix_match
727
+ result
728
+ end
729
+
730
+ def _reduce_72(val, _values, result)
731
+ result = :substring_match
732
+ result
733
+ end
734
+
735
+ def _reduce_73(val, _values, result)
736
+ result = :not_equal
737
+ result
738
+ end
739
+
740
+ def _reduce_74(val, _values, result)
741
+ result = :includes
742
+ result
743
+ end
744
+
745
+ def _reduce_75(val, _values, result)
746
+ result = :dash_match
747
+ result
748
+ end
749
+
750
+ def _reduce_76(val, _values, result)
751
+ result = Node.new(:NOT, [val[1]])
752
+
753
+ result
754
+ end
755
+
756
+ # reduce 77 omitted
757
+
758
+ # reduce 78 omitted
759
+
760
+ # reduce 79 omitted
761
+
762
+ # reduce 80 omitted
763
+
764
+ # reduce 81 omitted
765
+
766
+ def _reduce_none(val, _values, result)
767
+ val[0]
768
+ end
769
+
770
+ end # class Parser
771
+ end # module CSS
772
+ end # module Nokogiri