| 6370 | } |
| 6371 | |
| 6372 | void cbm_extract_definitions(CBMExtractCtx *ctx) { |
| 6373 | const CBMLangSpec *spec = cbm_lang_spec(ctx->language); |
| 6374 | if (!spec) { |
| 6375 | return; |
| 6376 | } |
| 6377 | |
| 6378 | CBMArena *a = ctx->arena; |
| 6379 | |
| 6380 | // Create module node (always first definition) |
| 6381 | CBMDefinition mod; |
| 6382 | memset(&mod, 0, sizeof(mod)); |
| 6383 | mod.name = ctx->rel_path; // will be refined by Go layer |
| 6384 | mod.qualified_name = ctx->module_qn; |
| 6385 | mod.label = "Module"; |
| 6386 | mod.file_path = ctx->rel_path; |
| 6387 | mod.start_line = FIRST_LINE; |
| 6388 | mod.end_line = ts_node_end_point(ctx->root).row + TS_LINE_OFFSET; |
| 6389 | mod.is_exported = true; |
| 6390 | mod.is_test = ctx->result->is_test_file; |
| 6391 | cbm_defs_push(&ctx->result->defs, a, mod); |
| 6392 | |
| 6393 | // Walk AST for function/class definitions |
| 6394 | walk_defs(ctx, ctx->root, spec, 0); |
| 6395 | |
| 6396 | // Extract module-level variables |
| 6397 | extract_variables(ctx, ctx->root, spec); |
| 6398 | } |
no test coverage detected