MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXPathCompStep

Function xmlXPathCompStep

ThirdParty/libxml2/vtklibxml2/xpath.c:10235–10355  ·  view source on GitHub ↗

* xmlXPathCompStep: * @ctxt: the XPath Parser context * * [4] Step ::= AxisSpecifier NodeTest Predicate* * | AbbreviatedStep * * [12] AbbreviatedStep ::= '.' | '..' * * [5] AxisSpecifier ::= AxisName '::' * | AbbreviatedAxisSpecifier * * [13] AbbreviatedAxisSpecifier ::= '@'? * * Modified for XPtr range support as: * * [4xptr] Step ::= AxisSpe

Source from the content-addressed store, hash-verified

10233 * node.
10234 */
10235static void
10236xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
10237#ifdef LIBXML_XPTR_LOCS_ENABLED
10238 int rangeto = 0;
10239 int op2 = -1;
10240#endif
10241
10242 SKIP_BLANKS;
10243 if ((CUR == '.') && (NXT(1) == '.')) {
10244 SKIP(2);
10245 SKIP_BLANKS;
10246 PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
10247 NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
10248 } else if (CUR == '.') {
10249 NEXT;
10250 SKIP_BLANKS;
10251 } else {
10252 xmlChar *name = NULL;
10253 xmlChar *prefix = NULL;
10254 xmlXPathTestVal test = (xmlXPathTestVal) 0;
10255 xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
10256 xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
10257 int op1;
10258
10259 /*
10260 * The modification needed for XPointer change to the production
10261 */
10262#ifdef LIBXML_XPTR_LOCS_ENABLED
10263 if (ctxt->xptr) {
10264 name = xmlXPathParseNCName(ctxt);
10265 if ((name != NULL) && (xmlStrEqual(name, BAD_CAST "range-to"))) {
10266 op2 = ctxt->comp->last;
10267 xmlFree(name);
10268 SKIP_BLANKS;
10269 if (CUR != '(') {
10270 XP_ERROR(XPATH_EXPR_ERROR);
10271 }
10272 NEXT;
10273 SKIP_BLANKS;
10274
10275 xmlXPathCompileExpr(ctxt, 1);
10276 /* PUSH_BINARY_EXPR(XPATH_OP_RANGETO, op2, ctxt->comp->last, 0, 0); */
10277 CHECK_ERROR;
10278
10279 SKIP_BLANKS;
10280 if (CUR != ')') {
10281 XP_ERROR(XPATH_EXPR_ERROR);
10282 }
10283 NEXT;
10284 rangeto = 1;
10285 goto eval_predicates;
10286 }
10287 }
10288#endif
10289 if (CUR == '*') {
10290 axis = AXIS_CHILD;
10291 } else {
10292 if (name == NULL)

Callers 1

Calls 8

xmlXPathParseNCNameFunction · 0.85
xmlStrEqualFunction · 0.85
xmlXPathCompileExprFunction · 0.85
xmlXPathIsAxisNameFunction · 0.85
xmlXPathCompNodeTestFunction · 0.85
xmlXPathNsLookupFunction · 0.85
xmlXPathErrFunction · 0.85
xmlXPathCompPredicateFunction · 0.85

Tested by

no test coverage detected