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

Function parse_html_imports

internal/cbm/extract_imports.c:2842–2857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2840}
2841
2842static 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.

Callers 1

cbm_extract_importsFunction · 0.85

Calls 6

parse_embedded_importsFunction · 0.85
ts_nstack_initFunction · 0.85
ts_nstack_pushFunction · 0.85
ts_nstack_popFunction · 0.85
html_extract_tag_srcFunction · 0.85
ts_nstack_push_childrenFunction · 0.85

Tested by

no test coverage detected