1
0
mirror of https://github.com/golang/go synced 2024-11-25 22:28:02 -07:00

catch export on func.

print names in message.

R=ken
OCL=22891
CL=22891
This commit is contained in:
Russ Cox 2009-01-15 16:43:51 -08:00
parent 33f3ed7710
commit 605d0746c5
2 changed files with 13 additions and 6 deletions

View File

@ -73,11 +73,13 @@ autoexport(Sym *s)
return;
if(exportname(s->name)) {
if(dcladj != exportsym)
warn("uppercase missing export");
warn("uppercase missing export: %S", s);
exportsym(s);
} else {
if(dcladj == exportsym)
warn("export missing uppercase");
if(dcladj == exportsym) {
warn("export missing uppercase: %S", s);
exportsym(s);
} else
packagesym(s);
}
}

View File

@ -186,6 +186,8 @@ xdcl:
}
| xfndcl
{
if($1 != N && $1->nname != N && $1->type->thistuple == 0)
autoexport($1->nname->sym);
$$ = N;
}
| LEXPORT { dcladj = exportsym; stksize = initstksize; } common_dcl
@ -205,8 +207,11 @@ xdcl:
}
| LEXPORT xfndcl
{
if($2 != N && $2->nname != N)
exportsym($2->nname->sym);
if($2 != N && $2->nname != N) {
dcladj = exportsym;
autoexport($2->nname->sym);
dcladj = nil;
}
$$ = N;
}
| LPACKAGE { warn("package is gone"); } xfndcl