nokogiri 1.6.3.1 → 1.6.4

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