| 2840 | } |
| 2841 | |
| 2842 | static void parse_html_imports(CBMExtractCtx *ctx) { |
| 2843 | /* First run the embedded-language walker (inline <script> JS imports). */ |
| 2844 | parse_embedded_imports(ctx); |
| 2845 | |
| 2846 | TSNodeStack stack; |
| 2847 | ts_nstack_init(&stack, ctx, CBM_SZ_512); |
| 2848 | ts_nstack_push(&stack, ctx->root); |
| 2849 | while (stack.count > 0) { |
| 2850 | TSNode node = ts_nstack_pop(&stack); |
| 2851 | if (strcmp(ts_node_type(node), "start_tag") == 0 || |
| 2852 | strcmp(ts_node_type(node), "self_closing_tag") == 0) { |
| 2853 | html_extract_tag_src(ctx, node); |
| 2854 | } |
| 2855 | ts_nstack_push_children(&stack, node); |
| 2856 | } |
| 2857 | } |
| 2858 | |
| 2859 | // Shared: push an import whose path is the (quote-stripped) text of `node`. |
| 2860 | // Strips a leading "./" so relative-import resolution matches the sibling file. |
no test coverage detected