nokogiri-maglev- 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/CHANGELOG.ja.rdoc +35 -0
  2. data/CHANGELOG.rdoc +33 -2
  3. data/Manifest.txt +11 -3
  4. data/README.rdoc +1 -1
  5. data/ROADMAP.md +86 -0
  6. data/{nokogiri_help_responses.md → STANDARD_RESPONSES.md} +11 -4
  7. data/Y_U_NO_GEMSPEC.md +155 -0
  8. data/build_all +58 -0
  9. data/ext/nokogiri/extconf.rb +1 -1
  10. data/ext/nokogiri/nokogiri.c +1 -1
  11. data/ext/nokogiri/xml_io.c +1 -1
  12. data/ext/nokogiri/xml_namespace.c +0 -6
  13. data/ext/nokogiri/xml_node.c +11 -11
  14. data/ext/nokogiri/xml_node_set.c +1 -1
  15. data/ext/nokogiri/xml_xpath_context.c +31 -27
  16. data/ext/nokogiri/xml_xpath_context.h +1 -0
  17. data/ext/nokogiri/xslt_stylesheet.c +7 -64
  18. data/lib/nokogiri/css/node.rb +3 -0
  19. data/lib/nokogiri/css/parser.rb +238 -201
  20. data/lib/nokogiri/css/parser.y +20 -2
  21. data/lib/nokogiri/css/xpath_visitor.rb +2 -2
  22. data/lib/nokogiri/html/document.rb +2 -1
  23. data/lib/nokogiri/html/element_description_defaults.rb +1 -1
  24. data/lib/nokogiri/version.rb +1 -1
  25. data/lib/nokogiri/xml/document.rb +1 -1
  26. data/lib/nokogiri/xml/parse_options.rb +2 -2
  27. data/lib/nokogiri/xml/sax/document.rb +1 -1
  28. data/lib/nokogiri/xml/sax/parser.rb +1 -1
  29. data/lib/nokogiri/xslt.rb +1 -1
  30. data/test/css/test_parser.rb +38 -0
  31. data/test/files/to_be_xincluded.xml +2 -0
  32. data/test/files/xinclude.xml +4 -0
  33. data/test/helper.rb +18 -45
  34. data/test/html/sax/test_parser.rb +5 -3
  35. data/test/html/sax/test_parser_context.rb +8 -10
  36. data/test/html/test_document.rb +19 -5
  37. data/test/html/test_node.rb +2 -4
  38. data/test/test_reader.rb +63 -0
  39. data/test/test_xslt_transforms.rb +3 -1
  40. data/test/xml/sax/test_parser_context.rb +10 -17
  41. data/test/xml/sax/test_push_parser.rb +1 -0
  42. data/test/xml/test_attr.rb +5 -6
  43. data/test/xml/test_builder.rb +5 -6
  44. data/test/xml/test_cdata.rb +1 -3
  45. data/test/xml/test_document.rb +11 -14
  46. data/test/xml/test_document_encoding.rb +3 -1
  47. data/test/xml/test_document_fragment.rb +27 -8
  48. data/test/xml/test_node.rb +21 -0
  49. data/test/xml/test_node_set.rb +2 -2
  50. data/test/xml/test_text.rb +1 -3
  51. data/test/xml/test_unparented_node.rb +2 -2
  52. data/test/xml/test_xpath.rb +15 -6
  53. data/test/xslt/test_custom_functions.rb +35 -0
  54. data/test_all +84 -0
  55. metadata +53 -47
@@ -104,7 +104,7 @@ pkg_config('libxslt') if RUBY_PLATFORM =~ /mingw/
104
104
  asplode "libxml2" unless find_header('libxml/parser.h')
105
105
  asplode "libxslt" unless find_header('libxslt/xslt.h')
106
106
  asplode "libexslt" unless find_header('libexslt/exslt.h')
107
- # asplode "libiconv" unless have_func('iconv_open', 'iconv.h') or have_library('iconv', 'iconv_open', 'iconv.h')
107
+ # asplode "libiconv" unless have_func('iconv_open', 'iconv.h') or have_library('iconv', 'iconv_open', 'iconv.h') or find_library('iconv', 'iconv_open', 'iconv.h')
108
108
  asplode "libxml2" unless find_library("#{lib_prefix}xml2", 'xmlParseDoc')
109
109
  asplode "libxslt" unless find_library("#{lib_prefix}xslt", 'xsltParseStylesheetDoc')
110
110
  asplode "libexslt" unless find_library("#{lib_prefix}exslt", 'exsltFuncRegister')
@@ -45,7 +45,7 @@ void vasprintf_free (void *p)
45
45
 
46
46
  void Init_nokogiri()
47
47
  {
48
- #if !(defined __MACRUBY__) && !(defined MAGLEV)
48
+ #if !defined(__MACRUBY__) && !defined(MAGLEV)
49
49
  xmlMemSetup(
50
50
  (xmlFreeFunc)ruby_xfree,
51
51
  (xmlMallocFunc)ruby_xmalloc,
@@ -25,7 +25,7 @@ int io_read_callback(void * ctx, char * buffer, int len) {
25
25
  safe_len = str_len > (size_t)len ? (size_t)len : str_len;
26
26
  memcpy(buffer, StringValuePtr(string), safe_len);
27
27
 
28
- return safe_len;
28
+ return (int)safe_len;
29
29
  }
30
30
 
31
31
  VALUE write_check(VALUE *args) {
@@ -11,13 +11,10 @@ VALUE cNokogiriXmlNamespace ;
11
11
  static VALUE prefix(VALUE self)
12
12
  {
13
13
  xmlNsPtr ns;
14
- xmlDocPtr doc;
15
14
 
16
15
  Data_Get_Struct(self, xmlNs, ns);
17
16
  if(!ns->prefix) return Qnil;
18
17
 
19
- Data_Get_Struct(rb_iv_get(self, "@document"), xmlDoc, doc);
20
-
21
18
  return NOKOGIRI_STR_NEW2(ns->prefix);
22
19
  }
23
20
 
@@ -30,13 +27,10 @@ static VALUE prefix(VALUE self)
30
27
  static VALUE href(VALUE self)
31
28
  {
32
29
  xmlNsPtr ns;
33
- xmlDocPtr doc;
34
30
 
35
31
  Data_Get_Struct(self, xmlNs, ns);
36
32
  if(!ns->href) return Qnil;
37
33
 
38
- Data_Get_Struct(rb_iv_get(self, "@document"), xmlDoc, doc);
39
-
40
34
  return NOKOGIRI_STR_NEW2(ns->href);
41
35
  }
42
36
 
@@ -1219,7 +1219,7 @@ static VALUE process_xincludes(VALUE self, VALUE options)
1219
1219
  /* TODO: DOCUMENT ME */
1220
1220
  static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1221
1221
  {
1222
- xmlNodePtr node, list, child_iter, tmp, node_children, doc_children;
1222
+ xmlNodePtr node, list = 0, child_iter, node_children, doc_children;
1223
1223
  xmlNodeSetPtr set;
1224
1224
  xmlParserErrors error;
1225
1225
  VALUE doc, err;
@@ -1257,8 +1257,8 @@ static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1257
1257
  * is because if there were errors, it's possible for the child pointers
1258
1258
  * to be manipulated. */
1259
1259
  if (error != XML_ERR_OK) {
1260
- node->doc->children = doc_children;
1261
- node->children = node_children;
1260
+ node->doc->children = doc_children;
1261
+ node->children = node_children;
1262
1262
  }
1263
1263
 
1264
1264
  /* make sure parent/child pointers are coherent so an unlink will work
@@ -1266,9 +1266,9 @@ static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1266
1266
  */
1267
1267
  child_iter = node->doc->children ;
1268
1268
  while (child_iter) {
1269
- if (child_iter->parent != (xmlNodePtr)node->doc)
1270
- child_iter->parent = (xmlNodePtr)node->doc;
1271
- child_iter = child_iter->next;
1269
+ if (child_iter->parent != (xmlNodePtr)node->doc)
1270
+ child_iter->parent = (xmlNodePtr)node->doc;
1271
+ child_iter = child_iter->next;
1272
1272
  }
1273
1273
 
1274
1274
  #ifndef HTML_PARSE_NOIMPLIED
@@ -1285,12 +1285,12 @@ static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1285
1285
  * https://bugzilla.gnome.org/show_bug.cgi?id=668155
1286
1286
  */
1287
1287
  if (error != XML_ERR_OK && doc_is_empty && node->doc->children != NULL) {
1288
- tmp = node;
1289
- while (tmp->parent)
1290
- tmp = tmp->parent;
1288
+ child_iter = node;
1289
+ while (child_iter->parent)
1290
+ child_iter = child_iter->parent;
1291
1291
 
1292
- if (tmp->type == XML_DOCUMENT_FRAG_NODE)
1293
- node->doc->children = NULL;
1292
+ if (child_iter->type == XML_DOCUMENT_FRAG_NODE)
1293
+ node->doc->children = NULL;
1294
1294
  }
1295
1295
 
1296
1296
  /* FIXME: This probably needs to handle more constants... */
@@ -427,7 +427,7 @@ VALUE Nokogiri_wrap_xml_node_set(xmlNodeSetPtr node_set, VALUE document)
427
427
  rb_funcall(document, decorate, 1, new_set);
428
428
  }
429
429
 
430
- if (node_set->nodeTab) {
430
+ if (node_set && node_set->nodeTab) {
431
431
  for (i = 0; i < node_set->nodeNr; i++) {
432
432
  cur = node_set->nodeTab[i];
433
433
  if (cur && cur->type == XML_NAMESPACE_DECL) {
@@ -49,31 +49,23 @@ static VALUE register_variable(VALUE self, VALUE name, VALUE value)
49
49
  return self;
50
50
  }
51
51
 
52
- static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
52
+ void Nokogiri_marshal_xpath_funcall_and_return_values(xmlXPathParserContextPtr ctx, int nargs, VALUE handler, const char* function_name)
53
53
  {
54
- VALUE xpath_handler = Qnil;
55
- VALUE result;
56
- // VALUE *argv;
57
- VALUE doc;
54
+ int i;
55
+ VALUE result, doc;
56
+ VALUE *argv;
58
57
  VALUE node_set = Qnil;
59
58
  xmlNodeSetPtr xml_node_set = NULL;
60
59
  xmlXPathObjectPtr obj;
61
- int i;
62
60
  nokogiriNodeSetTuple *node_set_tuple;
63
61
 
64
- assert(ctx);
65
- assert(ctx->context);
66
- assert(ctx->context->userData);
67
62
  assert(ctx->context->doc);
68
63
  assert(DOC_RUBY_OBJECT_TEST(ctx->context->doc));
69
64
 
70
- xpath_handler = (VALUE)(ctx->context->userData);
71
-
72
- //argv = (VALUE *)calloc((size_t)nargs, sizeof(VALUE));
73
- //for (i = 0 ; i < nargs ; ++i) {
74
- // rb_gc_register_address(&argv[i]);
75
- //}
76
- VALUE argv = rb_ary_new2(nargs);
65
+ // argv = (VALUE *)calloc((size_t)nargs, sizeof(VALUE));
66
+ // for (i = 0 ; i < nargs ; ++i) {
67
+ // rb_gc_register_address(&argv[i]);
68
+ // }
77
69
 
78
70
  doc = DOC_RUBY_OBJECT(ctx->context->doc);
79
71
 
@@ -83,29 +75,25 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
83
75
  obj = valuePop(ctx);
84
76
  switch(obj->type) {
85
77
  case XPATH_STRING:
86
- rb_ary_store( argv, i, NOKOGIRI_STR_NEW2(obj->stringval));
78
+ rb_ary_store(argv, i, NOKOGIRI_STR_NEW2(obj->stringval));
87
79
  break;
88
80
  case XPATH_BOOLEAN:
89
- rb_ary_store( argv, i, obj->boolval == 1 ? Qtrue : Qfalse);
81
+ rb_ary_store(argv, i, obj->boolval == 1 ? Qtrue : Qfalse);
90
82
  break;
91
83
  case XPATH_NUMBER:
92
- rb_ary_store( argv, i, rb_float_new(obj->floatval));
84
+ rb_ary_store(argv, i, rb_float_new(obj->floatval));
93
85
  break;
94
86
  case XPATH_NODESET:
95
- rb_ary_store( argv, i, Nokogiri_wrap_xml_node_set(obj->nodesetval, doc));
87
+ rb_ary_store(argv, i, Nokogiri_wrap_xml_node_set(obj->nodesetval, doc));
96
88
  break;
97
89
  default:
98
- rb_ary_store( argv, i, NOKOGIRI_STR_NEW2(xmlXPathCastToString(obj)));
90
+ rb_ary_store(argv, i, NOKOGIRI_STR_NEW2(xmlXPathCastToString(obj)));
99
91
  }
100
92
  xmlXPathFreeNodeSetList(obj);
101
93
  } while(i-- > 0);
102
94
  }
103
95
 
104
- result = rb_funcall2_(
105
- xpath_handler,
106
- rb_intern((const char *)ctx->context->function),
107
- nargs, argv
108
- );
96
+ result = rb_funcall2(handler, rb_intern((const char*)function_name), nargs, argv);
109
97
 
110
98
  // for (i = 0 ; i < nargs ; ++i) {
111
99
  // rb_gc_unregister_address(&argv[i]);
@@ -126,7 +114,7 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
126
114
  char *res_str = (char*)res_cstr;
127
115
  xmlXPathReturnString(
128
116
  ctx,
129
- xmlCharStrdup(StringValuePtr(res_str))
117
+ xmlCharStrdup(res_str)
130
118
  );
131
119
  }
132
120
  break;
@@ -162,6 +150,22 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
162
150
  }
163
151
  }
164
152
 
153
+ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
154
+ {
155
+ VALUE handler = Qnil;
156
+ const char *function = NULL ;
157
+
158
+ assert(ctx);
159
+ assert(ctx->context);
160
+ assert(ctx->context->userData);
161
+ assert(ctx->context->function);
162
+
163
+ handler = (VALUE)(ctx->context->userData);
164
+ function = (const char*)(ctx->context->function);
165
+
166
+ Nokogiri_marshal_xpath_funcall_and_return_values(ctx, nargs, handler, function);
167
+ }
168
+
165
169
  static xmlXPathFunction lookup( void *ctx,
166
170
  const xmlChar * name,
167
171
  const xmlChar* ns_uri )
@@ -4,6 +4,7 @@
4
4
  #include <nokogiri.h>
5
5
 
6
6
  void init_xml_xpath_context();
7
+ void Nokogiri_marshal_xpath_funcall_and_return_values(xmlXPathParserContextPtr ctx, int nargs, VALUE handler, const char* function_name) ;
7
8
 
8
9
  extern VALUE cNokogiriXmlXpathContext;
9
10
  #endif
@@ -168,74 +168,17 @@ static VALUE transform(int argc, VALUE* argv, VALUE self)
168
168
 
169
169
  static void method_caller(xmlXPathParserContextPtr ctxt, int nargs)
170
170
  {
171
- const xmlChar * function;
172
- const xmlChar * functionURI;
173
- size_t i, count;
174
-
171
+ VALUE handler;
172
+ const char *function_name;
175
173
  xsltTransformContextPtr transform;
176
- xmlXPathObjectPtr xpath;
177
- VALUE obj;
178
- VALUE *args;
179
- VALUE result;
174
+ const xmlChar *functionURI;
180
175
 
181
176
  transform = xsltXPathGetTransformContext(ctxt);
182
-
183
- function = ctxt->context->function;
184
177
  functionURI = ctxt->context->functionURI;
185
- obj = (VALUE)xsltGetExtData(transform, functionURI);
186
-
187
- count = (size_t)ctxt->valueNr;
188
- args = calloc(count, sizeof(VALUE *));
189
-
190
- for(i = 0; i < count; i++) {
191
- VALUE thing;
192
-
193
- xpath = valuePop(ctxt);
194
- switch(xpath->type) {
195
- case XPATH_STRING:
196
- thing = NOKOGIRI_STR_NEW2(xpath->stringval);
197
- break;
198
- case XPATH_NODESET:
199
- if(NULL == xpath->nodesetval) {
200
- thing = Nokogiri_wrap_xml_node_set(
201
- xmlXPathNodeSetCreate(NULL),
202
- DOC_RUBY_OBJECT(ctxt->context->doc));
203
- } else {
204
- thing = Nokogiri_wrap_xml_node_set(xpath->nodesetval,
205
- DOC_RUBY_OBJECT(ctxt->context->doc));
206
- }
207
- break;
208
- default:
209
- rb_raise(rb_eRuntimeError, "do not handle type: %d", xpath->type);
210
- }
211
- args[i] = thing;
212
- xmlFree(xpath);
213
- }
214
- result = rb_funcall3(obj, rb_intern((const char *)function), (int)count, args);
215
- free(args);
216
- switch(TYPE(result)) {
217
- case T_FLOAT:
218
- case T_BIGNUM:
219
- case T_FIXNUM:
220
- xmlXPathReturnNumber(ctxt, NUM2DBL(result));
221
- break;
222
- case T_STRING:
223
- xmlXPathReturnString(
224
- ctxt,
225
- xmlStrdup((xmlChar *)StringValuePtr(result))
226
- );
227
- break;
228
- case T_TRUE:
229
- xmlXPathReturnTrue(ctxt);
230
- break;
231
- case T_FALSE:
232
- xmlXPathReturnFalse(ctxt);
233
- break;
234
- case T_NIL:
235
- break;
236
- default:
237
- rb_raise(rb_eRuntimeError, "Invalid return type");
238
- }
178
+ handler = (VALUE)xsltGetExtData(transform, functionURI);
179
+ function_name = (const char*)(ctxt->context->function);
180
+
181
+ Nokogiri_marshal_xpath_funcall_and_return_values(ctxt, nargs, handler, (const char*)function_name);
239
182
  }
240
183
 
241
184
  static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
@@ -1,6 +1,8 @@
1
1
  module Nokogiri
2
2
  module CSS
3
3
  class Node
4
+ ALLOW_COMBINATOR_ON_SELF = [:DIRECT_ADJACENT_SELECTOR, :FOLLOWING_SELECTOR, :CHILD_SELECTOR]
5
+
4
6
  # Get the type of this node
5
7
  attr_accessor :type
6
8
  # Get the value of this node
@@ -21,6 +23,7 @@ module Nokogiri
21
23
  # Convert this CSS node to xpath with +prefix+ using +visitor+
22
24
  def to_xpath prefix = '//', visitor = XPathVisitor.new
23
25
  self.preprocess!
26
+ prefix = '.' if ALLOW_COMBINATOR_ON_SELF.include?(type) && value.first.nil?
24
27
  prefix + visitor.accept(self)
25
28
  end
26
29
 
@@ -14,168 +14,176 @@ module Nokogiri
14
14
  ##### State transition tables begin ###
15
15
 
16
16
  racc_action_table = [
17
- 13, 22, 47, 48, 21, 46, 84, 23, 13, 11,
18
- 12, 83, 21, 23, 66, 43, 16, 11, 86, 14,
19
- 21, 79, 12, 77, 15, 7, 9, 14, 16, 82,
20
- 12, 13, 15, 7, 9, 21, 16, 78, 12, 13,
21
- 11, 7, 85, 21, 16, 80, 47, 51, 11, 50,
22
- 14, 83, 21, 12, 21, 15, 7, 9, 14, 16,
23
- 27, 12, 21, 15, 7, 9, 21, 16, 87, 27,
24
- 12, 11, 12, 7, 21, 7, 16, 59, 16, 21,
25
- 12, 89, 13, 7, 12, 13, 16, 7, 9, -24,
26
- 16, 11, 12, 42, 54, 7, 92, 12, 16, 39,
27
- 7, 14, 94, 16, 14, 38, 15, 74, 75, 15,
28
- 91, 90, 74, 75, 47, 51, 27, 50, 70, 71,
29
- 72, 97, 73, 70, 71, 72, 69, 73, 31, 32,
30
- 34, 69, 47, 51, 98, 50, 47, 51, 33, 50,
31
- 36, 35, 81, 80 ]
17
+ 21, 4, 5, 7, 29, 4, 5, 7, 30, 19,
18
+ -26, 6, 21, 9, 8, 6, 29, 9, 8, 22,
19
+ 31, 19, 20, 21, 23, 15, 17, 29, 24, 83,
20
+ 31, 22, 19, 84, 20, 21, 23, 15, 17, 29,
21
+ 24, 92, 22, 85, 19, 20, 21, 23, 15, 17,
22
+ 20, 24, 82, 90, 22, 59, 24, 20, 89, 23,
23
+ 15, 17, 21, 24, 88, 22, 29, 4, 5, 7,
24
+ 23, 19, 71, 29, 91, 29, 86, 6, 19, 9,
25
+ 8, 22, 29, 29, 20, 89, 23, 15, 17, 35,
26
+ 24, 20, 29, 20, 15, 17, 15, 24, 35, 24,
27
+ 20, 20, 29, 15, 15, 93, 24, 24, 21, 64,
28
+ 20, 95, 29, 15, 97, 96, 24, 43, -26, 46,
29
+ 20, 52, 53, 15, 51, 98, 24, 22, 79, 80,
30
+ 20, 99, 23, 15, 48, 42, 24, 79, 80, 75,
31
+ 76, 77, 101, 78, 87, 86, 41, 74, 75, 76,
32
+ 77, 35, 78, 104, 52, 56, 74, 55, 52, 56,
33
+ 105, 55, 52, 56, nil, 55, 52, 56, nil, 55 ]
32
34
 
33
35
  racc_action_check = [
34
- 0, 1, 13, 13, 0, 13, 48, 52, 37, 0,
35
- 4, 48, 37, 1, 39, 13, 4, 37, 52, 0,
36
- 63, 45, 0, 42, 0, 0, 0, 37, 0, 47,
37
- 37, 23, 37, 37, 37, 23, 37, 44, 63, 15,
38
- 23, 63, 49, 15, 63, 50, 14, 14, 15, 14,
39
- 23, 51, 19, 23, 3, 23, 23, 23, 15, 23,
40
- 25, 15, 18, 15, 15, 15, 27, 15, 62, 3,
41
- 19, 27, 3, 19, 17, 3, 19, 22, 3, 20,
42
- 18, 67, 12, 18, 27, 16, 18, 27, 27, 11,
43
- 27, 12, 17, 12, 16, 17, 76, 20, 17, 10,
44
- 20, 12, 81, 20, 16, 7, 12, 40, 40, 16,
45
- 68, 68, 41, 41, 83, 83, 5, 83, 40, 40,
46
- 40, 84, 40, 41, 41, 41, 40, 41, 6, 6,
47
- 6, 41, 82, 82, 94, 82, 80, 80, 6, 80,
48
- 6, 6, 46, 46 ]
36
+ 0, 14, 14, 14, 0, 0, 0, 0, 1, 0,
37
+ 43, 14, 40, 14, 14, 0, 40, 0, 0, 0,
38
+ 1, 40, 0, 31, 0, 0, 0, 31, 0, 47,
39
+ 57, 40, 31, 49, 40, 13, 40, 40, 40, 13,
40
+ 40, 57, 31, 50, 13, 31, 24, 31, 31, 31,
41
+ 11, 31, 46, 53, 13, 24, 11, 13, 53, 13,
42
+ 13, 13, 23, 13, 52, 24, 23, 23, 23, 23,
43
+ 24, 23, 42, 35, 54, 28, 55, 23, 35, 23,
44
+ 23, 23, 27, 10, 23, 56, 23, 23, 23, 33,
45
+ 23, 35, 26, 28, 35, 35, 28, 35, 10, 28,
46
+ 27, 10, 25, 27, 10, 67, 27, 10, 20, 30,
47
+ 26, 72, 68, 26, 73, 73, 26, 20, 19, 20,
48
+ 25, 21, 21, 25, 21, 81, 25, 20, 45, 45,
49
+ 68, 83, 20, 68, 21, 18, 68, 44, 44, 45,
50
+ 45, 45, 87, 45, 51, 51, 15, 45, 44, 44,
51
+ 44, 12, 44, 90, 89, 89, 44, 89, 86, 86,
52
+ 101, 86, 88, 88, nil, 88, 22, 22, nil, 22 ]
49
53
 
50
54
  racc_action_pointer = [
51
- -2, 1, nil, 48, -14, 95, 121, 94, nil, nil,
52
- 70, 60, 80, -8, 36, 37, 83, 68, 56, 46,
53
- 73, nil, 77, 29, nil, 39, nil, 60, nil, nil,
54
- nil, nil, nil, nil, nil, nil, nil, 6, nil, 3,
55
- 104, 109, -2, nil, 14, -2, 131, 17, -1, 19,
56
- 33, 39, -5, nil, nil, nil, nil, nil, nil, nil,
57
- nil, nil, 45, 14, nil, nil, nil, 56, 100, nil,
58
- nil, nil, nil, nil, nil, nil, 71, nil, nil, nil,
59
- 126, 95, 122, 104, 108, nil, nil, nil, nil, nil,
60
- nil, nil, nil, nil, 121, nil, nil, nil, nil ]
55
+ -2, 8, nil, nil, nil, nil, nil, nil, nil, nil,
56
+ 77, 26, 130, 33, -6, 135, nil, nil, 106, 89,
57
+ 106, 111, 156, 60, 44, 96, 86, 76, 69, nil,
58
+ 109, 21, nil, 68, nil, 67, nil, nil, nil, nil,
59
+ 10, nil, 61, -19, 134, 125, 27, 0, nil, 10,
60
+ 20, 133, 52, 46, 51, 64, 73, 18, nil, nil,
61
+ nil, nil, nil, nil, nil, nil, nil, 82, 106, nil,
62
+ nil, nil, 86, 104, nil, nil, nil, nil, nil, nil,
63
+ nil, 100, nil, 120, nil, nil, 148, 135, 152, 144,
64
+ 140, nil, nil, nil, nil, nil, nil, nil, nil, nil,
65
+ nil, 147, nil, nil, nil, nil ]
61
66
 
62
67
  racc_action_default = [
63
- -25, -70, -2, -46, -12, -16, -18, -70, -20, -21,
64
- -70, -23, -25, -70, -70, -25, -70, -51, -52, -53,
65
- -54, -55, -70, -25, -9, -45, -11, -25, -13, -14,
66
- -15, -3, -4, -5, -6, -7, -8, -25, -19, -70,
67
- -58, -58, -70, -29, -70, -70, -37, -38, -39, -70,
68
- -37, -39, -70, -43, -44, -47, -48, -49, -50, 99,
69
- -1, -10, -70, -67, -69, -17, -22, -70, -70, -59,
70
- -60, -61, -62, -63, -64, -65, -70, -28, -30, -31,
71
- -70, -42, -70, -70, -70, -32, -33, -66, -68, -26,
72
- -56, -57, -27, -34, -70, -35, -36, -41, -40 ]
68
+ -27, -74, -2, -3, -4, -5, -6, -7, -8, -9,
69
+ -50, -13, -17, -27, -20, -74, -22, -23, -74, -25,
70
+ -27, -74, -74, -27, -74, -55, -56, -57, -58, -59,
71
+ -74, -27, -10, -49, -12, -27, -14, -15, -16, -18,
72
+ -27, -21, -74, -32, -62, -62, -74, -74, -33, -74,
73
+ -74, -41, -42, -43, -74, -41, -43, -74, -47, -48,
74
+ -51, -52, -53, -54, 106, -1, -11, -74, -71, -73,
75
+ -19, -24, -74, -74, -63, -64, -65, -66, -67, -68,
76
+ -69, -74, -30, -74, -34, -35, -74, -46, -74, -74,
77
+ -74, -36, -37, -70, -72, -28, -60, -61, -29, -31,
78
+ -38, -74, -39, -40, -45, -44 ]
73
79
 
74
80
  racc_goto_table = [
75
- 44, 49, 25, 26, 40, 30, 1, 41, 60, 67,
76
- 76, 53, 28, 29, 63, 24, 55, 56, 57, 58,
77
- 37, 52, 65, 45, 62, 61, 64, nil, nil, nil,
81
+ 49, 54, 33, 39, 36, 1, 34, 45, 38, 72,
82
+ 81, 58, 32, 37, 47, 44, 68, 60, 61, 62,
83
+ 63, 65, 40, 50, 67, nil, nil, 69, 57, 66,
84
+ 70, nil, nil, nil, nil, nil, nil, nil, nil, nil,
78
85
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
79
86
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
80
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
81
- nil, nil, 88, nil, nil, nil, nil, 93, nil, 95,
82
- 96 ]
87
+ 94, nil, nil, nil, nil, 100, nil, 102, 103 ]
83
88
 
84
89
  racc_goto_check = [
85
- 16, 16, 7, 8, 13, 8, 1, 9, 2, 15,
86
- 15, 9, 10, 11, 5, 6, 7, 7, 7, 7,
87
- 3, 1, 2, 17, 20, 8, 7, nil, nil, nil,
88
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
90
+ 18, 18, 8, 2, 11, 1, 9, 10, 9, 17,
91
+ 17, 10, 7, 12, 15, 16, 6, 8, 8, 8,
92
+ 8, 2, 4, 19, 22, nil, nil, 8, 1, 9,
93
+ 2, nil, nil, nil, nil, nil, nil, nil, nil, nil,
89
94
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
90
95
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
91
- nil, nil, 7, nil, nil, nil, nil, 16, nil, 16,
92
- 16 ]
96
+ 8, nil, nil, nil, nil, 18, nil, 18, 18 ]
93
97
 
94
98
  racc_goto_pointer = [
95
- nil, 6, -15, 14, nil, -13, 12, -1, 0, -5,
96
- 8, 9, nil, -8, nil, -31, -13, 10, nil, nil,
97
- -3 ]
99
+ nil, 5, -10, nil, 8, nil, -19, 2, -8, -4,
100
+ -13, -7, 2, nil, nil, -6, -5, -35, -21, 2,
101
+ nil, nil, -11 ]
98
102
 
99
103
  racc_goto_default = [
100
- nil, nil, 2, nil, 6, 3, nil, 5, nil, 4,
101
- 20, 19, 18, 8, 10, nil, nil, nil, 17, 68,
102
- nil ]
104
+ nil, nil, 3, 2, 13, 14, 10, nil, 12, nil,
105
+ 11, 28, 27, 26, 16, 18, nil, nil, nil, nil,
106
+ 25, 73, nil ]
103
107
 
104
108
  racc_reduce_table = [
105
109
  0, 0, :racc_error,
106
110
  3, 32, :_reduce_1,
107
111
  1, 32, :_reduce_2,
108
- 1, 34, :_reduce_3,
109
- 1, 34, :_reduce_4,
110
- 1, 34, :_reduce_5,
111
- 1, 34, :_reduce_6,
112
- 1, 34, :_reduce_7,
113
- 1, 34, :_reduce_8,
114
- 2, 35, :_reduce_9,
115
- 3, 35, :_reduce_10,
116
- 2, 35, :_reduce_11,
117
- 1, 35, :_reduce_none,
118
- 2, 35, :_reduce_13,
119
- 2, 35, :_reduce_14,
120
- 2, 35, :_reduce_15,
121
- 1, 35, :_reduce_16,
122
- 3, 33, :_reduce_17,
123
- 1, 33, :_reduce_none,
124
- 2, 43, :_reduce_19,
112
+ 1, 32, :_reduce_3,
113
+ 1, 35, :_reduce_4,
114
+ 1, 35, :_reduce_5,
115
+ 1, 35, :_reduce_6,
116
+ 1, 35, :_reduce_7,
117
+ 1, 35, :_reduce_8,
118
+ 1, 35, :_reduce_9,
119
+ 2, 36, :_reduce_10,
120
+ 3, 36, :_reduce_11,
121
+ 2, 36, :_reduce_12,
125
122
  1, 36, :_reduce_none,
126
- 1, 36, :_reduce_21,
127
- 3, 44, :_reduce_22,
128
- 1, 44, :_reduce_23,
129
- 1, 45, :_reduce_24,
130
- 0, 45, :_reduce_none,
131
- 4, 42, :_reduce_26,
132
- 4, 42, :_reduce_27,
133
- 3, 42, :_reduce_28,
134
- 2, 40, :_reduce_29,
135
- 3, 40, :_reduce_30,
136
- 3, 40, :_reduce_31,
137
- 3, 40, :_reduce_32,
138
- 3, 40, :_reduce_33,
139
- 3, 47, :_reduce_34,
140
- 3, 47, :_reduce_35,
141
- 3, 47, :_reduce_36,
142
- 1, 47, :_reduce_none,
143
- 1, 47, :_reduce_none,
144
- 1, 47, :_reduce_39,
145
- 4, 48, :_reduce_40,
146
- 3, 48, :_reduce_41,
147
- 2, 48, :_reduce_42,
148
- 2, 41, :_reduce_43,
149
- 2, 41, :_reduce_44,
123
+ 2, 36, :_reduce_14,
124
+ 2, 36, :_reduce_15,
125
+ 2, 36, :_reduce_16,
126
+ 1, 36, :_reduce_17,
127
+ 2, 34, :_reduce_18,
128
+ 3, 33, :_reduce_19,
129
+ 1, 33, :_reduce_none,
130
+ 2, 44, :_reduce_21,
150
131
  1, 37, :_reduce_none,
151
- 0, 37, :_reduce_none,
152
- 2, 38, :_reduce_47,
153
- 2, 38, :_reduce_48,
154
- 2, 38, :_reduce_49,
155
- 2, 38, :_reduce_50,
156
- 1, 38, :_reduce_none,
157
- 1, 38, :_reduce_none,
158
- 1, 38, :_reduce_none,
159
- 1, 38, :_reduce_none,
160
- 1, 49, :_reduce_55,
161
- 2, 46, :_reduce_56,
162
- 2, 46, :_reduce_57,
132
+ 1, 37, :_reduce_23,
133
+ 3, 45, :_reduce_24,
134
+ 1, 45, :_reduce_25,
135
+ 1, 46, :_reduce_26,
163
136
  0, 46, :_reduce_none,
164
- 1, 50, :_reduce_59,
165
- 1, 50, :_reduce_60,
166
- 1, 50, :_reduce_61,
167
- 1, 50, :_reduce_62,
168
- 1, 50, :_reduce_63,
169
- 1, 50, :_reduce_64,
170
- 1, 50, :_reduce_65,
171
- 3, 39, :_reduce_66,
172
- 1, 51, :_reduce_none,
173
- 2, 51, :_reduce_none,
174
- 1, 51, :_reduce_none ]
175
-
176
- racc_reduce_n = 70
177
-
178
- racc_shift_n = 99
137
+ 4, 43, :_reduce_28,
138
+ 4, 43, :_reduce_29,
139
+ 3, 43, :_reduce_30,
140
+ 3, 47, :_reduce_31,
141
+ 1, 47, :_reduce_32,
142
+ 2, 41, :_reduce_33,
143
+ 3, 41, :_reduce_34,
144
+ 3, 41, :_reduce_35,
145
+ 3, 41, :_reduce_36,
146
+ 3, 41, :_reduce_37,
147
+ 3, 49, :_reduce_38,
148
+ 3, 49, :_reduce_39,
149
+ 3, 49, :_reduce_40,
150
+ 1, 49, :_reduce_none,
151
+ 1, 49, :_reduce_none,
152
+ 1, 49, :_reduce_43,
153
+ 4, 50, :_reduce_44,
154
+ 3, 50, :_reduce_45,
155
+ 2, 50, :_reduce_46,
156
+ 2, 42, :_reduce_47,
157
+ 2, 42, :_reduce_48,
158
+ 1, 38, :_reduce_none,
159
+ 0, 38, :_reduce_none,
160
+ 2, 39, :_reduce_51,
161
+ 2, 39, :_reduce_52,
162
+ 2, 39, :_reduce_53,
163
+ 2, 39, :_reduce_54,
164
+ 1, 39, :_reduce_none,
165
+ 1, 39, :_reduce_none,
166
+ 1, 39, :_reduce_none,
167
+ 1, 39, :_reduce_none,
168
+ 1, 51, :_reduce_59,
169
+ 2, 48, :_reduce_60,
170
+ 2, 48, :_reduce_61,
171
+ 0, 48, :_reduce_none,
172
+ 1, 52, :_reduce_63,
173
+ 1, 52, :_reduce_64,
174
+ 1, 52, :_reduce_65,
175
+ 1, 52, :_reduce_66,
176
+ 1, 52, :_reduce_67,
177
+ 1, 52, :_reduce_68,
178
+ 1, 52, :_reduce_69,
179
+ 3, 40, :_reduce_70,
180
+ 1, 53, :_reduce_none,
181
+ 2, 53, :_reduce_none,
182
+ 1, 53, :_reduce_none ]
183
+
184
+ racc_reduce_n = 74
185
+
186
+ racc_shift_n = 106
179
187
 
180
188
  racc_token_table = {
181
189
  false => 0,
@@ -265,6 +273,7 @@ Racc_token_to_s_table = [
265
273
  "$start",
266
274
  "selector",
267
275
  "simple_selector_1toN",
276
+ "prefixless_combinator_selector",
268
277
  "combinator",
269
278
  "simple_selector",
270
279
  "element_name",
@@ -277,6 +286,7 @@ Racc_token_to_s_table = [
277
286
  "class",
278
287
  "namespaced_ident",
279
288
  "namespace",
289
+ "attrib_name",
280
290
  "attrib_val_0or1",
281
291
  "expr",
282
292
  "an_plus_b",
@@ -302,22 +312,22 @@ def _reduce_2(val, _values, result)
302
312
  end
303
313
 
304
314
  def _reduce_3(val, _values, result)
305
- result = :DIRECT_ADJACENT_SELECTOR
315
+ result = val.flatten
306
316
  result
307
317
  end
308
318
 
309
319
  def _reduce_4(val, _values, result)
310
- result = :CHILD_SELECTOR
320
+ result = :DIRECT_ADJACENT_SELECTOR
311
321
  result
312
322
  end
313
323
 
314
324
  def _reduce_5(val, _values, result)
315
- result = :PRECEDING_SELECTOR
325
+ result = :CHILD_SELECTOR
316
326
  result
317
327
  end
318
328
 
319
329
  def _reduce_6(val, _values, result)
320
- result = :DESCENDANT_SELECTOR
330
+ result = :FOLLOWING_SELECTOR
321
331
  result
322
332
  end
323
333
 
@@ -327,11 +337,16 @@ def _reduce_7(val, _values, result)
327
337
  end
328
338
 
329
339
  def _reduce_8(val, _values, result)
330
- result = :CHILD_SELECTOR
340
+ result = :DESCENDANT_SELECTOR
331
341
  result
332
342
  end
333
343
 
334
344
  def _reduce_9(val, _values, result)
345
+ result = :CHILD_SELECTOR
346
+ result
347
+ end
348
+
349
+ def _reduce_10(val, _values, result)
335
350
  result = if val[1].nil?
336
351
  val.first
337
352
  else
@@ -341,7 +356,7 @@ def _reduce_9(val, _values, result)
341
356
  result
342
357
  end
343
358
 
344
- def _reduce_10(val, _values, result)
359
+ def _reduce_11(val, _values, result)
345
360
  result = Node.new(:CONDITIONAL_SELECTOR,
346
361
  [
347
362
  val.first,
@@ -352,27 +367,27 @@ def _reduce_10(val, _values, result)
352
367
  result
353
368
  end
354
369
 
355
- def _reduce_11(val, _values, result)
370
+ def _reduce_12(val, _values, result)
356
371
  result = Node.new(:CONDITIONAL_SELECTOR, val)
357
372
 
358
373
  result
359
374
  end
360
375
 
361
- # reduce 12 omitted
376
+ # reduce 13 omitted
362
377
 
363
- def _reduce_13(val, _values, result)
378
+ def _reduce_14(val, _values, result)
364
379
  result = Node.new(:CONDITIONAL_SELECTOR, val)
365
380
 
366
381
  result
367
382
  end
368
383
 
369
- def _reduce_14(val, _values, result)
384
+ def _reduce_15(val, _values, result)
370
385
  result = Node.new(:CONDITIONAL_SELECTOR, val)
371
386
 
372
387
  result
373
388
  end
374
389
 
375
- def _reduce_15(val, _values, result)
390
+ def _reduce_16(val, _values, result)
376
391
  result = Node.new(:CONDITIONAL_SELECTOR,
377
392
  [
378
393
  Node.new(:ELEMENT_NAME, ['*']),
@@ -383,7 +398,7 @@ def _reduce_15(val, _values, result)
383
398
  result
384
399
  end
385
400
 
386
- def _reduce_16(val, _values, result)
401
+ def _reduce_17(val, _values, result)
387
402
  result = Node.new(:CONDITIONAL_SELECTOR,
388
403
  [Node.new(:ELEMENT_NAME, ['*']), val.first]
389
404
  )
@@ -391,27 +406,33 @@ def _reduce_16(val, _values, result)
391
406
  result
392
407
  end
393
408
 
394
- def _reduce_17(val, _values, result)
395
- result = Node.new(val[1], [val.first, val.last])
409
+ def _reduce_18(val, _values, result)
410
+ result = Node.new(val.first, [nil, val.last])
396
411
 
397
412
  result
398
413
  end
399
414
 
400
- # reduce 18 omitted
401
-
402
415
  def _reduce_19(val, _values, result)
403
- result = Node.new(:CLASS_CONDITION, [val[1]])
416
+ result = Node.new(val[1], [val.first, val.last])
417
+
404
418
  result
405
419
  end
406
420
 
407
421
  # reduce 20 omitted
408
422
 
409
423
  def _reduce_21(val, _values, result)
424
+ result = Node.new(:CLASS_CONDITION, [val[1]])
425
+ result
426
+ end
427
+
428
+ # reduce 22 omitted
429
+
430
+ def _reduce_23(val, _values, result)
410
431
  result = Node.new(:ELEMENT_NAME, val)
411
432
  result
412
433
  end
413
434
 
414
- def _reduce_22(val, _values, result)
435
+ def _reduce_24(val, _values, result)
415
436
  result = Node.new(:ELEMENT_NAME,
416
437
  [[val.first, val.last].compact.join(':')]
417
438
  )
@@ -419,21 +440,21 @@ def _reduce_22(val, _values, result)
419
440
  result
420
441
  end
421
442
 
422
- def _reduce_23(val, _values, result)
443
+ def _reduce_25(val, _values, result)
423
444
  name = @namespaces.key?('xmlns') ? "xmlns:#{val.first}" : val.first
424
445
  result = Node.new(:ELEMENT_NAME, [name])
425
446
 
426
447
  result
427
448
  end
428
449
 
429
- def _reduce_24(val, _values, result)
450
+ def _reduce_26(val, _values, result)
430
451
  result = val[0]
431
452
  result
432
453
  end
433
454
 
434
- # reduce 25 omitted
455
+ # reduce 27 omitted
435
456
 
436
- def _reduce_26(val, _values, result)
457
+ def _reduce_28(val, _values, result)
437
458
  result = Node.new(:ATTRIBUTE_CONDITION,
438
459
  [val[1]] + (val[2] || [])
439
460
  )
@@ -441,7 +462,7 @@ def _reduce_26(val, _values, result)
441
462
  result
442
463
  end
443
464
 
444
- def _reduce_27(val, _values, result)
465
+ def _reduce_29(val, _values, result)
445
466
  result = Node.new(:ATTRIBUTE_CONDITION,
446
467
  [val[1]] + (val[2] || [])
447
468
  )
@@ -449,7 +470,7 @@ def _reduce_27(val, _values, result)
449
470
  result
450
471
  end
451
472
 
452
- def _reduce_28(val, _values, result)
473
+ def _reduce_30(val, _values, result)
453
474
  # Non standard, but hpricot supports it.
454
475
  result = Node.new(:PSEUDO_CLASS,
455
476
  [Node.new(:FUNCTION, ['nth-child(', val[1]])]
@@ -458,56 +479,72 @@ def _reduce_28(val, _values, result)
458
479
  result
459
480
  end
460
481
 
461
- def _reduce_29(val, _values, result)
482
+ def _reduce_31(val, _values, result)
483
+ result = Node.new(:ELEMENT_NAME,
484
+ [[val.first, val.last].compact.join(':')]
485
+ )
486
+
487
+ result
488
+ end
489
+
490
+ def _reduce_32(val, _values, result)
491
+ # Default namespace is not applied to attributes.
492
+ # So we don't add prefix "xmlns:" as in namespaced_ident.
493
+ result = Node.new(:ELEMENT_NAME, [val.first])
494
+
495
+ result
496
+ end
497
+
498
+ def _reduce_33(val, _values, result)
462
499
  result = Node.new(:FUNCTION, [val.first.strip])
463
500
 
464
501
  result
465
502
  end
466
503
 
467
- def _reduce_30(val, _values, result)
504
+ def _reduce_34(val, _values, result)
468
505
  result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
469
506
 
470
507
  result
471
508
  end
472
509
 
473
- def _reduce_31(val, _values, result)
510
+ def _reduce_35(val, _values, result)
474
511
  result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
475
512
 
476
513
  result
477
514
  end
478
515
 
479
- def _reduce_32(val, _values, result)
516
+ def _reduce_36(val, _values, result)
480
517
  result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
481
518
 
482
519
  result
483
520
  end
484
521
 
485
- def _reduce_33(val, _values, result)
522
+ def _reduce_37(val, _values, result)
486
523
  result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
487
524
 
488
525
  result
489
526
  end
490
527
 
491
- def _reduce_34(val, _values, result)
528
+ def _reduce_38(val, _values, result)
492
529
  result = [val.first, val.last]
493
530
  result
494
531
  end
495
532
 
496
- def _reduce_35(val, _values, result)
533
+ def _reduce_39(val, _values, result)
497
534
  result = [val.first, val.last]
498
535
  result
499
536
  end
500
537
 
501
- def _reduce_36(val, _values, result)
538
+ def _reduce_40(val, _values, result)
502
539
  result = [val.first, val.last]
503
540
  result
504
541
  end
505
542
 
506
- # reduce 37 omitted
543
+ # reduce 41 omitted
507
544
 
508
- # reduce 38 omitted
545
+ # reduce 42 omitted
509
546
 
510
- def _reduce_39(val, _values, result)
547
+ def _reduce_43(val, _values, result)
511
548
  if val[0] == 'even'
512
549
  val = ["2","n","+","0"]
513
550
  result = Node.new(:AN_PLUS_B, val)
@@ -525,7 +562,7 @@ def _reduce_39(val, _values, result)
525
562
  result
526
563
  end
527
564
 
528
- def _reduce_40(val, _values, result)
565
+ def _reduce_44(val, _values, result)
529
566
  if val[1] == 'n'
530
567
  result = Node.new(:AN_PLUS_B, val)
531
568
  else
@@ -535,7 +572,7 @@ def _reduce_40(val, _values, result)
535
572
  result
536
573
  end
537
574
 
538
- def _reduce_41(val, _values, result)
575
+ def _reduce_45(val, _values, result)
539
576
  # n+3, -n+3
540
577
  if val[0] == 'n'
541
578
  val.unshift("1")
@@ -551,7 +588,7 @@ def _reduce_41(val, _values, result)
551
588
  result
552
589
  end
553
590
 
554
- def _reduce_42(val, _values, result)
591
+ def _reduce_46(val, _values, result)
555
592
  if val[1] == 'n'
556
593
  val << "+"
557
594
  val << "0"
@@ -563,116 +600,116 @@ def _reduce_42(val, _values, result)
563
600
  result
564
601
  end
565
602
 
566
- def _reduce_43(val, _values, result)
603
+ def _reduce_47(val, _values, result)
567
604
  result = Node.new(:PSEUDO_CLASS, [val[1]])
568
605
 
569
606
  result
570
607
  end
571
608
 
572
- def _reduce_44(val, _values, result)
609
+ def _reduce_48(val, _values, result)
573
610
  result = Node.new(:PSEUDO_CLASS, [val[1]])
574
611
  result
575
612
  end
576
613
 
577
- # reduce 45 omitted
614
+ # reduce 49 omitted
578
615
 
579
- # reduce 46 omitted
616
+ # reduce 50 omitted
580
617
 
581
- def _reduce_47(val, _values, result)
618
+ def _reduce_51(val, _values, result)
582
619
  result = Node.new(:COMBINATOR, val)
583
620
 
584
621
  result
585
622
  end
586
623
 
587
- def _reduce_48(val, _values, result)
624
+ def _reduce_52(val, _values, result)
588
625
  result = Node.new(:COMBINATOR, val)
589
626
 
590
627
  result
591
628
  end
592
629
 
593
- def _reduce_49(val, _values, result)
630
+ def _reduce_53(val, _values, result)
594
631
  result = Node.new(:COMBINATOR, val)
595
632
 
596
633
  result
597
634
  end
598
635
 
599
- def _reduce_50(val, _values, result)
636
+ def _reduce_54(val, _values, result)
600
637
  result = Node.new(:COMBINATOR, val)
601
638
 
602
639
  result
603
640
  end
604
641
 
605
- # reduce 51 omitted
642
+ # reduce 55 omitted
606
643
 
607
- # reduce 52 omitted
644
+ # reduce 56 omitted
608
645
 
609
- # reduce 53 omitted
646
+ # reduce 57 omitted
610
647
 
611
- # reduce 54 omitted
648
+ # reduce 58 omitted
612
649
 
613
- def _reduce_55(val, _values, result)
650
+ def _reduce_59(val, _values, result)
614
651
  result = Node.new(:ID, val)
615
652
  result
616
653
  end
617
654
 
618
- def _reduce_56(val, _values, result)
655
+ def _reduce_60(val, _values, result)
619
656
  result = [val.first, val[1]]
620
657
  result
621
658
  end
622
659
 
623
- def _reduce_57(val, _values, result)
660
+ def _reduce_61(val, _values, result)
624
661
  result = [val.first, val[1]]
625
662
  result
626
663
  end
627
664
 
628
- # reduce 58 omitted
665
+ # reduce 62 omitted
629
666
 
630
- def _reduce_59(val, _values, result)
667
+ def _reduce_63(val, _values, result)
631
668
  result = :equal
632
669
  result
633
670
  end
634
671
 
635
- def _reduce_60(val, _values, result)
672
+ def _reduce_64(val, _values, result)
636
673
  result = :prefix_match
637
674
  result
638
675
  end
639
676
 
640
- def _reduce_61(val, _values, result)
677
+ def _reduce_65(val, _values, result)
641
678
  result = :suffix_match
642
679
  result
643
680
  end
644
681
 
645
- def _reduce_62(val, _values, result)
682
+ def _reduce_66(val, _values, result)
646
683
  result = :substring_match
647
684
  result
648
685
  end
649
686
 
650
- def _reduce_63(val, _values, result)
687
+ def _reduce_67(val, _values, result)
651
688
  result = :not_equal
652
689
  result
653
690
  end
654
691
 
655
- def _reduce_64(val, _values, result)
692
+ def _reduce_68(val, _values, result)
656
693
  result = :includes
657
694
  result
658
695
  end
659
696
 
660
- def _reduce_65(val, _values, result)
697
+ def _reduce_69(val, _values, result)
661
698
  result = :dash_match
662
699
  result
663
700
  end
664
701
 
665
- def _reduce_66(val, _values, result)
702
+ def _reduce_70(val, _values, result)
666
703
  result = Node.new(:NOT, [val[1]])
667
704
 
668
705
  result
669
706
  end
670
707
 
671
- # reduce 67 omitted
708
+ # reduce 71 omitted
672
709
 
673
- # reduce 68 omitted
710
+ # reduce 72 omitted
674
711
 
675
- # reduce 69 omitted
712
+ # reduce 73 omitted
676
713
 
677
714
  def _reduce_none(val, _values, result)
678
715
  val[0]