* xmlXPathCompLiteral: * @ctxt: the XPath Parser context * * Parse a Literal and push it on the stack. * * [29] Literal ::= '"' [^"]* '"' * | "'" [^']* "'" * * TODO: xmlXPathCompLiteral memory allocation could be improved. */
| 9248 | * TODO: xmlXPathCompLiteral memory allocation could be improved. |
| 9249 | */ |
| 9250 | static void |
| 9251 | xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) { |
| 9252 | xmlChar *ret = NULL; |
| 9253 | xmlXPathObjectPtr lit; |
| 9254 | |
| 9255 | ret = xmlXPathParseLiteral(ctxt); |
| 9256 | if (ret == NULL) |
| 9257 | return; |
| 9258 | lit = xmlXPathCacheNewString(ctxt, ret); |
| 9259 | if (lit == NULL) { |
| 9260 | ctxt->error = XPATH_MEMORY_ERROR; |
| 9261 | } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit, |
| 9262 | NULL) == -1) { |
| 9263 | xmlXPathReleaseObject(ctxt->context, lit); |
| 9264 | } |
| 9265 | xmlFree(ret); |
| 9266 | } |
| 9267 | |
| 9268 | /** |
| 9269 | * xmlXPathCompVariableReference: |
no test coverage detected