| 545 | } |
| 546 | |
| 547 | static void extract_channels_python(CBMExtractCtx *ctx) { |
| 548 | chan_const_table_t consts = {0}; |
| 549 | scan_string_consts_python(ctx, &consts); |
| 550 | |
| 551 | TSNodeStack stack; |
| 552 | ts_nstack_init(&stack, ctx->arena, CHAN_STACK_CAP); |
| 553 | ts_nstack_push(&stack, ctx->arena, ctx->root); |
| 554 | |
| 555 | while (stack.count > 0) { |
| 556 | TSNode node = ts_nstack_pop(&stack); |
| 557 | const char *kind = ts_node_type(node); |
| 558 | if (strcmp(kind, "call") == 0) { |
| 559 | py_process_call(ctx, node, &consts); |
| 560 | } else if (strcmp(kind, "decorator") == 0) { |
| 561 | py_process_decorator(ctx, node, &consts); |
| 562 | } |
| 563 | uint32_t count = ts_node_child_count(node); |
| 564 | for (int i = (int)count - SKIP_ONE; i >= 0; i--) { |
| 565 | ts_nstack_push(&stack, ctx->arena, ts_node_child(node, (uint32_t)i)); |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | /* ══════════════════════════════════════════════════════════════════ |
| 571 | * Go — gorilla/nhooyr websocket (WriteMessage/ReadMessage) |
no test coverage detected