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

Function eval_case_expr

src/cypher/cypher.c:2736–2746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2734/* ── CASE expression evaluation ───────────────────────────────── */
2735
2736static const char *eval_case_expr(const cbm_case_expr_t *k, binding_t *b) {
2737 if (!k) {
2738 return "";
2739 }
2740 for (int i = 0; i < k->branch_count; i++) {
2741 if (eval_expr(k->branches[i].when_expr, b)) {
2742 return k->branches[i].then_val ? k->branches[i].then_val : "";
2743 }
2744 }
2745 return k->else_val ? k->else_val : "";
2746}
2747
2748/* ── Scan nodes for a pattern ─────────────────────────────────── */
2749

Callers 1

project_itemFunction · 0.85

Calls 1

eval_exprFunction · 0.85

Tested by

no test coverage detected