compiler: support package test runtime aliases

This commit is contained in:
2026-08-12 03:46:28 +09:00
parent 0ac0fd68ec
commit e59881cb30
7 changed files with 92 additions and 50 deletions

View File

@@ -379,6 +379,8 @@ struct Parser {
* bare-main rule stay intact), and the in-file
* `package` clause asserts (leaf == last
* component) instead of overwriting curmod. */
const char *testmodule; /* hidden package-driver alias for toolchain
* `package test`; NULL outside that compile */
};
void parserinit(Parser*, Arena*, Lex*);
@@ -588,9 +590,10 @@ struct Checker {
int errs;
int is_test; /* #15: `w6c -T` — collect @test fns + synth
* the entry; loud-reject a user main. */
const char *test_module; /* generated dispatcher support qualifier */
int sep_mode; /* -c package compilation: imported interfaces are
* present, so absent members are hard export errors. */
Node *synth_test_run; /* exact compiler-generated test.run DOT;
Node *synth_test_run; /* exact compiler-generated support.run DOT;
* its unresolved external hook is intentional */
Node *alloc_octx; /* #3/B': the one empty `alloc([], n)` call node
* that has let-declared slice context this walk;