From: JT Date: Sat, 11 Jul 2015 23:09:42 +0000 (-0400) Subject: Move FuncIsMnemonic X-Git-Tag: V2.16~251^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=55adf03bdf2ec3b3dbf654e98e84a5701eb7482d;p=cc65 Move FuncIsMnemonic --- 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 */ {