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

Function parse_aggregate_item

src/cypher/cypher.c:1606–1622  ·  view source on GitHub ↗

Parse aggregate function call: COUNT(var.prop) */

Source from the content-addressed store, hash-verified

1604
1605/* Parse aggregate function call: COUNT(var.prop) */
1606static int parse_aggregate_item(parser_t *p, cbm_return_item_t *item) {
1607 cbm_token_type_t ft = peek(p)->type;
1608 advance(p);
1609 expect(p, TOK_LPAREN);
1610 /* Optional DISTINCT inside the call: COUNT(DISTINCT x) (#239). */
1611 item->distinct = match(p, TOK_DISTINCT);
1612 if (match(p, TOK_STAR)) {
1613 item->variable = heap_strdup("*");
1614 } else {
1615 if (parse_var_dot_prop(p, item) < 0) {
1616 return CBM_NOT_FOUND;
1617 }
1618 }
1619 expect(p, TOK_RPAREN);
1620 item->func = heap_strdup(agg_func_name(ft));
1621 return 0;
1622}
1623
1624/* Parse string function call: toLower(var.prop) */
1625static int parse_string_func_item(parser_t *p, cbm_return_item_t *item) {

Callers 1

parse_return_itemFunction · 0.85

Calls 7

peekFunction · 0.85
advanceFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85
parse_var_dot_propFunction · 0.85
agg_func_nameFunction · 0.85
heap_strdupFunction · 0.70

Tested by

no test coverage detected