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

Function parse_condition_expr

src/cypher/cypher.c:1203–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1201}
1202
1203static cbm_expr_t *parse_condition_expr(parser_t *p) {
1204 /* Check for NOT prefix at condition level (e.g. NOT n.name CONTAINS "x") */
1205 bool negated = match(p, TOK_NOT);
1206
1207 /* EXISTS { pattern } predicate (anchored single-hop existence). */
1208 if (check(p, TOK_EXISTS)) {
1209 return parse_exists_predicate(p, negated);
1210 }
1211
1212 cbm_condition_t c = {0};
1213 c.negated = negated;
1214
1215 int lhs_rc = parse_condition_lhs(p, &c);
1216 if (lhs_rc < 0) {
1217 return NULL;
1218 }
1219 if (lhs_rc > 0) {
1220 /* HAS_LABEL leaf — complete condition, no operator follows */
1221 return expr_leaf(c);
1222 }
1223
1224 return parse_condition_op(p, &c);
1225}
1226
1227/* Atom: ( expr ) | condition */
1228static 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