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

Function parse_order_by_agg

src/cypher/cypher.c:1558–1569  ·  view source on GitHub ↗

Parse ORDER BY field into r->order_by and r->order_dir */ Parse aggregate function call for ORDER BY */

Source from the content-addressed store, hash-verified

1556/* Parse ORDER BY field into r->order_by and r->order_dir */
1557/* Parse aggregate function call for ORDER BY */
1558static void parse_order_by_agg(parser_t *p, char *buf, size_t buf_sz) {
1559 const char *fn = agg_func_name(peek(p)->type);
1560 advance(p);
1561 expect(p, TOK_LPAREN);
1562 if (match(p, TOK_STAR)) {
1563 snprintf(buf, buf_sz, "%s(*)", fn);
1564 } else {
1565 const cbm_token_t *var = expect(p, TOK_IDENT);
1566 snprintf(buf, buf_sz, "%s(%s)", fn, var ? var->text : "");
1567 }
1568 expect(p, TOK_RPAREN);
1569}
1570
1571/* Parse var[.prop] for ORDER BY */
1572static void parse_order_by_var(parser_t *p, char *buf, size_t buf_sz) {

Callers 1

parse_order_by_exprFunction · 0.85

Calls 5

agg_func_nameFunction · 0.85
peekFunction · 0.85
advanceFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85

Tested by

no test coverage detected