ww: preserve command package identities
This commit is contained in:
@@ -1575,7 +1575,12 @@ parsefile(Parser *p)
|
||||
&& strcmp(p->testmodule, "__wwtest") == 0
|
||||
&& strcmp(active, "__wwtest") == 0
|
||||
&& strcmp(name, "test") == 0;
|
||||
if (strcmp(name, last) != 0 && !testsupport) {
|
||||
int commandpackage = p->commandpackage
|
||||
&& p->pathmod == NULL && p->resetmod != NULL
|
||||
&& (strcmp(name, "main") == 0
|
||||
|| strcmp(name, "main_test") == 0);
|
||||
if (strcmp(name, last) != 0 && !testsupport
|
||||
&& !commandpackage) {
|
||||
errorf(p->cur.pos,
|
||||
"package %s does not match import path %s",
|
||||
name, active);
|
||||
|
||||
@@ -381,6 +381,8 @@ struct Parser {
|
||||
* component) instead of overwriting curmod. */
|
||||
const char *testmodule; /* hidden package-driver alias for toolchain
|
||||
* `package test`; NULL outside that compile */
|
||||
int commandpackage; /* selected command family: package main/main_test
|
||||
* validates kind without replacing resetmod identity */
|
||||
};
|
||||
|
||||
void parserinit(Parser*, Arena*, Lex*);
|
||||
|
||||
Reference in New Issue
Block a user