| 1210 | } |
| 1211 | |
| 1212 | static cbm_expr_t *parse_condition_expr(parser_t *p) { |
| 1213 | /* Check for NOT prefix at condition level (e.g. NOT n.name CONTAINS "x") */ |
| 1214 | bool negated = match(p, TOK_NOT); |
| 1215 | |
| 1216 | /* EXISTS { pattern } predicate (anchored single-hop existence). */ |
| 1217 | if (check(p, TOK_EXISTS)) { |
| 1218 | return parse_exists_predicate(p, negated); |
| 1219 | } |
| 1220 | |
| 1221 | cbm_condition_t c = {0}; |
| 1222 | c.negated = negated; |
| 1223 | |
| 1224 | int lhs_rc = parse_condition_lhs(p, &c); |
| 1225 | if (lhs_rc < 0) { |
| 1226 | return NULL; |
| 1227 | } |
| 1228 | if (lhs_rc > 0) { |
| 1229 | /* HAS_LABEL leaf — complete condition, no operator follows */ |
| 1230 | return expr_leaf(c); |
| 1231 | } |
| 1232 | |
| 1233 | return parse_condition_op(p, &c); |
| 1234 | } |
| 1235 | |
| 1236 | /* Atom: ( expr ) | condition */ |
| 1237 | static cbm_expr_t *parse_atom_expr(parser_t *p) { // NOLINT(misc-no-recursion) |
no test coverage detected