Fixed a problem with the ubiquitous_idents change

git-svn-id: svn://svn.cc65.org/cc65/trunk@2983 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-04-20 13:10:52 +00:00
parent 9b96998e76
commit 968cf01d58

View file

@ -378,7 +378,6 @@ static void OneLine (void)
Segment* Seg = 0; Segment* Seg = 0;
unsigned long PC = 0; unsigned long PC = 0;
SymEntry* Sym = 0; SymEntry* Sym = 0;
int Done = 0;
int Macro = 0; int Macro = 0;
int Instr = -1; int Instr = -1;
@ -436,7 +435,8 @@ static void OneLine (void)
/* Define the symbol with the expression following the '=' */ /* Define the symbol with the expression following the '=' */
SymDef (Sym, Expression(), ADDR_SIZE_DEFAULT, Flags); SymDef (Sym, Expression(), ADDR_SIZE_DEFAULT, Flags);
/* Don't allow anything after a symbol definition */ /* Don't allow anything after a symbol definition */
Done = 1; ConsumeSep ();
return;
} else { } else {
/* A label. Remember the current segment, so we can later /* A label. Remember the current segment, so we can later
* determine the size of the data stored under the label. * determine the size of the data stored under the label.
@ -463,11 +463,26 @@ static void OneLine (void)
/* Skip the colon */ /* Skip the colon */
NextTok (); NextTok ();
} }
/* If we come here, a new identifier may be waiting, which may
* be a macro or instruction.
*/
if (Tok == TOK_IDENT) {
if (!UbiquitousIdents) {
/* Macros and symbols cannot use instruction names */
Instr = FindInstruction (SVal);
if (Instr < 0) {
Macro = IsMacro (SVal);
}
} else {
/* Macros and symbols may use the names of instructions */
Macro = IsMacro (SVal);
}
}
} }
} }
if (!Done) { /* We've handled a possible label, now handle the remainder of the line */
if (Tok >= TOK_FIRSTPSEUDO && Tok <= TOK_LASTPSEUDO) { if (Tok >= TOK_FIRSTPSEUDO && Tok <= TOK_LASTPSEUDO) {
/* A control command */ /* A control command */
HandlePseudo (); HandlePseudo ();
@ -506,7 +521,6 @@ static void OneLine (void)
} }
DefSizeOfSymbol (Sym, Size); DefSizeOfSymbol (Sym, Size);
} }
}
/* Line separator must come here */ /* Line separator must come here */
ConsumeSep (); ConsumeSep ();