nokogiri 1.8.2 → 1.8.3

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.

Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +14 -14
  3. data/CHANGELOG.md +43 -1
  4. data/LICENSE.md +2 -1
  5. data/Manifest.txt +3 -0
  6. data/README.md +20 -21
  7. data/Rakefile +2 -8
  8. data/SECURITY.md +19 -0
  9. data/build_all +2 -2
  10. data/dependencies.yml +11 -11
  11. data/ext/nokogiri/extconf.rb +1 -1
  12. data/ext/nokogiri/html_element_description.c +14 -14
  13. data/ext/nokogiri/xml_cdata.c +6 -4
  14. data/ext/nokogiri/xml_document.c +2 -3
  15. data/ext/nokogiri/xml_dtd.c +2 -2
  16. data/ext/nokogiri/xml_io.c +1 -0
  17. data/ext/nokogiri/xml_namespace.c +3 -9
  18. data/ext/nokogiri/xml_namespace.h +2 -0
  19. data/ext/nokogiri/xml_node.c +23 -15
  20. data/ext/nokogiri/xml_node_set.c +5 -4
  21. data/ext/nokogiri/xml_node_set.h +0 -1
  22. data/ext/nokogiri/xslt_stylesheet.c +2 -2
  23. data/lib/nokogiri/css/parser.rb +108 -90
  24. data/lib/nokogiri/css/parser.y +13 -2
  25. data/lib/nokogiri/css/tokenizer.rb +1 -1
  26. data/lib/nokogiri/css/tokenizer.rex +4 -4
  27. data/lib/nokogiri/css/xpath_visitor.rb +10 -3
  28. data/lib/nokogiri/html/document_fragment.rb +11 -1
  29. data/lib/nokogiri/version.rb +1 -1
  30. data/lib/nokogiri/xml/node.rb +58 -0
  31. data/lib/nokogiri/xml/node_set.rb +32 -18
  32. data/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch +78 -0
  33. data/ports/archives/libxml2-2.9.8.tar.gz +0 -0
  34. data/test/css/test_nthiness.rb +21 -21
  35. data/test/css/test_parser.rb +17 -0
  36. data/test/html/test_attributes.rb +85 -0
  37. data/test/html/test_document_fragment.rb +7 -1
  38. data/test/test_css_cache.rb +5 -3
  39. data/test/xml/sax/test_parser.rb +9 -1
  40. data/test/xml/sax/test_push_parser.rb +60 -0
  41. data/test/xml/test_cdata.rb +1 -1
  42. data/test/xml/test_document.rb +5 -5
  43. data/test/xml/test_dtd.rb +4 -4
  44. data/test/xml/test_node.rb +89 -6
  45. data/test/xml/test_node_attributes.rb +3 -3
  46. data/test/xml/test_node_reparenting.rb +18 -0
  47. data/test/xml/test_node_set.rb +31 -4
  48. data/test/xml/test_reader.rb +13 -1
  49. data/test/xml/test_syntax_error.rb +3 -3
  50. data/test/xml/test_xpath.rb +8 -0
  51. metadata +25 -4
  52. data/ports/archives/libxml2-2.9.7.tar.gz +0 -0
@@ -17,15 +17,17 @@ static VALUE new(int argc, VALUE *argv, VALUE klass)
17
17
  VALUE content;
18
18
  VALUE rest;
19
19
  VALUE rb_node;
20
- const xmlChar *content_str;
21
- int content_str_len;
20
+ xmlChar *content_str = NULL;
21
+ int content_str_len = 0;
22
22
 
23
23
  rb_scan_args(argc, argv, "2*", &doc, &content, &rest);
24
24
 
25
25
  Data_Get_Struct(doc, xmlDoc, xml_doc);
26
26
 
27
- content_str = NIL_P(content) ? NULL : (const xmlChar *)StringValueCStr(content);
28
- content_str_len = (content_str == NULL) ? 0 : strlen(content_str);
27
+ if (!NIL_P(content)) {
28
+ content_str = (xmlChar *)StringValuePtr(content);
29
+ content_str_len = RSTRING_LEN(content);
30
+ }
29
31
 
30
32
  node = xmlNewCDataBlock(xml_doc->doc, content_str, content_str_len);
31
33
 
@@ -179,7 +179,7 @@ static VALUE set_encoding(VALUE self, VALUE encoding)
179
179
  Data_Get_Struct(self, xmlDoc, doc);
180
180
 
181
181
  if (doc->encoding)
182
- free((char *) doc->encoding); /* this may produce a gcc cast warning */
182
+ free((char *)(uintptr_t) doc->encoding); /* avoid gcc cast warning */
183
183
 
184
184
  doc->encoding = xmlStrdup((xmlChar *)StringValueCStr(encoding));
185
185
 
@@ -531,8 +531,7 @@ static VALUE canonicalize(int argc, VALUE* argv, VALUE self)
531
531
  ns = calloc((size_t)ns_len+1, sizeof(xmlChar *));
532
532
  for (i = 0 ; i < ns_len ; i++) {
533
533
  VALUE entry = rb_ary_entry(incl_ns, i);
534
- const char * ptr = StringValueCStr(entry);
535
- ns[i] = (xmlChar*) ptr;
534
+ ns[i] = (xmlChar*)StringValueCStr(entry);
536
535
  }
537
536
  }
538
537
 
@@ -1,6 +1,6 @@
1
1
  #include <xml_dtd.h>
2
2
 
3
- static void notation_copier(void *payload, void *data, xmlChar *name)
3
+ static void notation_copier(void *payload, void *data, const xmlChar *name)
4
4
  {
5
5
  VALUE hash = (VALUE)data;
6
6
  VALUE klass = rb_const_get(mNokogiriXml, rb_intern("Notation"));
@@ -17,7 +17,7 @@ static void notation_copier(void *payload, void *data, xmlChar *name)
17
17
  rb_hash_aset(hash, NOKOGIRI_STR_NEW2(name),notation);
18
18
  }
19
19
 
20
- static void element_copier(void *_payload, void *data, xmlChar *name)
20
+ static void element_copier(void *_payload, void *data, const xmlChar *name)
21
21
  {
22
22
  VALUE hash = (VALUE)data;
23
23
  xmlNodePtr payload = (xmlNodePtr)_payload;
@@ -21,6 +21,7 @@ int io_read_callback(void * ctx, char * buffer, int len) {
21
21
 
22
22
  if (NIL_P(string)) return 0;
23
23
  if (string == Qundef) return -1;
24
+ if (TYPE(string) != T_STRING) return -1;
24
25
 
25
26
  str_len = (size_t)RSTRING_LEN(string);
26
27
  safe_len = str_len > (size_t)len ? (size_t)len : str_len;
@@ -14,22 +14,16 @@ static void dealloc_namespace(xmlNsPtr ns)
14
14
  */
15
15
  NOKOGIRI_DEBUG_START(ns) ;
16
16
  if (ns->href) {
17
- xmlFree((xmlChar *)ns->href);
17
+ xmlFree((xmlChar *)(uintptr_t)ns->href);
18
18
  }
19
19
  if (ns->prefix) {
20
- xmlFree((xmlChar *)ns->prefix);
20
+ xmlFree((xmlChar *)(uintptr_t)ns->prefix);
21
21
  }
22
22
  xmlFree(ns);
23
23
  NOKOGIRI_DEBUG_END(ns) ;
24
24
  }
25
25
 
26
26
 
27
- int Nokogiri_namespace_eh(xmlNodePtr node)
28
- {
29
- return (node->type == XML_NAMESPACE_DECL);
30
- }
31
-
32
-
33
27
  /*
34
28
  * call-seq:
35
29
  * prefix
@@ -64,7 +58,7 @@ static VALUE href(VALUE self)
64
58
 
65
59
  static int part_of_an_xpath_node_set_eh(xmlNsPtr node)
66
60
  {
67
- return (node->next && ! Nokogiri_namespace_eh(node->next));
61
+ return (node->next && ! NOKOGIRI_NAMESPACE_EH(node->next));
68
62
  }
69
63
 
70
64
  VALUE Nokogiri_wrap_xml_namespace(xmlDocPtr doc, xmlNsPtr node)
@@ -10,4 +10,6 @@ extern VALUE cNokogiriXmlNamespace ;
10
10
  VALUE Nokogiri_wrap_xml_namespace(xmlDocPtr doc, xmlNsPtr node) ;
11
11
  VALUE Nokogiri_wrap_xml_namespace2(VALUE document, xmlNsPtr node) ;
12
12
 
13
+ #define NOKOGIRI_NAMESPACE_EH(node) ((node)->type == XML_NAMESPACE_DECL)
14
+
13
15
  #endif
@@ -168,18 +168,20 @@ static VALUE reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_rep
168
168
  case XML_DOCUMENT_NODE:
169
169
  case XML_HTML_DOCUMENT_NODE:
170
170
  switch (reparentee->type) {
171
- case XML_ELEMENT_NODE:
172
- case XML_PI_NODE:
173
- case XML_COMMENT_NODE:
174
- case XML_DOCUMENT_TYPE_NODE:
175
- /*
176
- * The DOM specification says no to adding text-like nodes
177
- * directly to a document, but we allow it for compatibility.
178
- */
179
- case XML_TEXT_NODE:
180
- case XML_CDATA_SECTION_NODE:
181
- case XML_ENTITY_REF_NODE:
182
- goto ok;
171
+ case XML_ELEMENT_NODE:
172
+ case XML_PI_NODE:
173
+ case XML_COMMENT_NODE:
174
+ case XML_DOCUMENT_TYPE_NODE:
175
+ /*
176
+ * The DOM specification says no to adding text-like nodes
177
+ * directly to a document, but we allow it for compatibility.
178
+ */
179
+ case XML_TEXT_NODE:
180
+ case XML_CDATA_SECTION_NODE:
181
+ case XML_ENTITY_REF_NODE:
182
+ goto ok;
183
+ default:
184
+ break;
183
185
  }
184
186
  break;
185
187
  case XML_DOCUMENT_FRAG_NODE:
@@ -193,6 +195,8 @@ static VALUE reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_rep
193
195
  case XML_CDATA_SECTION_NODE:
194
196
  case XML_ENTITY_REF_NODE:
195
197
  goto ok;
198
+ default:
199
+ break;
196
200
  }
197
201
  break;
198
202
  case XML_ATTRIBUTE_NODE:
@@ -200,6 +204,8 @@ static VALUE reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_rep
200
204
  case XML_TEXT_NODE:
201
205
  case XML_ENTITY_REF_NODE:
202
206
  goto ok;
207
+ default:
208
+ break;
203
209
  }
204
210
  break;
205
211
  case XML_TEXT_NODE:
@@ -210,6 +216,8 @@ static VALUE reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_rep
210
216
  * operation, we should inhibit it.
211
217
  */
212
218
  break;
219
+ default:
220
+ break;
213
221
  }
214
222
 
215
223
  rb_raise(rb_eArgError, "cannot reparent %s there", rb_obj_classname(reparentee_obj));
@@ -833,10 +841,10 @@ static VALUE set(VALUE self, VALUE property, VALUE value)
833
841
  static VALUE get(VALUE self, VALUE rattribute)
834
842
  {
835
843
  xmlNodePtr node;
836
- const xmlChar *value = 0;
844
+ xmlChar *value = 0;
837
845
  VALUE rvalue;
838
846
  xmlChar *colon;
839
- const xmlChar *attribute, *attr_name, *prefix;
847
+ xmlChar *attribute, *attr_name, *prefix;
840
848
  xmlNsPtr ns;
841
849
 
842
850
  if (NIL_P(rattribute)) return Qnil;
@@ -844,7 +852,7 @@ static VALUE get(VALUE self, VALUE rattribute)
844
852
  Data_Get_Struct(self, xmlNode, node);
845
853
  attribute = xmlCharStrdup(StringValueCStr(rattribute));
846
854
 
847
- colon = (xmlChar *)xmlStrchr(attribute, (const xmlChar)':');
855
+ colon = (xmlChar *)(uintptr_t)xmlStrchr(attribute, (const xmlChar)':');
848
856
  if (colon) {
849
857
  /* split the attribute string into separate prefix and name by
850
858
  * null-terminating the prefix at the colon */
@@ -50,7 +50,8 @@ static VALUE allocate(VALUE klass)
50
50
  * call-seq:
51
51
  * dup
52
52
  *
53
- * Duplicate this node set
53
+ * Duplicate this NodeSet. Note that the Nodes contained in the NodeSet are not
54
+ * duplicated (similar to how Array and other Enumerable classes work).
54
55
  */
55
56
  static VALUE duplicate(VALUE self)
56
57
  {
@@ -350,7 +351,7 @@ static VALUE unlink_nodeset(VALUE self)
350
351
 
351
352
  nodeNr = node_set->nodeNr ;
352
353
  for (j = 0 ; j < nodeNr ; j++) {
353
- if (! Nokogiri_namespace_eh(node_set->nodeTab[j])) {
354
+ if (! NOKOGIRI_NAMESPACE_EH(node_set->nodeTab[j])) {
354
355
  VALUE node ;
355
356
  xmlNodePtr node_ptr;
356
357
  node = Nokogiri_wrap_xml_node(Qnil, node_set->nodeTab[j]);
@@ -388,7 +389,7 @@ static void reify_node_set_namespaces(VALUE self)
388
389
  namespace_cache = rb_iv_get(self, "@namespace_cache");
389
390
 
390
391
  for (j = 0 ; j < node_set->nodeNr ; j++) {
391
- if (Nokogiri_namespace_eh(node_set->nodeTab[j])) {
392
+ if (NOKOGIRI_NAMESPACE_EH(node_set->nodeTab[j])) {
392
393
  rb_ary_push(namespace_cache, Nokogiri_wrap_xml_node_set_node(node_set->nodeTab[j], self));
393
394
  }
394
395
  }
@@ -420,7 +421,7 @@ VALUE Nokogiri_wrap_xml_node_set_node(xmlNodePtr node, VALUE node_set)
420
421
  {
421
422
  xmlDocPtr document ;
422
423
 
423
- if (Nokogiri_namespace_eh(node)) {
424
+ if (NOKOGIRI_NAMESPACE_EH(node)) {
424
425
  Data_Get_Struct(rb_iv_get(node_set, "@document"), xmlDoc, document);
425
426
  return Nokogiri_wrap_xml_namespace(document, (xmlNsPtr)node);
426
427
  } else {
@@ -8,6 +8,5 @@ extern VALUE cNokogiriXmlNodeSet ;
8
8
  VALUE Nokogiri_wrap_xml_node_set(xmlNodeSetPtr node_set, VALUE document) ;
9
9
  VALUE Nokogiri_wrap_xml_node_set_node(xmlNodePtr node, VALUE node_set) ;
10
10
  VALUE Nokogiri_wrap_xml_node_set_namespace(xmlNsPtr node, VALUE node_set) ;
11
- int Nokogiri_namespace_eh(xmlNodePtr node) ;
12
11
 
13
12
  #endif
@@ -214,7 +214,7 @@ static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
214
214
  (unsigned char *)StringValueCStr(method_name), uri, method_caller);
215
215
  }
216
216
 
217
- Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple,
217
+ Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple,
218
218
  wrapper);
219
219
  inst = rb_class_new_instance(0, NULL, obj);
220
220
  rb_ary_push(wrapper->func_instances, inst);
@@ -227,7 +227,7 @@ static void shutdownFunc(xsltTransformContextPtr ctxt,
227
227
  {
228
228
  nokogiriXsltStylesheetTuple *wrapper;
229
229
 
230
- Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple,
230
+ Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple,
231
231
  wrapper);
232
232
 
233
233
  rb_ary_clear(wrapper->func_instances);
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.12
3
+ # This file is automatically generated by Racc 1.4.14
4
4
  # from Racc grammer file "".
5
5
  #
6
6
 
@@ -17,103 +17,115 @@ module Nokogiri
17
17
  def unescape_css_identifier(identifier)
18
18
  identifier.gsub(/\\(?:([^0-9a-fA-F])|([0-9a-fA-F]{1,6})\s?)/){ |m| $1 || [$2.hex].pack('U') }
19
19
  end
20
+
21
+ def unescape_css_string(str)
22
+ str.gsub(/\\(?:([^0-9a-fA-F])|([0-9a-fA-F]{1,6})\s?)/) do |m|
23
+ if $1=="\n"
24
+ ''
25
+ else
26
+ $1 || [$2.hex].pack('U')
27
+ end
28
+ end
29
+ end
20
30
  ##### State transition tables begin ###
21
31
 
22
32
  racc_action_table = [
23
33
  24, 93, 56, 57, 33, 55, 94, 23, 24, 22,
24
- 12, 93, 33, 27, 35, 52, 88, 22, -23, 25,
25
- 92, 98, 23, 33, 26, 18, 20, 25, 27, 86,
34
+ 12, 93, 33, 27, 89, 52, 92, 22, -23, 25,
35
+ 109, 98, 23, 33, 26, 18, 20, 25, 27, -23,
26
36
  23, 24, 26, 18, 20, 33, 27, 11, 39, 24,
27
- 22, 23, 89, 33, 18, 101, 100, 27, 22, 12,
28
- 25, 24, 95, 23, 90, 26, 18, 20, 25, 27,
29
- 66, 23, 24, 26, 18, 20, 33, 27, 91, 90,
30
- 51, 22, 96, 85, 33, 26, 33, -23, 33, 56,
31
- 87, 25, 60, 99, 23, 74, 26, 18, 20, 39,
32
- 27, 39, 23, 39, 23, 18, 23, 18, 27, 18,
33
- 27, 33, 27, 33, 56, 87, 22, 60, 56, 87,
34
- 102, 60, 56, 87, 33, 60, 39, 24, 39, 23,
35
- 103, 23, 18, 20, 18, 27, 46, 27, 49, 39,
36
- 93, 44, 23, 105, 33, 18, 51, 45, 27, 33,
37
- -23, 26, 108, 56, 58, 109, 60, nil, nil, 39,
38
- nil, nil, 23, nil, 39, 18, nil, 23, 27, nil,
39
- 18, 20, nil, 27, 82, 83, nil, nil, nil, 82,
40
- 83, nil, nil, nil, nil, 78, 79, 80, nil, 81,
41
- 78, 79, 80, 77, 81, 4, 5, 10, 77, 4,
42
- 5, 43, nil, nil, nil, 6, nil, 8, 7, 6,
43
- nil, 8, 7, 4, 5, 10, nil, nil, nil, nil,
44
- nil, nil, nil, 6, nil, 8, 7 ]
37
+ 22, 23, 95, 33, 18, 91, 90, 27, 22, 12,
38
+ 25, 90, 96, 23, 33, 26, 18, 20, 25, 27,
39
+ -23, 23, 24, 26, 18, 20, 33, 27, 74, 39,
40
+ 99, 22, 23, 45, 24, 18, 33, 103, 27, 56,
41
+ 87, 25, 60, 46, 23, 49, 26, 18, 20, 104,
42
+ 27, 39, 24, 51, 23, 93, 44, 18, 26, 33,
43
+ 27, 66, 106, 56, 58, 110, 60, 33, 85, 33,
44
+ 86, 51, 56, 87, 39, 60, 26, 23, 88, 33,
45
+ 18, 20, 39, 27, 39, 23, 35, 23, 18, 33,
46
+ 18, 27, nil, 27, 39, nil, 33, 23, nil, nil,
47
+ 18, 22, nil, 27, 39, 101, 100, 23, 102, nil,
48
+ 18, 39, nil, 27, 23, 82, 83, 18, 20, nil,
49
+ 27, nil, nil, nil, 82, 83, 78, 79, 80, nil,
50
+ 81, nil, nil, nil, 77, 78, 79, 80, nil, 81,
51
+ 4, 5, 43, 77, 4, 5, 10, nil, 56, 87,
52
+ 6, 60, 8, 7, 6, nil, 8, 7, 4, 5,
53
+ 10, 56, 87, nil, 60, nil, nil, nil, 6, nil,
54
+ 8, 7 ]
45
55
 
46
56
  racc_action_check = [
47
- 42, 58, 24, 24, 42, 24, 57, 15, 43, 42,
48
- 64, 57, 43, 15, 11, 24, 53, 43, 58, 42,
49
- 56, 64, 42, 14, 42, 42, 42, 43, 42, 50,
50
- 43, 3, 43, 43, 43, 3, 43, 1, 14, 9,
51
- 3, 14, 54, 9, 14, 76, 76, 14, 9, 1,
52
- 3, 27, 59, 3, 60, 3, 3, 3, 9, 3,
53
- 27, 9, 12, 9, 9, 9, 12, 9, 55, 55,
54
- 27, 12, 61, 49, 28, 27, 62, 46, 30, 92,
55
- 92, 12, 92, 75, 12, 45, 12, 12, 12, 28,
56
- 12, 62, 28, 30, 62, 28, 30, 62, 28, 30,
57
- 62, 39, 30, 32, 90, 90, 39, 90, 51, 51,
58
- 84, 51, 93, 93, 31, 93, 39, 23, 32, 39,
59
- 86, 32, 39, 39, 32, 39, 23, 32, 23, 31,
60
- 87, 18, 31, 91, 29, 31, 23, 21, 31, 25,
61
- 22, 23, 94, 25, 25, 105, 25, nil, nil, 29,
62
- nil, nil, 29, nil, 25, 29, nil, 25, 29, nil,
63
- 25, 25, nil, 25, 48, 48, nil, nil, nil, 47,
64
- 47, nil, nil, nil, nil, 48, 48, 48, nil, 48,
65
- 47, 47, 47, 48, 47, 0, 0, 0, 47, 17,
66
- 17, 17, nil, nil, nil, 0, nil, 0, 0, 17,
67
- nil, 17, 17, 26, 26, 26, nil, nil, nil, nil,
68
- nil, nil, nil, 26, nil, 26, 26 ]
57
+ 3, 58, 24, 24, 3, 24, 57, 15, 42, 3,
58
+ 64, 57, 42, 15, 54, 24, 56, 42, 58, 3,
59
+ 94, 64, 3, 31, 3, 3, 3, 42, 3, 22,
60
+ 42, 9, 42, 42, 42, 9, 42, 1, 31, 43,
61
+ 9, 31, 59, 43, 31, 55, 55, 31, 43, 1,
62
+ 9, 60, 61, 9, 30, 9, 9, 9, 43, 9,
63
+ 46, 43, 12, 43, 43, 43, 12, 43, 45, 30,
64
+ 75, 12, 30, 21, 23, 30, 29, 84, 30, 93,
65
+ 93, 12, 93, 23, 12, 23, 12, 12, 12, 86,
66
+ 12, 29, 27, 23, 29, 87, 18, 29, 23, 25,
67
+ 29, 27, 91, 25, 25, 106, 25, 28, 49, 62,
68
+ 50, 27, 51, 51, 25, 51, 27, 25, 53, 14,
69
+ 25, 25, 28, 25, 62, 28, 11, 62, 28, 32,
70
+ 62, 28, nil, 62, 14, nil, 39, 14, nil, nil,
71
+ 14, 39, nil, 14, 32, 76, 76, 32, 76, nil,
72
+ 32, 39, nil, 32, 39, 47, 47, 39, 39, nil,
73
+ 39, nil, nil, nil, 48, 48, 47, 47, 47, nil,
74
+ 47, nil, nil, nil, 47, 48, 48, 48, nil, 48,
75
+ 17, 17, 17, 48, 0, 0, 0, nil, 90, 90,
76
+ 17, 90, 17, 17, 0, nil, 0, 0, 26, 26,
77
+ 26, 92, 92, nil, 92, nil, nil, nil, 26, nil,
78
+ 26, 26 ]
69
79
 
70
80
  racc_action_pointer = [
71
- 178, 37, nil, 29, nil, nil, nil, nil, nil, 37,
72
- nil, 14, 60, nil, 17, -17, nil, 182, 120, nil,
73
- nil, 108, 111, 115, -8, 133, 196, 49, 68, 128,
74
- 72, 108, 97, nil, nil, nil, nil, nil, nil, 95,
75
- nil, nil, -2, 6, nil, 74, 48, 166, 161, 48,
76
- 0, 98, nil, -7, 19, 57, 8, -1, -11, 29,
77
- 42, 49, 70, nil, -2, nil, nil, nil, nil, nil,
78
- nil, nil, nil, nil, nil, 58, 35, nil, nil, nil,
79
- nil, nil, nil, nil, 85, nil, 109, 118, nil, nil,
80
- 94, 126, 69, 102, 129, nil, nil, nil, nil, nil,
81
- nil, nil, nil, nil, nil, 132, nil, nil, nil, nil ]
81
+ 177, 37, nil, -2, nil, nil, nil, nil, nil, 29,
82
+ nil, 126, 60, nil, 113, -17, nil, 173, 85, nil,
83
+ nil, 44, 0, 72, -8, 93, 191, 90, 101, 70,
84
+ 48, 17, 123, nil, nil, nil, nil, nil, nil, 130,
85
+ nil, nil, 6, 37, nil, 57, 31, 152, 161, 83,
86
+ 81, 102, nil, 95, -9, 34, 4, -1, -11, 19,
87
+ 39, 29, 103, nil, -2, nil, nil, nil, nil, nil,
88
+ nil, nil, nil, nil, nil, 45, 135, nil, nil, nil,
89
+ nil, nil, nil, nil, 52, nil, 78, 83, nil, nil,
90
+ 178, 95, 191, 69, 7, nil, nil, nil, nil, nil,
91
+ nil, nil, nil, nil, nil, nil, 92, nil, nil, nil,
92
+ nil ]
82
93
 
83
94
  racc_action_default = [
84
- -74, -75, -2, -24, -4, -5, -6, -7, -8, -24,
85
- -73, -75, -24, -3, -47, -10, -13, -17, -75, -19,
86
- -20, -75, -22, -24, -75, -24, -74, -75, -53, -54,
87
- -55, -56, -57, -58, -14, 110, -1, -9, -46, -24,
88
- -11, -12, -24, -24, -18, -75, -29, -61, -61, -75,
89
- -75, -75, -30, -75, -75, -38, -39, -40, -22, -75,
90
- -38, -75, -70, -72, -75, -44, -45, -48, -49, -50,
91
- -51, -52, -15, -16, -21, -75, -75, -62, -63, -64,
92
- -65, -66, -67, -68, -75, -27, -75, -40, -31, -32,
93
- -75, -43, -75, -75, -75, -33, -69, -71, -34, -25,
94
- -59, -60, -26, -28, -35, -75, -36, -37, -42, -41 ]
95
+ -75, -76, -2, -24, -4, -5, -6, -7, -8, -24,
96
+ -74, -76, -24, -3, -47, -10, -13, -17, -76, -19,
97
+ -20, -76, -22, -24, -76, -24, -75, -76, -53, -54,
98
+ -55, -56, -57, -58, -14, 111, -1, -9, -46, -24,
99
+ -11, -12, -24, -24, -18, -76, -29, -62, -62, -76,
100
+ -76, -76, -30, -76, -76, -38, -39, -40, -22, -76,
101
+ -38, -76, -71, -73, -76, -44, -45, -48, -49, -50,
102
+ -51, -52, -15, -16, -21, -76, -76, -63, -64, -65,
103
+ -66, -67, -68, -69, -76, -27, -76, -40, -31, -32,
104
+ -76, -43, -76, -76, -76, -33, -70, -72, -34, -25,
105
+ -59, -60, -61, -26, -28, -35, -76, -36, -37, -42,
106
+ -41 ]
95
107
 
96
108
  racc_goto_table = [
97
- 53, 38, 13, 1, 41, 48, 62, 40, 34, 65,
98
- 50, 36, 63, 75, 84, 67, 68, 69, 70, 71,
99
- 62, 47, 37, 42, 54, nil, 63, nil, nil, 64,
109
+ 53, 38, 13, 1, 54, 48, 62, 42, 34, 65,
110
+ 37, 36, 63, 75, 84, 67, 68, 69, 70, 71,
111
+ 62, 40, 41, 50, 47, nil, 63, nil, nil, 64,
100
112
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
101
113
  nil, 72, 73, nil, nil, nil, nil, nil, nil, 97,
102
114
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
103
- nil, nil, nil, nil, nil, nil, 104, nil, 106, 107 ]
115
+ nil, nil, nil, nil, nil, nil, 105, nil, 107, 108 ]
104
116
 
105
117
  racc_goto_check = [
106
- 18, 12, 2, 1, 11, 9, 7, 10, 2, 9,
107
- 15, 2, 12, 17, 17, 12, 12, 12, 12, 12,
108
- 7, 16, 8, 5, 19, nil, 12, nil, nil, 1,
118
+ 18, 12, 2, 1, 19, 9, 7, 5, 2, 9,
119
+ 8, 2, 12, 17, 17, 12, 12, 12, 12, 12,
120
+ 7, 10, 11, 15, 16, nil, 12, nil, nil, 1,
109
121
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
110
122
  nil, 2, 2, nil, nil, nil, nil, nil, nil, 12,
111
123
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
112
124
  nil, nil, nil, nil, nil, nil, 18, nil, 18, 18 ]
113
125
 
114
126
  racc_goto_pointer = [
115
- nil, 3, -1, nil, nil, 6, nil, -19, 8, -18,
116
- -8, -11, -13, nil, nil, -13, -2, -34, -24, 0,
127
+ nil, 3, -1, nil, nil, -10, nil, -19, -4, -18,
128
+ 6, 7, -13, nil, nil, 0, 1, -34, -24, -20,
117
129
  nil, nil, nil, nil ]
118
130
 
119
131
  racc_goto_default = [
@@ -183,24 +195,25 @@ racc_reduce_table = [
183
195
  1, 51, :_reduce_58,
184
196
  2, 48, :_reduce_59,
185
197
  2, 48, :_reduce_60,
198
+ 2, 48, :_reduce_61,
186
199
  0, 48, :_reduce_none,
187
- 1, 53, :_reduce_62,
188
200
  1, 53, :_reduce_63,
189
201
  1, 53, :_reduce_64,
190
202
  1, 53, :_reduce_65,
191
203
  1, 53, :_reduce_66,
192
204
  1, 53, :_reduce_67,
193
205
  1, 53, :_reduce_68,
194
- 3, 52, :_reduce_69,
206
+ 1, 53, :_reduce_69,
207
+ 3, 52, :_reduce_70,
195
208
  1, 54, :_reduce_none,
196
209
  2, 54, :_reduce_none,
197
210
  1, 54, :_reduce_none,
198
211
  1, 35, :_reduce_none,
199
212
  0, 35, :_reduce_none ]
200
213
 
201
- racc_reduce_n = 75
214
+ racc_reduce_n = 76
202
215
 
203
- racc_shift_n = 110
216
+ racc_shift_n = 111
204
217
 
205
218
  racc_token_table = {
206
219
  false => 0,
@@ -661,60 +674,63 @@ def _reduce_58(val, _values, result)
661
674
  end
662
675
 
663
676
  def _reduce_59(val, _values, result)
664
- result = [val.first, val[1]]
677
+ result = [val.first, unescape_css_identifier(val[1])]
665
678
  result
666
679
  end
667
680
 
668
681
  def _reduce_60(val, _values, result)
682
+ result = [val.first, unescape_css_string(val[1])]
683
+ result
684
+ end
685
+
686
+ def _reduce_61(val, _values, result)
669
687
  result = [val.first, val[1]]
670
688
  result
671
689
  end
672
690
 
673
- # reduce 61 omitted
691
+ # reduce 62 omitted
674
692
 
675
- def _reduce_62(val, _values, result)
693
+ def _reduce_63(val, _values, result)
676
694
  result = :equal
677
695
  result
678
696
  end
679
697
 
680
- def _reduce_63(val, _values, result)
698
+ def _reduce_64(val, _values, result)
681
699
  result = :prefix_match
682
700
  result
683
701
  end
684
702
 
685
- def _reduce_64(val, _values, result)
703
+ def _reduce_65(val, _values, result)
686
704
  result = :suffix_match
687
705
  result
688
706
  end
689
707
 
690
- def _reduce_65(val, _values, result)
708
+ def _reduce_66(val, _values, result)
691
709
  result = :substring_match
692
710
  result
693
711
  end
694
712
 
695
- def _reduce_66(val, _values, result)
713
+ def _reduce_67(val, _values, result)
696
714
  result = :not_equal
697
715
  result
698
716
  end
699
717
 
700
- def _reduce_67(val, _values, result)
718
+ def _reduce_68(val, _values, result)
701
719
  result = :includes
702
720
  result
703
721
  end
704
722
 
705
- def _reduce_68(val, _values, result)
723
+ def _reduce_69(val, _values, result)
706
724
  result = :dash_match
707
725
  result
708
726
  end
709
727
 
710
- def _reduce_69(val, _values, result)
728
+ def _reduce_70(val, _values, result)
711
729
  result = Node.new(:NOT, [val[1]])
712
730
 
713
731
  result
714
732
  end
715
733
 
716
- # reduce 70 omitted
717
-
718
734
  # reduce 71 omitted
719
735
 
720
736
  # reduce 72 omitted
@@ -723,6 +739,8 @@ end
723
739
 
724
740
  # reduce 74 omitted
725
741
 
742
+ # reduce 75 omitted
743
+
726
744
  def _reduce_none(val, _values, result)
727
745
  val[0]
728
746
  end