1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-26 17:36:57 +00:00

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.
This commit is contained in:
Greg King 2013-11-30 08:20:36 -05:00
parent ed100f67b9
commit 309c8fb842

View File

@ -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);
}
}
}