Revised symbol scoping

git-svn-id: svn://svn.cc65.org/cc65/trunk@2614 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-11-06 11:22:31 +00:00
parent 4a667ead00
commit 8400fb848a
13 changed files with 682 additions and 596 deletions

View File

@@ -663,11 +663,11 @@ static void DoEnd (void)
static void DoEndProc (void)
/* Leave a lexical level */
{
if (!SymIsLocalLevel ()) {
if (CurrentScope != RootScope) {
SymLeaveLevel ();
} else {
/* No local scope */
ErrorSkip (ERR_NO_OPEN_PROC);
} else {
SymLeaveLevel ();
}
}
@@ -1245,11 +1245,12 @@ static void DoProc (void)
{
if (Tok == TOK_IDENT) {
/* The new scope has a name */
SymEntry* Sym = SymFind (CurrentScope, SVal, SYM_ALLOC_NEW);
unsigned Flags = SYM_LABEL;
if (IsZPSeg ()) {
Flags |= SYM_ZP;
}
SymDef (SVal, GenCurrentPC (), Flags);
SymDef (Sym, GenCurrentPC (), Flags);
SymEnterLevel (SVal);
NextTok ();
} else {