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

Function expr_chain_link

src/cypher/cypher.c:1271–1279  ·  view source on GitHub ↗

A chain `a OP b OP c ...` of one associative operator is linked along the * RIGHT child: OP(a, OP(b, OP(c, ...))). The chain's length is bounded only by * the message size, so a left-deep fold would hand every walker (evaluate, * seed-selectivity, free) a tree as deep as the chain is long; linked this * way each walker follows the chain in a loop and only recurses into the * operands, whose n

Source from the content-addressed store, hash-verified

1269 * left-to-right short-circuit are the same as in the nested form. `next` is
1270 * the operand just parsed; `more` says whether another OP follows it. */
1271static void expr_chain_link(cbm_expr_t **tail, cbm_expr_type_t type, cbm_expr_t *next, bool more) {
1272 if (more) {
1273 cbm_expr_t *node = expr_binary(type, next, NULL);
1274 (*tail)->right = node;
1275 *tail = node;
1276 } else {
1277 (*tail)->right = next;
1278 }
1279}
1280
1281/* AND: not (AND not)* */
1282static cbm_expr_t *parse_and_expr(parser_t *p) { // NOLINT(misc-no-recursion)

Callers 3

parse_and_exprFunction · 0.85
parse_xor_exprFunction · 0.85
parse_or_exprFunction · 0.85

Calls 1

expr_binaryFunction · 0.85

Tested by

no test coverage detected