MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / parse_condition_expr

Function parse_condition_expr

src/cypher/cypher.c:1212–1234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210}
1211
1212static 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 */
1237static cbm_expr_t *parse_atom_expr(parser_t *p) { // NOLINT(misc-no-recursion)

Callers 1

parse_atom_exprFunction · 0.85

Calls 6

matchFunction · 0.85
parse_exists_predicateFunction · 0.85
parse_condition_lhsFunction · 0.85
expr_leafFunction · 0.85
parse_condition_opFunction · 0.85
checkFunction · 0.70

Tested by

no test coverage detected