--- F# imports: open Module.Path ---
| 3211 | |
| 3212 | // --- F# imports: open Module.Path --- |
| 3213 | static 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; --- |
| 3238 | static void parse_ada_imports(CBMExtractCtx *ctx) { |
no test coverage detected