mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 22:25:28 +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:
@@ -646,15 +646,18 @@ static void OneLine (void)
|
|||||||
* an instruction.
|
* an instruction.
|
||||||
*/
|
*/
|
||||||
if (CurTok.Tok == TOK_IDENT) {
|
if (CurTok.Tok == TOK_IDENT) {
|
||||||
if (!UbiquitousIdents) {
|
if (UbiquitousIdents) {
|
||||||
/* Macros and symbols cannot use instruction names */
|
/* 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);
|
Instr = FindInstruction (&CurTok.SVal);
|
||||||
if (Instr < 0) {
|
if (Instr < 0) {
|
||||||
Mac = FindMacro (&CurTok.SVal);
|
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.
|
* be a macro or instruction.
|
||||||
*/
|
*/
|
||||||
if (CurTok.Tok == TOK_IDENT) {
|
if (CurTok.Tok == TOK_IDENT) {
|
||||||
if (!UbiquitousIdents) {
|
if (UbiquitousIdents) {
|
||||||
/* Macros and symbols cannot use instruction names */
|
/* 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);
|
Instr = FindInstruction (&CurTok.SVal);
|
||||||
if (Instr < 0) {
|
if (Instr < 0) {
|
||||||
Mac = FindMacro (&CurTok.SVal);
|
Mac = FindMacro (&CurTok.SVal);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* Macros and symbols may use the names of instructions */
|
|
||||||
Mac = FindMacro (&CurTok.SVal);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user