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

Function rs_node_push

internal/cbm/doclink_rs.c:3027–3044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3025} rs_node_stack_t;
3026
3027static void rs_node_push(rs_scan_t *s, rs_node_stack_t *st, TSNode node) {
3028 if (s->failed) {
3029 return;
3030 }
3031 if (st->n >= st->cap) {
3032 int ncap = st->cap ? st->cap * PAIR_LEN : RS_SCAN_INIT;
3033 TSNode *grown = (TSNode *)rs_tmp_alloc(s, (size_t)ncap * sizeof(TSNode));
3034 if (!grown) {
3035 return;
3036 }
3037 if (st->n > 0) {
3038 memcpy(grown, st->v, (size_t)st->n * sizeof(TSNode));
3039 }
3040 st->v = grown;
3041 st->cap = ncap;
3042 }
3043 st->v[st->n++] = node;
3044}
3045
3046/* A keyword after which a name is declared. */
3047static bool rs_item_keyword(const char *t) {

Callers 2

rs_macro_treeFunction · 0.85
rs_macro_declaresFunction · 0.85

Calls 1

rs_tmp_allocFunction · 0.85

Tested by

no test coverage detected