From 55adf03bdf2ec3b3dbf654e98e84a5701eb7482d Mon Sep 17 00:00:00 2001 From: JT Date: Sat, 11 Jul 2015 19:09:42 -0400 Subject: [PATCH] Move FuncIsMnemonic --- src/ca65/expr.c | 59 +++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/ca65/expr.c b/src/ca65/expr.c index 32653e980..0352b3c80 100644 --- a/src/ca65/expr.c +++ b/src/ca65/expr.c @@ -418,35 +418,6 @@ static ExprNode* FuncDefined (void) -static ExprNode* FuncIsMnemonic (void) -/* Handle the .ISMNEMONIC, .ISMNEM builtin function */ -{ - int Instr = -1; - - /* Check for a macro or an instruction depending on UbiquitousIdents */ - - if (CurTok.Tok == TOK_IDENT) { - if (UbiquitousIdents) { - /* Macros CAN be instructions, so check for them first */ - if (FindMacro (&CurTok.SVal) == 0) { - Instr = FindInstruction (&CurTok.SVal); - } - } else { - /* Macros and symbols may NOT use the names of instructions, so just check for the instruction */ - Instr = FindInstruction (&CurTok.SVal); - } - } - else { - Error ("Identifier expected."); - } - /* Skip the name */ - NextTok(); - - return GenLiteralExpr (Instr > 0); -} - - - static ExprNode* FuncDefinedMacro (void) /* Handle the .DEFINEDMACRO builtin function */ { @@ -483,6 +454,36 @@ static ExprNode* FuncHiWord (void) +static ExprNode* FuncIsMnemonic (void) +/* Handle the .ISMNEMONIC, .ISMNEM builtin function */ +{ + int Instr = -1; + + /* Check for a macro or an instruction depending on UbiquitousIdents */ + + if (CurTok.Tok == TOK_IDENT) { + if (UbiquitousIdents) { + /* Macros CAN be instructions, so check for them first */ + if (FindMacro (&CurTok.SVal) == 0) { + Instr = FindInstruction (&CurTok.SVal); + } + } + else { + /* Macros and symbols may NOT use the names of instructions, so just check for the instruction */ + Instr = FindInstruction (&CurTok.SVal); + } + } + else { + Error ("Identifier expected."); + } + /* Skip the name */ + NextTok (); + + return GenLiteralExpr (Instr > 0); +} + + + ExprNode* FuncLoByte (void) /* Handle the .LOBYTE builtin function */ { -- 2.39.5