* xmlXPathCompEqualityExpr: * @ctxt: the XPath Parser context * * [23] EqualityExpr ::= RelationalExpr * | EqualityExpr '=' RelationalExpr * | EqualityExpr '!=' RelationalExpr * * A != B != C is allowed ? Answer from James, yes with * (RelationalExpr = RelationalExpr) = RelationalExpr * (RelationalExpr != RelationalExpr) != RelationalExpr * which
| 9852 | * |
| 9853 | */ |
| 9854 | static void |
| 9855 | xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) { |
| 9856 | xmlXPathCompRelationalExpr(ctxt); |
| 9857 | CHECK_ERROR; |
| 9858 | SKIP_BLANKS; |
| 9859 | while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) { |
| 9860 | int eq; |
| 9861 | int op1 = ctxt->comp->last; |
| 9862 | |
| 9863 | if (CUR == '=') eq = 1; |
| 9864 | else eq = 0; |
| 9865 | NEXT; |
| 9866 | if (!eq) NEXT; |
| 9867 | SKIP_BLANKS; |
| 9868 | xmlXPathCompRelationalExpr(ctxt); |
| 9869 | CHECK_ERROR; |
| 9870 | PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0); |
| 9871 | SKIP_BLANKS; |
| 9872 | } |
| 9873 | } |
| 9874 | |
| 9875 | /** |
| 9876 | * xmlXPathCompAndExpr: |
no test coverage detected