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

Function parse_fsharp_imports

internal/cbm/extract_imports.c:3213–3235  ·  view source on GitHub ↗

--- F# imports: open Module.Path ---

Source from the content-addressed store, hash-verified

3211
3212// --- F# imports: open Module.Path ---
3213static void parse_fsharp_imports(CBMExtractCtx *ctx) {
3214 CBMArena *a = ctx->arena;
3215 TSNodeStack stack;
3216 ts_nstack_init(&stack, ctx, CBM_SZ_512);
3217 ts_nstack_push(&stack, ctx->root);
3218 while (stack.count > 0) {
3219 TSNode node = ts_nstack_pop(&stack);
3220 const char *k = ts_node_type(node);
3221 if (strcmp(k, "import_decl") == 0 || strcmp(k, "open_expression") == 0) {
3222 TSNode id = node;
3223 if (find_first_descendant_of(node, "long_identifier", &id) ||
3224 find_first_descendant_of(node, "identifier", &id)) {
3225 char *mod = cbm_node_text(a, id, ctx->source);
3226 if (mod && mod[0]) {
3227 CBMImport imp = {.local_name = path_last(a, mod), .module_path = mod};
3228 cbm_imports_push(&ctx->result->imports, a, imp);
3229 }
3230 }
3231 continue;
3232 }
3233 ts_nstack_push_children(&stack, node);
3234 }
3235}
3236
3237// --- Ada imports: with Pkg.Child; ---
3238static void parse_ada_imports(CBMExtractCtx *ctx) {

Callers 1

cbm_extract_importsFunction · 0.85

Calls 8

ts_nstack_initFunction · 0.85
ts_nstack_pushFunction · 0.85
ts_nstack_popFunction · 0.85
find_first_descendant_ofFunction · 0.85
cbm_node_textFunction · 0.85
path_lastFunction · 0.85
cbm_imports_pushFunction · 0.85
ts_nstack_push_childrenFunction · 0.85

Tested by

no test coverage detected