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

Function walk_readwrites

internal/cbm/extract_semantic.c:264–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static void walk_readwrites(CBMExtractCtx *ctx, TSNode root, const CBMLangSpec *spec) {
265 TSNodeStack stack;
266 ts_nstack_init(&stack, ctx->arena, CBM_SZ_512);
267 ts_nstack_push(&stack, ctx->arena, root);
268 while (stack.count > 0) {
269 TSNode node = ts_nstack_pop(&stack);
270 if (cbm_kind_in_set(node, spec->assignment_node_types)) {
271 try_emit_assignment_write(ctx, node, cbm_enclosing_func_qn_cached(ctx, node));
272 }
273 uint32_t count = ts_node_child_count(node);
274 for (int i = (int)count - LAST_IDX; i >= 0; i--) {
275 ts_nstack_push(&stack, ctx->arena, ts_node_child(node, (uint32_t)i));
276 }
277 }
278}
279
280void cbm_extract_semantic(CBMExtractCtx *ctx) {
281 const CBMLangSpec *spec = cbm_lang_spec(ctx->language);

Callers 1

cbm_extract_semanticFunction · 0.85

Calls 6

ts_nstack_initFunction · 0.85
ts_nstack_pushFunction · 0.85
ts_nstack_popFunction · 0.85
cbm_kind_in_setFunction · 0.85

Tested by

no test coverage detected