--- Make imports: include / -include / sinclude FILE... --- Every name of an include directive -- outside recipes, conditionals included -- imports that file; its local name is the file's base name. A name holding a variable reference is known only to make and stays out. (The generic text fallback kept the directive's trailing newlines in the path and split it at the extension's dot.)
| 2722 | // (The generic text fallback kept the directive's trailing newlines in the |
| 2723 | // path and split it at the extension's dot.) |
| 2724 | static void push_make_include(CBMExtractCtx *ctx, TSNode word) { |
| 2725 | CBMArena *a = ctx->arena; |
| 2726 | char *path = cbm_node_text(a, word, ctx->source); |
| 2727 | if (!path || !path[0] || strchr(path, '$')) { |
| 2728 | return; |
| 2729 | } |
| 2730 | const char *slash = strrchr(path, '/'); |
| 2731 | CBMImport imp = {.local_name = slash ? slash + SKIP_ONE : path, .module_path = path}; |
| 2732 | cbm_imports_push(&ctx->result->imports, a, imp); |
| 2733 | } |
| 2734 | |
| 2735 | static void parse_make_imports(CBMExtractCtx *ctx) { |
| 2736 | TSNodeStack stack; |
no test coverage detected