| 270 | } |
| 271 | |
| 272 | static void walk_readwrites(CBMExtractCtx *ctx, TSNode root, const CBMLangSpec *spec) { |
| 273 | TSNodeStack stack; |
| 274 | ts_nstack_init(&stack, ctx, CBM_SZ_512); |
| 275 | ts_nstack_push(&stack, root); |
| 276 | while (stack.count > 0) { |
| 277 | TSNode node = ts_nstack_pop(&stack); |
| 278 | if (cbm_kind_in_set(node, spec->assignment_node_types)) { |
| 279 | try_emit_assignment_write(ctx, node, cbm_enclosing_func_qn_cached(ctx, node)); |
| 280 | } |
| 281 | uint32_t count = ts_node_child_count(node); |
| 282 | for (int i = (int)count - LAST_IDX; i >= 0; i--) { |
| 283 | ts_nstack_push(&stack, ts_node_child(node, (uint32_t)i)); |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | void cbm_extract_semantic(CBMExtractCtx *ctx) { |
| 289 | const CBMLangSpec *spec = cbm_lang_spec(ctx->language); |
no test coverage detected