* xmlXPathCompVariableReference: * @ctxt: the XPath Parser context * * Parse a VariableReference, evaluate it and push it on the stack. * * The variable bindings consist of a mapping from variable names * to variable values. The value of a variable is an object, which can be * of any of the types that are possible for the value of an expression, * and may also be of additional types not s
| 9283 | * [36] VariableReference ::= '$' QName |
| 9284 | */ |
| 9285 | static void |
| 9286 | xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) { |
| 9287 | xmlChar *name; |
| 9288 | xmlChar *prefix; |
| 9289 | |
| 9290 | SKIP_BLANKS; |
| 9291 | if (CUR != '$') { |
| 9292 | XP_ERROR(XPATH_VARIABLE_REF_ERROR); |
| 9293 | } |
| 9294 | NEXT; |
| 9295 | name = xmlXPathParseQName(ctxt, &prefix); |
| 9296 | if (name == NULL) { |
| 9297 | xmlFree(prefix); |
| 9298 | XP_ERROR(XPATH_VARIABLE_REF_ERROR); |
| 9299 | } |
| 9300 | ctxt->comp->last = -1; |
| 9301 | if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) { |
| 9302 | xmlFree(prefix); |
| 9303 | xmlFree(name); |
| 9304 | } |
| 9305 | SKIP_BLANKS; |
| 9306 | if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) { |
| 9307 | XP_ERROR(XPATH_FORBID_VARIABLE_ERROR); |
| 9308 | } |
| 9309 | } |
| 9310 | |
| 9311 | /** |
| 9312 | * xmlXPathIsNodeType: |
no test coverage detected