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,12 +73,14 @@ autoexport(Sym *s)
return; return;
if(exportname(s->name)) { if(exportname(s->name)) {
if(dcladj != exportsym) if(dcladj != exportsym)
warn("uppercase missing export"); warn("uppercase missing export: %S", s);
exportsym(s); exportsym(s);
} else { } else {
if(dcladj == exportsym) if(dcladj == exportsym) {
warn("export missing uppercase"); warn("export missing uppercase: %S", s);
packagesym(s); exportsym(s);
} else
packagesym(s);
} }
} }

View File

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