Don't search twice for a macro.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5075 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-07-08 09:22:26 +00:00
parent 49cdfcf5b0
commit 241afdc738
4 changed files with 47 additions and 34 deletions

View File

@@ -818,6 +818,8 @@ static int Sweet16Reg (const StrBuf* Id)
void NextRawTok (void)
/* Read the next raw token from the input stream */
{
Macro* M;
/* If we've a forced end of assembly, don't read further */
if (ForcedEnd) {
CurTok.Tok = TOK_EOF;
@@ -827,9 +829,9 @@ void NextRawTok (void)
Restart:
/* Check if we have tokens from another input source */
if (InputFromStack ()) {
if (CurTok.Tok == TOK_IDENT && IsDefine (&CurTok.SVal)) {
if (CurTok.Tok == TOK_IDENT && (M = FindDefine (&CurTok.SVal)) != 0) {
/* This is a define style macro - expand it */
MacExpandStart ();
MacExpandStart (M);
goto Restart;
}
return;
@@ -1001,9 +1003,9 @@ Again:
/* An identifier with a dot. Check if it's a define style
* macro.
*/
if (IsDefine (&CurTok.SVal)) {
if ((M = FindDefine (&CurTok.SVal)) != 0) {
/* This is a define style macro - expand it */
MacExpandStart ();
MacExpandStart (M);
goto Restart;
}
@@ -1108,9 +1110,9 @@ Again:
}
/* Check for define style macro */
if (IsDefine (&CurTok.SVal)) {
if ((M = FindDefine (&CurTok.SVal)) != 0) {
/* Macro - expand it */
MacExpandStart ();
MacExpandStart (M);
goto Restart;
} else {
/* An identifier */