From: Greg King Date: Sat, 30 Nov 2013 13:20:36 +0000 (-0500) Subject: Fixed ca65's "ubiquitous_idents" feature. X-Git-Tag: V2.15~211^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=309c8fb8425af833c260d93909827d1d6c0bdce4;p=cc65 Fixed ca65's "ubiquitous_idents" feature. Before the fix, that feature couldn't recognize a standard op-code mnemonic, that wasn't replaced by a macro, if it was on a line without a label. This patch was written by Jeremy Turner. --- diff --git a/src/ca65/main.c b/src/ca65/main.c index 4b2f9d178..da826f4db 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -646,15 +646,18 @@ static void OneLine (void) * an instruction. */ if (CurTok.Tok == TOK_IDENT) { - if (!UbiquitousIdents) { - /* Macros and symbols cannot use instruction names */ + if (UbiquitousIdents) { + /* Macros CAN be instructions, so check for them first */ + Mac = FindMacro (&CurTok.SVal); + if (Mac == 0) { + Instr = FindInstruction (&CurTok.SVal); + } + } else { + /* Macros and symbols may NOT use the names of instructions */ Instr = FindInstruction (&CurTok.SVal); if (Instr < 0) { Mac = FindMacro (&CurTok.SVal); } - } else { - /* Macros and symbols may use the names of instructions */ - Mac = FindMacro (&CurTok.SVal); } } @@ -741,15 +744,18 @@ static void OneLine (void) * be a macro or instruction. */ if (CurTok.Tok == TOK_IDENT) { - if (!UbiquitousIdents) { - /* Macros and symbols cannot use instruction names */ + if (UbiquitousIdents) { + /* Macros CAN be instructions, so check for them first */ + Mac = FindMacro (&CurTok.SVal); + if (Mac == 0) { + Instr = FindInstruction (&CurTok.SVal); + } + } else { + /* Macros and symbols may NOT use the names of instructions */ Instr = FindInstruction (&CurTok.SVal); if (Instr < 0) { Mac = FindMacro (&CurTok.SVal); } - } else { - /* Macros and symbols may use the names of instructions */ - Mac = FindMacro (&CurTok.SVal); } } }