ww: implement package initialization
This commit is contained in:
@@ -1326,9 +1326,7 @@ parseuse(Parser *p)
|
||||
const char *alias = NULL;
|
||||
const char *first;
|
||||
if (p->cur.kind == TK_UNDER) {
|
||||
errorf(p->cur.pos, "blank import alias _ is not implemented");
|
||||
p->errs++;
|
||||
alias = "_";
|
||||
n->useblank = 1;
|
||||
advance(p);
|
||||
first = expectident(p);
|
||||
} else {
|
||||
@@ -1344,8 +1342,10 @@ parseuse(Parser *p)
|
||||
leaf = expectident(p);
|
||||
path = aprintf(p->a, "%s.%s", path, leaf);
|
||||
}
|
||||
n->str = alias ? alias : leaf;
|
||||
n->strlen = strlen(n->str);
|
||||
if (!n->useblank) {
|
||||
n->str = alias ? alias : leaf;
|
||||
n->strlen = strlen(n->str);
|
||||
}
|
||||
n->usesource = path;
|
||||
n->usepath = path;
|
||||
n->usealias = alias;
|
||||
|
||||
Reference in New Issue
Block a user