| 262 | } |
| 263 | |
| 264 | static 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 | |
| 280 | void cbm_extract_semantic(CBMExtractCtx *ctx) { |
| 281 | const CBMLangSpec *spec = cbm_lang_spec(ctx->language); |
no test coverage detected