nokogiri 1.5.0-java → 1.5.1-java
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- data/CHANGELOG.ja.rdoc +56 -12
- data/CHANGELOG.rdoc +45 -0
- data/C_CODING_STYLE.rdoc +27 -0
- data/Manifest.txt +4 -0
- data/README.rdoc +11 -7
- data/Rakefile +44 -26
- data/bin/nokogiri +10 -2
- data/ext/java/nokogiri/HtmlDocument.java +37 -2
- data/ext/java/nokogiri/NokogiriService.java +10 -2
- data/ext/java/nokogiri/XmlAttr.java +1 -1
- data/ext/java/nokogiri/XmlDocument.java +68 -11
- data/ext/java/nokogiri/XmlDocumentFragment.java +16 -5
- data/ext/java/nokogiri/XmlElement.java +0 -40
- data/ext/java/nokogiri/XmlNamespace.java +8 -1
- data/ext/java/nokogiri/XmlNode.java +131 -27
- data/ext/java/nokogiri/XmlNodeSet.java +4 -1
- data/ext/java/nokogiri/XmlSaxParserContext.java +2 -13
- data/ext/java/nokogiri/XmlXpathContext.java +4 -1
- data/ext/java/nokogiri/XsltStylesheet.java +198 -37
- data/ext/java/nokogiri/internals/HtmlDomParserContext.java +40 -2
- data/ext/java/nokogiri/internals/NokogiriHelpers.java +82 -9
- data/ext/java/nokogiri/internals/NokogiriXsltErrorListener.java +4 -3
- data/ext/java/nokogiri/internals/ParserContext.java +33 -3
- data/ext/java/nokogiri/internals/SaveContextVisitor.java +203 -12
- data/ext/java/nokogiri/internals/XmlDomParser.java +33 -2
- data/ext/java/nokogiri/internals/XmlDomParserContext.java +32 -12
- data/ext/nokogiri/extconf.rb +11 -3
- data/ext/nokogiri/html_document.c +16 -0
- data/ext/nokogiri/html_sax_parser_context.c +59 -37
- data/ext/nokogiri/html_sax_push_parser.c +87 -0
- data/ext/nokogiri/html_sax_push_parser.h +9 -0
- data/ext/nokogiri/nokogiri.c +6 -8
- data/ext/nokogiri/nokogiri.h +3 -0
- data/ext/nokogiri/xml_document.c +101 -3
- data/ext/nokogiri/xml_document.h +3 -3
- data/ext/nokogiri/xml_node.c +150 -58
- data/ext/nokogiri/xml_node_set.c +169 -120
- data/ext/nokogiri/xml_node_set.h +5 -0
- data/ext/nokogiri/xml_sax_parser_context.c +64 -41
- data/ext/nokogiri/xml_text.c +2 -0
- data/ext/nokogiri/xml_xpath_context.c +30 -24
- data/ext/nokogiri/xslt_stylesheet.c +62 -16
- data/ext/nokogiri/xslt_stylesheet.h +5 -0
- data/lib/nokogiri/css/parser.rb +163 -157
- data/lib/nokogiri/css/parser.y +6 -3
- data/lib/nokogiri/css/tokenizer.rb +1 -1
- data/lib/nokogiri/css/tokenizer.rex +1 -1
- data/lib/nokogiri/html.rb +1 -0
- data/lib/nokogiri/html/document.rb +82 -42
- data/lib/nokogiri/html/sax/push_parser.rb +16 -0
- data/lib/nokogiri/nokogiri.jar +0 -0
- data/lib/nokogiri/version.rb +1 -1
- data/lib/nokogiri/xml.rb +6 -0
- data/lib/nokogiri/xml/builder.rb +7 -1
- data/lib/nokogiri/xml/document.rb +32 -17
- data/lib/nokogiri/xml/document_fragment.rb +6 -1
- data/lib/nokogiri/xml/node.rb +40 -9
- data/lib/nokogiri/xslt.rb +5 -1
- data/tasks/cross_compile.rb +1 -0
- data/tasks/nokogiri.org.rb +6 -0
- data/tasks/test.rb +1 -0
- data/test/css/test_xpath_visitor.rb +6 -0
- data/test/helper.rb +1 -0
- data/test/html/test_document.rb +26 -0
- data/test/html/test_document_fragment.rb +1 -2
- data/test/test_memory_leak.rb +81 -1
- data/test/test_xslt_transforms.rb +152 -123
- data/test/xml/test_builder.rb +24 -2
- data/test/xml/test_c14n.rb +151 -0
- data/test/xml/test_document.rb +48 -0
- data/test/xml/test_namespace.rb +5 -0
- data/test/xml/test_node.rb +82 -1
- data/test/xml/test_node_attributes.rb +19 -0
- data/test/xml/test_node_inheritance.rb +32 -0
- data/test/xml/test_node_reparenting.rb +32 -0
- data/test/xml/test_node_set.rb +16 -8
- data/test/xml/test_reader_encoding.rb +16 -0
- data/test/xml/test_unparented_node.rb +32 -0
- data/test/xml/test_xinclude.rb +83 -0
- data/test/xml/test_xpath.rb +22 -0
- metadata +147 -123
@@ -19,20 +19,22 @@ static void deallocate(xmlParserCtxtPtr ctxt)
|
|
19
19
|
*
|
20
20
|
* Parse +io+ object with +encoding+
|
21
21
|
*/
|
22
|
-
static VALUE
|
22
|
+
static VALUE
|
23
|
+
parse_io(VALUE klass, VALUE io, VALUE encoding)
|
23
24
|
{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
25
|
+
xmlParserCtxtPtr ctxt;
|
26
|
+
xmlCharEncoding enc = (xmlCharEncoding)NUM2INT(encoding);
|
27
|
+
|
28
|
+
ctxt = xmlCreateIOParserCtxt(NULL, NULL,
|
29
|
+
(xmlInputReadCallback)io_read_callback,
|
30
|
+
(xmlInputCloseCallback)io_close_callback,
|
31
|
+
(void *)io, enc);
|
32
|
+
if (ctxt->sax) {
|
33
|
+
xmlFree(ctxt->sax);
|
34
|
+
ctxt->sax = NULL;
|
35
|
+
}
|
36
|
+
|
37
|
+
return Data_Wrap_Struct(klass, NULL, deallocate, ctxt);
|
36
38
|
}
|
37
39
|
|
38
40
|
/*
|
@@ -53,20 +55,44 @@ static VALUE parse_file(VALUE klass, VALUE filename)
|
|
53
55
|
*
|
54
56
|
* Parse the XML stored in memory in +data+
|
55
57
|
*/
|
56
|
-
static VALUE
|
58
|
+
static VALUE
|
59
|
+
parse_memory(VALUE klass, VALUE data)
|
57
60
|
{
|
58
|
-
|
61
|
+
xmlParserCtxtPtr ctxt;
|
59
62
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
+
if (NIL_P(data))
|
64
|
+
rb_raise(rb_eArgError, "data cannot be nil");
|
65
|
+
if (!(int)RSTRING_LEN(data))
|
66
|
+
rb_raise(rb_eRuntimeError, "data cannot be empty");
|
63
67
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
+
ctxt = xmlCreateMemoryParserCtxt(StringValuePtr(data),
|
69
|
+
(int)RSTRING_LEN(data));
|
70
|
+
if (ctxt->sax) {
|
71
|
+
xmlFree(ctxt->sax);
|
72
|
+
ctxt->sax = NULL;
|
73
|
+
}
|
68
74
|
|
69
|
-
|
75
|
+
return Data_Wrap_Struct(klass, NULL, deallocate, ctxt);
|
76
|
+
}
|
77
|
+
|
78
|
+
static VALUE
|
79
|
+
parse_doc(VALUE ctxt_val)
|
80
|
+
{
|
81
|
+
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctxt_val;
|
82
|
+
xmlParseDocument(ctxt);
|
83
|
+
return Qnil;
|
84
|
+
}
|
85
|
+
|
86
|
+
static VALUE
|
87
|
+
parse_doc_finalize(VALUE ctxt_val)
|
88
|
+
{
|
89
|
+
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctxt_val;
|
90
|
+
|
91
|
+
if (NULL != ctxt->myDoc)
|
92
|
+
xmlFreeDoc(ctxt->myDoc);
|
93
|
+
|
94
|
+
NOKOGIRI_SAX_TUPLE_DESTROY(ctxt->userData);
|
95
|
+
return Qnil;
|
70
96
|
}
|
71
97
|
|
72
98
|
/*
|
@@ -75,31 +101,28 @@ static VALUE parse_memory(VALUE klass, VALUE data)
|
|
75
101
|
*
|
76
102
|
* Use +sax_handler+ and parse the current document
|
77
103
|
*/
|
78
|
-
static VALUE
|
104
|
+
static VALUE
|
105
|
+
parse_with(VALUE self, VALUE sax_handler)
|
79
106
|
{
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
if(!rb_obj_is_kind_of(sax_handler, cNokogiriXmlSaxParser))
|
84
|
-
rb_raise(rb_eArgError, "argument must be a Nokogiri::XML::SAX::Parser");
|
85
|
-
|
86
|
-
Data_Get_Struct(self, xmlParserCtxt, ctxt);
|
87
|
-
Data_Get_Struct(sax_handler, xmlSAXHandler, sax);
|
107
|
+
xmlParserCtxtPtr ctxt;
|
108
|
+
xmlSAXHandlerPtr sax;
|
88
109
|
|
89
|
-
|
90
|
-
|
91
|
-
xmlFree(ctxt->sax);
|
110
|
+
if (!rb_obj_is_kind_of(sax_handler, cNokogiriXmlSaxParser))
|
111
|
+
rb_raise(rb_eArgError, "argument must be a Nokogiri::XML::SAX::Parser");
|
92
112
|
|
93
|
-
|
94
|
-
|
113
|
+
Data_Get_Struct(self, xmlParserCtxt, ctxt);
|
114
|
+
Data_Get_Struct(sax_handler, xmlSAXHandler, sax);
|
95
115
|
|
96
|
-
|
116
|
+
/* Free the sax handler since we'll assign our own */
|
117
|
+
if (ctxt->sax && ctxt->sax != (xmlSAXHandlerPtr)&xmlDefaultSAXHandler)
|
118
|
+
xmlFree(ctxt->sax);
|
97
119
|
|
98
|
-
|
120
|
+
ctxt->sax = sax;
|
121
|
+
ctxt->userData = (void *)NOKOGIRI_SAX_TUPLE_NEW(ctxt, sax_handler);
|
99
122
|
|
100
|
-
|
123
|
+
rb_ensure(parse_doc, (VALUE)ctxt, parse_doc_finalize, (VALUE)ctxt);
|
101
124
|
|
102
|
-
|
125
|
+
return Qnil;
|
103
126
|
}
|
104
127
|
|
105
128
|
/*
|
data/ext/nokogiri/xml_text.c
CHANGED
@@ -22,6 +22,8 @@ static VALUE new(int argc, VALUE *argv, VALUE klass)
|
|
22
22
|
node = xmlNewText((xmlChar *)StringValuePtr(string));
|
23
23
|
node->doc = doc->doc;
|
24
24
|
|
25
|
+
NOKOGIRI_ROOT_NODE(node);
|
26
|
+
|
25
27
|
rb_node = Nokogiri_wrap_xml_node(klass, node) ;
|
26
28
|
rb_obj_call_init(rb_node, argc, argv);
|
27
29
|
|
@@ -59,6 +59,7 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
|
|
59
59
|
xmlNodeSetPtr xml_node_set = NULL;
|
60
60
|
xmlXPathObjectPtr obj;
|
61
61
|
int i;
|
62
|
+
nokogiriNodeSetTuple *node_set_tuple;
|
62
63
|
|
63
64
|
assert(ctx);
|
64
65
|
assert(ctx->context);
|
@@ -75,27 +76,29 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
|
|
75
76
|
|
76
77
|
doc = DOC_RUBY_OBJECT(ctx->context->doc);
|
77
78
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
79
|
+
if (nargs > 0) {
|
80
|
+
i = nargs - 1;
|
81
|
+
do {
|
82
|
+
obj = valuePop(ctx);
|
83
|
+
switch(obj->type) {
|
84
|
+
case XPATH_STRING:
|
85
|
+
argv[i] = NOKOGIRI_STR_NEW2(obj->stringval);
|
86
|
+
break;
|
87
|
+
case XPATH_BOOLEAN:
|
88
|
+
argv[i] = obj->boolval == 1 ? Qtrue : Qfalse;
|
89
|
+
break;
|
90
|
+
case XPATH_NUMBER:
|
91
|
+
argv[i] = rb_float_new(obj->floatval);
|
92
|
+
break;
|
93
|
+
case XPATH_NODESET:
|
94
|
+
argv[i] = Nokogiri_wrap_xml_node_set(obj->nodesetval, doc);
|
95
|
+
break;
|
96
|
+
default:
|
97
|
+
argv[i] = NOKOGIRI_STR_NEW2(xmlXPathCastToString(obj));
|
98
|
+
}
|
99
|
+
xmlXPathFreeNodeSetList(obj);
|
100
|
+
} while(i-- > 0);
|
101
|
+
}
|
99
102
|
|
100
103
|
result = rb_funcall2(
|
101
104
|
xpath_handler,
|
@@ -118,7 +121,7 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
|
|
118
121
|
case T_STRING:
|
119
122
|
xmlXPathReturnString(
|
120
123
|
ctx,
|
121
|
-
(
|
124
|
+
xmlCharStrdup(StringValuePtr(result))
|
122
125
|
);
|
123
126
|
break;
|
124
127
|
case T_TRUE:
|
@@ -135,13 +138,15 @@ static void ruby_funcall(xmlXPathParserContextPtr ctx, int nargs)
|
|
135
138
|
args[0] = doc;
|
136
139
|
args[1] = result;
|
137
140
|
node_set = rb_class_new_instance(2, args, cNokogiriXmlNodeSet);
|
138
|
-
Data_Get_Struct(node_set,
|
141
|
+
Data_Get_Struct(node_set, nokogiriNodeSetTuple, node_set_tuple);
|
142
|
+
xml_node_set = node_set_tuple->node_set;
|
139
143
|
xmlXPathReturnNodeSet(ctx, xmlXPathNodeSetMerge(NULL, xml_node_set));
|
140
144
|
}
|
141
145
|
break;
|
142
146
|
case T_DATA:
|
143
147
|
if(rb_obj_is_kind_of(result, cNokogiriXmlNodeSet)) {
|
144
|
-
Data_Get_Struct(result,
|
148
|
+
Data_Get_Struct(result, nokogiriNodeSetTuple, node_set_tuple);
|
149
|
+
xml_node_set = node_set_tuple->node_set;
|
145
150
|
/* Copy the node set, otherwise it will get GC'd. */
|
146
151
|
xmlXPathReturnNodeSet(ctx, xmlXPathNodeSetMerge(NULL, xml_node_set));
|
147
152
|
break;
|
@@ -236,6 +241,7 @@ static VALUE evaluate(int argc, VALUE *argv, VALUE self)
|
|
236
241
|
switch(xpath->type) {
|
237
242
|
case XPATH_STRING:
|
238
243
|
thing = NOKOGIRI_STR_NEW2(xpath->stringval);
|
244
|
+
xmlFree(xpath->stringval);
|
239
245
|
break;
|
240
246
|
case XPATH_NODESET:
|
241
247
|
if(NULL == xpath->nodesetval) {
|
@@ -10,27 +10,49 @@ VALUE xslt;
|
|
10
10
|
int vasprintf (char **strp, const char *fmt, va_list ap);
|
11
11
|
void vasprintf_free (void *p);
|
12
12
|
|
13
|
-
static void
|
13
|
+
static void mark(nokogiriXsltStylesheetTuple *wrapper)
|
14
14
|
{
|
15
|
+
rb_gc_mark(wrapper->func_instances);
|
16
|
+
}
|
17
|
+
|
18
|
+
static void dealloc(nokogiriXsltStylesheetTuple *wrapper)
|
19
|
+
{
|
20
|
+
xsltStylesheetPtr doc = wrapper->ss;
|
21
|
+
|
15
22
|
NOKOGIRI_DEBUG_START(doc);
|
16
23
|
xsltFreeStylesheet(doc); /* commented out for now. */
|
17
24
|
NOKOGIRI_DEBUG_END(doc);
|
25
|
+
|
26
|
+
free(wrapper);
|
18
27
|
}
|
19
28
|
|
20
|
-
NORETURN(static void xslt_generic_error_handler(void * ctx, const char *msg, ...));
|
21
29
|
static void xslt_generic_error_handler(void * ctx, const char *msg, ...)
|
22
30
|
{
|
23
31
|
char * message;
|
24
|
-
VALUE exception;
|
25
32
|
|
26
33
|
va_list args;
|
27
34
|
va_start(args, msg);
|
28
35
|
vasprintf(&message, msg, args);
|
29
36
|
va_end(args);
|
30
37
|
|
31
|
-
|
38
|
+
rb_str_cat2((VALUE)ctx, message);
|
39
|
+
|
32
40
|
vasprintf_free(message);
|
33
|
-
|
41
|
+
}
|
42
|
+
|
43
|
+
VALUE Nokogiri_wrap_xslt_stylesheet(xsltStylesheetPtr ss)
|
44
|
+
{
|
45
|
+
VALUE self;
|
46
|
+
nokogiriXsltStylesheetTuple *wrapper;
|
47
|
+
|
48
|
+
self = Data_Make_Struct(cNokogiriXsltStylesheet, nokogiriXsltStylesheetTuple,
|
49
|
+
mark, dealloc, wrapper);
|
50
|
+
|
51
|
+
ss->_private = (void *)self;
|
52
|
+
wrapper->ss = ss;
|
53
|
+
wrapper->func_instances = rb_ary_new();
|
54
|
+
|
55
|
+
return self;
|
34
56
|
}
|
35
57
|
|
36
58
|
/*
|
@@ -41,18 +63,27 @@ static void xslt_generic_error_handler(void * ctx, const char *msg, ...)
|
|
41
63
|
*/
|
42
64
|
static VALUE parse_stylesheet_doc(VALUE klass, VALUE xmldocobj)
|
43
65
|
{
|
44
|
-
xmlDocPtr xml ;
|
66
|
+
xmlDocPtr xml, xml_cpy;
|
67
|
+
VALUE errstr, exception;
|
45
68
|
xsltStylesheetPtr ss ;
|
46
69
|
Data_Get_Struct(xmldocobj, xmlDoc, xml);
|
47
70
|
exsltRegisterAll();
|
48
71
|
|
49
|
-
|
72
|
+
errstr = rb_str_new(0, 0);
|
73
|
+
xsltSetGenericErrorFunc((void *)errstr, xslt_generic_error_handler);
|
50
74
|
|
51
|
-
|
75
|
+
xml_cpy = xmlCopyDoc(xml, 1); /* 1 => recursive */
|
76
|
+
ss = xsltParseStylesheetDoc(xml_cpy);
|
52
77
|
|
53
78
|
xsltSetGenericErrorFunc(NULL, NULL);
|
54
79
|
|
55
|
-
|
80
|
+
if (!ss) {
|
81
|
+
xmlFreeDoc(xml_cpy);
|
82
|
+
exception = rb_exc_new3(rb_eRuntimeError, errstr);
|
83
|
+
rb_exc_raise(exception);
|
84
|
+
}
|
85
|
+
|
86
|
+
return Nokogiri_wrap_xslt_stylesheet(ss);
|
56
87
|
}
|
57
88
|
|
58
89
|
|
@@ -65,14 +96,14 @@ static VALUE parse_stylesheet_doc(VALUE klass, VALUE xmldocobj)
|
|
65
96
|
static VALUE serialize(VALUE self, VALUE xmlobj)
|
66
97
|
{
|
67
98
|
xmlDocPtr xml ;
|
68
|
-
|
99
|
+
nokogiriXsltStylesheetTuple *wrapper;
|
69
100
|
xmlChar* doc_ptr ;
|
70
101
|
int doc_len ;
|
71
102
|
VALUE rval ;
|
72
103
|
|
73
104
|
Data_Get_Struct(xmlobj, xmlDoc, xml);
|
74
|
-
Data_Get_Struct(self,
|
75
|
-
xsltSaveResultToString(&doc_ptr, &doc_len, xml, ss);
|
105
|
+
Data_Get_Struct(self, nokogiriXsltStylesheetTuple, wrapper);
|
106
|
+
xsltSaveResultToString(&doc_ptr, &doc_len, xml, wrapper->ss);
|
76
107
|
rval = NOKOGIRI_STR_NEW(doc_ptr, doc_len);
|
77
108
|
xmlFree(doc_ptr);
|
78
109
|
return rval ;
|
@@ -98,7 +129,7 @@ static VALUE transform(int argc, VALUE* argv, VALUE self)
|
|
98
129
|
VALUE xmldoc, paramobj ;
|
99
130
|
xmlDocPtr xml ;
|
100
131
|
xmlDocPtr result ;
|
101
|
-
|
132
|
+
nokogiriXsltStylesheetTuple *wrapper;
|
102
133
|
const char** params ;
|
103
134
|
long param_len, j ;
|
104
135
|
|
@@ -116,7 +147,7 @@ static VALUE transform(int argc, VALUE* argv, VALUE self)
|
|
116
147
|
Check_Type(paramobj, T_ARRAY);
|
117
148
|
|
118
149
|
Data_Get_Struct(xmldoc, xmlDoc, xml);
|
119
|
-
Data_Get_Struct(self,
|
150
|
+
Data_Get_Struct(self, nokogiriXsltStylesheetTuple, wrapper);
|
120
151
|
|
121
152
|
param_len = RARRAY_LEN(paramobj);
|
122
153
|
params = calloc((size_t)param_len+1, sizeof(char*));
|
@@ -127,7 +158,7 @@ static VALUE transform(int argc, VALUE* argv, VALUE self)
|
|
127
158
|
}
|
128
159
|
params[param_len] = 0 ;
|
129
160
|
|
130
|
-
result = xsltApplyStylesheet(ss, xml, params);
|
161
|
+
result = xsltApplyStylesheet(wrapper->ss, xml, params);
|
131
162
|
free(params);
|
132
163
|
|
133
164
|
if (!result) rb_raise(rb_eRuntimeError, "could not perform xslt transform on document");
|
@@ -178,8 +209,10 @@ static void method_caller(xmlXPathParserContextPtr ctxt, int nargs)
|
|
178
209
|
rb_raise(rb_eRuntimeError, "do not handle type: %d", xpath->type);
|
179
210
|
}
|
180
211
|
args[i] = thing;
|
212
|
+
xmlFree(xpath);
|
181
213
|
}
|
182
214
|
result = rb_funcall3(obj, rb_intern((const char *)function), (int)count, args);
|
215
|
+
free(args);
|
183
216
|
switch(TYPE(result)) {
|
184
217
|
case T_FLOAT:
|
185
218
|
case T_BIGNUM:
|
@@ -211,6 +244,8 @@ static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
|
|
211
244
|
VALUE obj = rb_hash_aref(modules, rb_str_new2((const char *)uri));
|
212
245
|
VALUE args = { Qfalse };
|
213
246
|
VALUE methods = rb_funcall(obj, rb_intern("instance_methods"), 1, args);
|
247
|
+
VALUE inst;
|
248
|
+
nokogiriXsltStylesheetTuple *wrapper;
|
214
249
|
int i;
|
215
250
|
|
216
251
|
for(i = 0; i < RARRAY_LEN(methods); i++) {
|
@@ -219,12 +254,23 @@ static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
|
|
219
254
|
(unsigned char *)StringValuePtr(method_name), uri, method_caller);
|
220
255
|
}
|
221
256
|
|
222
|
-
|
257
|
+
Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple,
|
258
|
+
wrapper);
|
259
|
+
inst = rb_class_new_instance(0, NULL, obj);
|
260
|
+
rb_ary_push(wrapper->func_instances, inst);
|
261
|
+
|
262
|
+
return (void *)inst;
|
223
263
|
}
|
224
264
|
|
225
265
|
static void shutdownFunc(xsltTransformContextPtr ctxt,
|
226
266
|
const xmlChar *uri, void *data)
|
227
267
|
{
|
268
|
+
nokogiriXsltStylesheetTuple *wrapper;
|
269
|
+
|
270
|
+
Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple,
|
271
|
+
wrapper);
|
272
|
+
|
273
|
+
rb_ary_clear(wrapper->func_instances);
|
228
274
|
}
|
229
275
|
|
230
276
|
/*
|
data/lib/nokogiri/css/parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.7
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -14,90 +14,92 @@ module Nokogiri
|
|
14
14
|
##### State transition tables begin ###
|
15
15
|
|
16
16
|
racc_action_table = [
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
17
|
+
5, 57, 28, 23, 13, 25, 61, 58, 5, 1,
|
18
|
+
6, 60, 13, 58, 66, 24, 17, 1, 83, 20,
|
19
|
+
94, 93, 6, 13, 9, 11, 14, 20, 17, 42,
|
20
|
+
6, 5, 9, 11, 14, 13, 17, 76, 42, 5,
|
21
|
+
1, 6, 65, 13, 11, 62, 63, 17, 1, 60,
|
22
|
+
20, 5, 63, 6, 84, 9, 11, 14, 20, 17,
|
23
|
+
1, 6, 30, 9, 11, 14, 13, 17, 13, 85,
|
24
|
+
20, 1, 64, 13, 59, 9, 88, 13, 13, 89,
|
25
|
+
28, 54, 13, 55, 6, 42, 6, 11, 14, 11,
|
26
|
+
17, 6, 17, 45, 11, 6, 6, 17, 11, 11,
|
27
|
+
6, 17, 17, 11, 5, 92, 17, 69, 71, 28,
|
28
|
+
54, 22, 55, 50, 28, 54, 95, 55, 70, 72,
|
29
|
+
73, -24, 75, 20, 69, 71, 67, 97, 9, 98,
|
30
|
+
nil, nil, 34, 36, 38, 70, 72, 73, nil, 75,
|
31
|
+
nil, nil, 33, 67, 35, 37, 28, 54, nil, 55 ]
|
32
32
|
|
33
33
|
racc_action_check = [
|
34
|
-
0,
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
16,
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
34
|
+
0, 21, 5, 5, 0, 5, 23, 43, 9, 0,
|
35
|
+
15, 23, 9, 21, 28, 5, 15, 9, 43, 0,
|
36
|
+
74, 74, 0, 8, 0, 0, 0, 9, 0, 40,
|
37
|
+
9, 32, 9, 9, 9, 32, 9, 30, 8, 58,
|
38
|
+
32, 8, 27, 58, 8, 25, 25, 8, 58, 54,
|
39
|
+
32, 6, 55, 32, 56, 32, 32, 32, 58, 32,
|
40
|
+
6, 58, 6, 58, 58, 58, 42, 58, 80, 57,
|
41
|
+
6, 42, 26, 10, 22, 6, 61, 19, 18, 62,
|
42
|
+
60, 60, 16, 60, 42, 12, 80, 42, 42, 80,
|
43
|
+
42, 10, 80, 11, 10, 19, 18, 10, 19, 18,
|
44
|
+
16, 19, 18, 16, 17, 68, 16, 31, 31, 20,
|
45
|
+
20, 4, 20, 17, 63, 63, 77, 63, 31, 31,
|
46
|
+
31, 1, 31, 17, 29, 29, 31, 82, 17, 89,
|
47
|
+
nil, nil, 7, 7, 7, 29, 29, 29, nil, 29,
|
48
|
+
nil, nil, 7, 29, 7, 7, 66, 66, nil, 66 ]
|
49
49
|
|
50
50
|
racc_action_pointer = [
|
51
|
-
-2,
|
52
|
-
|
53
|
-
1,
|
54
|
-
|
55
|
-
nil,
|
56
|
-
nil, nil, nil,
|
57
|
-
|
58
|
-
nil, nil, nil, 10, nil, nil,
|
59
|
-
nil,
|
60
|
-
nil, nil, nil, nil, nil, nil, nil, nil ]
|
51
|
+
-2, 92, nil, nil, 82, -8, 49, 125, 17, 6,
|
52
|
+
67, 82, 64, nil, nil, -14, 76, 102, 72, 71,
|
53
|
+
99, 1, 63, -1, nil, 34, 49, 19, 2, 121,
|
54
|
+
12, 104, 29, nil, nil, nil, nil, nil, nil, nil,
|
55
|
+
8, nil, 60, -5, nil, nil, nil, nil, nil, nil,
|
56
|
+
nil, nil, nil, nil, 37, 40, 31, 69, 37, nil,
|
57
|
+
70, 63, 72, 104, nil, nil, 136, nil, 80, nil,
|
58
|
+
nil, nil, nil, nil, 10, nil, nil, 91, nil, nil,
|
59
|
+
62, nil, 104, nil, nil, nil, nil, nil, nil, 116,
|
60
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil ]
|
61
61
|
|
62
62
|
racc_action_default = [
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-11, -
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-34, -
|
63
|
+
-25, -23, -20, -2, -70, -70, -25, -18, -46, -25,
|
64
|
+
-51, -70, -16, -55, -21, -12, -54, -70, -53, -52,
|
65
|
+
-70, -70, -70, -39, -29, -37, -70, -70, -38, -58,
|
66
|
+
-70, -58, -25, -5, -3, -8, -4, -7, -6, -9,
|
67
|
+
-45, -11, -25, -70, -47, -19, -15, -13, -14, -50,
|
68
|
+
-44, -43, -49, -48, -39, -37, -70, -70, -25, -22,
|
69
|
+
-70, -70, -42, -70, -30, -31, -70, -59, -70, -64,
|
70
|
+
-60, -65, -61, -62, -70, -63, -28, -70, -17, -10,
|
71
|
+
-67, -69, -70, -33, -32, 99, -1, -36, -41, -70,
|
72
|
+
-34, -35, -26, -56, -57, -27, -68, -66, -40 ]
|
73
73
|
|
74
74
|
racc_goto_table = [
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
40, 26, 44, 41, 78, 21, 31, 46, 49, 29,
|
76
|
+
52, 53, 47, 68, 43, 77, 56, 51, 48, 39,
|
77
|
+
80, 32, 27, 82, nil, nil, nil, nil, nil, nil,
|
78
|
+
86, nil, nil, nil, 81, 79, nil, nil, nil, nil,
|
79
79
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
80
|
-
nil, nil, nil, nil, nil, nil,
|
81
|
-
|
82
|
-
nil, nil,
|
80
|
+
nil, nil, nil, nil, nil, nil, 87, nil, nil, 90,
|
81
|
+
nil, nil, 91, nil, nil, nil, nil, nil, nil, nil,
|
82
|
+
nil, nil, 96 ]
|
83
83
|
|
84
84
|
racc_goto_check = [
|
85
|
-
7, 7,
|
86
|
-
7, 7,
|
87
|
-
3,
|
85
|
+
7, 16, 7, 8, 2, 1, 9, 8, 7, 13,
|
86
|
+
7, 7, 10, 15, 1, 15, 16, 9, 11, 6,
|
87
|
+
5, 3, 17, 20, nil, nil, nil, nil, nil, nil,
|
88
88
|
2, nil, nil, nil, 7, 8, nil, nil, nil, nil,
|
89
89
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
90
|
-
nil, nil, nil, nil, nil, nil,
|
91
|
-
|
90
|
+
nil, nil, nil, nil, nil, nil, 16, nil, nil, 16,
|
91
|
+
nil, nil, 16, nil, nil, nil, nil, nil, nil, nil,
|
92
92
|
nil, nil, 7 ]
|
93
93
|
|
94
94
|
racc_goto_pointer = [
|
95
|
-
nil,
|
96
|
-
-
|
95
|
+
nil, 5, -28, 14, nil, -22, 11, -8, -5, 0,
|
96
|
+
-3, 3, nil, 3, nil, -16, -4, 17, nil, nil,
|
97
|
+
-19 ]
|
97
98
|
|
98
99
|
racc_goto_default = [
|
99
|
-
nil, nil, 3, nil,
|
100
|
-
|
100
|
+
nil, nil, 3, nil, 7, 8, nil, 12, nil, 15,
|
101
|
+
16, 18, 19, 2, 4, nil, nil, nil, 10, 74,
|
102
|
+
nil ]
|
101
103
|
|
102
104
|
racc_reduce_table = [
|
103
105
|
0, 0, :racc_error,
|
@@ -120,59 +122,60 @@ racc_reduce_table = [
|
|
120
122
|
3, 33, :_reduce_17,
|
121
123
|
1, 33, :_reduce_none,
|
122
124
|
2, 43, :_reduce_19,
|
123
|
-
|
125
|
+
1, 36, :_reduce_none,
|
124
126
|
1, 36, :_reduce_21,
|
125
|
-
|
127
|
+
3, 44, :_reduce_22,
|
126
128
|
1, 44, :_reduce_23,
|
127
|
-
|
128
|
-
|
129
|
+
1, 45, :_reduce_24,
|
130
|
+
0, 45, :_reduce_none,
|
129
131
|
4, 42, :_reduce_26,
|
130
|
-
|
131
|
-
|
132
|
-
|
132
|
+
4, 42, :_reduce_27,
|
133
|
+
3, 42, :_reduce_28,
|
134
|
+
2, 40, :_reduce_29,
|
133
135
|
3, 40, :_reduce_30,
|
134
136
|
3, 40, :_reduce_31,
|
135
137
|
3, 40, :_reduce_32,
|
136
|
-
3,
|
137
|
-
3,
|
138
|
-
3,
|
139
|
-
|
140
|
-
1,
|
141
|
-
1,
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
2,
|
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,
|
146
148
|
2, 41, :_reduce_43,
|
149
|
+
2, 41, :_reduce_44,
|
147
150
|
1, 37, :_reduce_none,
|
148
151
|
0, 37, :_reduce_none,
|
149
|
-
2, 38, :_reduce_46,
|
150
152
|
2, 38, :_reduce_47,
|
151
153
|
2, 38, :_reduce_48,
|
152
154
|
2, 38, :_reduce_49,
|
155
|
+
2, 38, :_reduce_50,
|
153
156
|
1, 38, :_reduce_none,
|
154
157
|
1, 38, :_reduce_none,
|
155
158
|
1, 38, :_reduce_none,
|
156
159
|
1, 38, :_reduce_none,
|
157
|
-
1,
|
158
|
-
2,
|
159
|
-
2,
|
160
|
-
0,
|
161
|
-
1,
|
162
|
-
1,
|
163
|
-
1,
|
164
|
-
1,
|
165
|
-
1,
|
166
|
-
1,
|
167
|
-
1,
|
168
|
-
3, 39, :
|
169
|
-
1,
|
170
|
-
2,
|
171
|
-
1,
|
172
|
-
|
173
|
-
racc_reduce_n =
|
174
|
-
|
175
|
-
racc_shift_n =
|
160
|
+
1, 49, :_reduce_55,
|
161
|
+
2, 46, :_reduce_56,
|
162
|
+
2, 46, :_reduce_57,
|
163
|
+
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
|
176
179
|
|
177
180
|
racc_token_table = {
|
178
181
|
false => 0,
|
@@ -203,8 +206,8 @@ racc_token_table = {
|
|
203
206
|
:RSQUARE => 25,
|
204
207
|
:HAS => 26,
|
205
208
|
"." => 27,
|
206
|
-
"
|
207
|
-
"
|
209
|
+
"*" => 28,
|
210
|
+
"|" => 29,
|
208
211
|
":" => 30 }
|
209
212
|
|
210
213
|
racc_nt_base = 31
|
@@ -256,8 +259,8 @@ Racc_token_to_s_table = [
|
|
256
259
|
"RSQUARE",
|
257
260
|
"HAS",
|
258
261
|
"\".\"",
|
259
|
-
"\"|\"",
|
260
262
|
"\"*\"",
|
263
|
+
"\"|\"",
|
261
264
|
"\":\"",
|
262
265
|
"$start",
|
263
266
|
"selector",
|
@@ -272,6 +275,7 @@ Racc_token_to_s_table = [
|
|
272
275
|
"pseudo",
|
273
276
|
"attrib",
|
274
277
|
"class",
|
278
|
+
"namespaced_ident",
|
275
279
|
"namespace",
|
276
280
|
"attrib_val_0or1",
|
277
281
|
"expr",
|
@@ -400,7 +404,14 @@ def _reduce_19(val, _values, result)
|
|
400
404
|
result
|
401
405
|
end
|
402
406
|
|
403
|
-
|
407
|
+
# reduce 20 omitted
|
408
|
+
|
409
|
+
def _reduce_21(val, _values, result)
|
410
|
+
result = Node.new(:ELEMENT_NAME, val)
|
411
|
+
result
|
412
|
+
end
|
413
|
+
|
414
|
+
def _reduce_22(val, _values, result)
|
404
415
|
result = Node.new(:ELEMENT_NAME,
|
405
416
|
[[val.first, val.last].compact.join(':')]
|
406
417
|
)
|
@@ -408,34 +419,29 @@ def _reduce_20(val, _values, result)
|
|
408
419
|
result
|
409
420
|
end
|
410
421
|
|
411
|
-
def
|
422
|
+
def _reduce_23(val, _values, result)
|
412
423
|
name = @namespaces.key?('xmlns') ? "xmlns:#{val.first}" : val.first
|
413
424
|
result = Node.new(:ELEMENT_NAME, [name])
|
414
425
|
|
415
426
|
result
|
416
427
|
end
|
417
428
|
|
418
|
-
def
|
419
|
-
result = Node.new(:ELEMENT_NAME, val)
|
420
|
-
result
|
421
|
-
end
|
422
|
-
|
423
|
-
def _reduce_23(val, _values, result)
|
429
|
+
def _reduce_24(val, _values, result)
|
424
430
|
result = val[0]
|
425
431
|
result
|
426
432
|
end
|
427
433
|
|
428
|
-
# reduce
|
434
|
+
# reduce 25 omitted
|
429
435
|
|
430
|
-
def
|
436
|
+
def _reduce_26(val, _values, result)
|
431
437
|
result = Node.new(:ATTRIBUTE_CONDITION,
|
432
|
-
[
|
438
|
+
[val[1]] + (val[2] || [])
|
433
439
|
)
|
434
440
|
|
435
441
|
result
|
436
442
|
end
|
437
443
|
|
438
|
-
def
|
444
|
+
def _reduce_27(val, _values, result)
|
439
445
|
result = Node.new(:ATTRIBUTE_CONDITION,
|
440
446
|
[val[1]] + (val[2] || [])
|
441
447
|
)
|
@@ -443,7 +449,7 @@ def _reduce_26(val, _values, result)
|
|
443
449
|
result
|
444
450
|
end
|
445
451
|
|
446
|
-
def
|
452
|
+
def _reduce_28(val, _values, result)
|
447
453
|
# Non standard, but hpricot supports it.
|
448
454
|
result = Node.new(:PSEUDO_CLASS,
|
449
455
|
[Node.new(:FUNCTION, ['nth-child(', val[1]])]
|
@@ -452,14 +458,8 @@ def _reduce_27(val, _values, result)
|
|
452
458
|
result
|
453
459
|
end
|
454
460
|
|
455
|
-
def _reduce_28(val, _values, result)
|
456
|
-
result = Node.new(:FUNCTION, [val.first.strip])
|
457
|
-
|
458
|
-
result
|
459
|
-
end
|
460
|
-
|
461
461
|
def _reduce_29(val, _values, result)
|
462
|
-
result = Node.new(:FUNCTION, [val.first.strip
|
462
|
+
result = Node.new(:FUNCTION, [val.first.strip])
|
463
463
|
|
464
464
|
result
|
465
465
|
end
|
@@ -483,7 +483,8 @@ def _reduce_32(val, _values, result)
|
|
483
483
|
end
|
484
484
|
|
485
485
|
def _reduce_33(val, _values, result)
|
486
|
-
|
486
|
+
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
487
|
+
|
487
488
|
result
|
488
489
|
end
|
489
490
|
|
@@ -497,11 +498,16 @@ def _reduce_35(val, _values, result)
|
|
497
498
|
result
|
498
499
|
end
|
499
500
|
|
500
|
-
|
501
|
+
def _reduce_36(val, _values, result)
|
502
|
+
result = [val.first, val.last]
|
503
|
+
result
|
504
|
+
end
|
501
505
|
|
502
506
|
# reduce 37 omitted
|
503
507
|
|
504
|
-
|
508
|
+
# reduce 38 omitted
|
509
|
+
|
510
|
+
def _reduce_39(val, _values, result)
|
505
511
|
if val[0] == 'even'
|
506
512
|
val = ["2","n","+","0"]
|
507
513
|
result = Node.new(:AN_PLUS_B, val)
|
@@ -519,7 +525,7 @@ def _reduce_38(val, _values, result)
|
|
519
525
|
result
|
520
526
|
end
|
521
527
|
|
522
|
-
def
|
528
|
+
def _reduce_40(val, _values, result)
|
523
529
|
if val[1] == 'n'
|
524
530
|
result = Node.new(:AN_PLUS_B, val)
|
525
531
|
else
|
@@ -529,7 +535,7 @@ def _reduce_39(val, _values, result)
|
|
529
535
|
result
|
530
536
|
end
|
531
537
|
|
532
|
-
def
|
538
|
+
def _reduce_41(val, _values, result)
|
533
539
|
# n+3, -n+3
|
534
540
|
if val[0] == 'n'
|
535
541
|
val.unshift("1")
|
@@ -545,7 +551,7 @@ def _reduce_40(val, _values, result)
|
|
545
551
|
result
|
546
552
|
end
|
547
553
|
|
548
|
-
def
|
554
|
+
def _reduce_42(val, _values, result)
|
549
555
|
if val[1] == 'n'
|
550
556
|
val << "+"
|
551
557
|
val << "0"
|
@@ -557,26 +563,20 @@ def _reduce_41(val, _values, result)
|
|
557
563
|
result
|
558
564
|
end
|
559
565
|
|
560
|
-
def
|
566
|
+
def _reduce_43(val, _values, result)
|
561
567
|
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
562
568
|
|
563
569
|
result
|
564
570
|
end
|
565
571
|
|
566
|
-
def
|
572
|
+
def _reduce_44(val, _values, result)
|
567
573
|
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
568
574
|
result
|
569
575
|
end
|
570
576
|
|
571
|
-
# reduce 44 omitted
|
572
|
-
|
573
577
|
# reduce 45 omitted
|
574
578
|
|
575
|
-
|
576
|
-
result = Node.new(:COMBINATOR, val)
|
577
|
-
|
578
|
-
result
|
579
|
-
end
|
579
|
+
# reduce 46 omitted
|
580
580
|
|
581
581
|
def _reduce_47(val, _values, result)
|
582
582
|
result = Node.new(:COMBINATOR, val)
|
@@ -596,7 +596,11 @@ def _reduce_49(val, _values, result)
|
|
596
596
|
result
|
597
597
|
end
|
598
598
|
|
599
|
-
|
599
|
+
def _reduce_50(val, _values, result)
|
600
|
+
result = Node.new(:COMBINATOR, val)
|
601
|
+
|
602
|
+
result
|
603
|
+
end
|
600
604
|
|
601
605
|
# reduce 51 omitted
|
602
606
|
|
@@ -604,70 +608,72 @@ end
|
|
604
608
|
|
605
609
|
# reduce 53 omitted
|
606
610
|
|
607
|
-
|
611
|
+
# reduce 54 omitted
|
612
|
+
|
613
|
+
def _reduce_55(val, _values, result)
|
608
614
|
result = Node.new(:ID, val)
|
609
615
|
result
|
610
616
|
end
|
611
617
|
|
612
|
-
def
|
618
|
+
def _reduce_56(val, _values, result)
|
613
619
|
result = [val.first, val[1]]
|
614
620
|
result
|
615
621
|
end
|
616
622
|
|
617
|
-
def
|
623
|
+
def _reduce_57(val, _values, result)
|
618
624
|
result = [val.first, val[1]]
|
619
625
|
result
|
620
626
|
end
|
621
627
|
|
622
|
-
# reduce
|
628
|
+
# reduce 58 omitted
|
623
629
|
|
624
|
-
def
|
630
|
+
def _reduce_59(val, _values, result)
|
625
631
|
result = :equal
|
626
632
|
result
|
627
633
|
end
|
628
634
|
|
629
|
-
def
|
635
|
+
def _reduce_60(val, _values, result)
|
630
636
|
result = :prefix_match
|
631
637
|
result
|
632
638
|
end
|
633
639
|
|
634
|
-
def
|
640
|
+
def _reduce_61(val, _values, result)
|
635
641
|
result = :suffix_match
|
636
642
|
result
|
637
643
|
end
|
638
644
|
|
639
|
-
def
|
645
|
+
def _reduce_62(val, _values, result)
|
640
646
|
result = :substring_match
|
641
647
|
result
|
642
648
|
end
|
643
649
|
|
644
|
-
def
|
650
|
+
def _reduce_63(val, _values, result)
|
645
651
|
result = :not_equal
|
646
652
|
result
|
647
653
|
end
|
648
654
|
|
649
|
-
def
|
655
|
+
def _reduce_64(val, _values, result)
|
650
656
|
result = :includes
|
651
657
|
result
|
652
658
|
end
|
653
659
|
|
654
|
-
def
|
660
|
+
def _reduce_65(val, _values, result)
|
655
661
|
result = :dash_match
|
656
662
|
result
|
657
663
|
end
|
658
664
|
|
659
|
-
def
|
665
|
+
def _reduce_66(val, _values, result)
|
660
666
|
result = Node.new(:NOT, [val[1]])
|
661
667
|
|
662
668
|
result
|
663
669
|
end
|
664
670
|
|
665
|
-
# reduce 66 omitted
|
666
|
-
|
667
671
|
# reduce 67 omitted
|
668
672
|
|
669
673
|
# reduce 68 omitted
|
670
674
|
|
675
|
+
# reduce 69 omitted
|
676
|
+
|
671
677
|
def _reduce_none(val, _values, result)
|
672
678
|
val[0]
|
673
679
|
end
|