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

Function lex_push_n

src/cypher/cypher.c:80–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void lex_push_n(cbm_lex_result_t *r, cbm_token_type_t type, const char *start, size_t len,
81 int pos) {
82 if (r->count >= r->capacity) {
83 r->capacity = r->capacity ? r->capacity * PAIR_LEN : CBM_SZ_32;
84 r->tokens = safe_realloc(r->tokens, r->capacity * sizeof(cbm_token_t));
85 }
86 r->tokens[r->count++] =
87 (cbm_token_t){.type = type, .text = heap_strndup(start, len), .pos = pos};
88}
89
90/* Parse a string literal (with escape handling) into the token list.
91 * *pos points at the character after the opening quote; updated past closing quote. */

Callers 2

lex_try_identFunction · 0.85
lex_try_numberFunction · 0.85

Calls 2

safe_reallocFunction · 0.85
heap_strndupFunction · 0.85

Tested by

no test coverage detected