]> Shamusworld >> Repos - rmac/blobdiff - expr.c
Fix for bug where ^^FOO mnemonics were parsed incorrectly.
[rmac] / expr.c
diff --git a/expr.c b/expr.c
index 50d1f5ada0c2e30ef71ab0bfd1bec37f349ab8a2..d1b9ac2e08e50114af26a0272cc93f5e0123348b 100644 (file)
--- a/expr.c
+++ b/expr.c
@@ -311,8 +311,9 @@ int expr(TOKEN * otk, VALUE * a_value, WORD * a_attr, SYM ** a_esym)
        //         followed by the value 101, it will trigger a bad evaluation here.
        //         This is probably a really bad assumption to be making here...!
        //         (assuming tok[1] == EOL is a single token that is)
+       //         Seems that even other tokens (SUNARY type) can fuck this up too.
 //     if ((tok[1] == EOL)
-       if ((tok[1] == EOL && tok[0] != CONST)
+       if ((tok[1] == EOL && (tok[0] != CONST && tokenClass[tok[0]] != SUNARY))
                || (((*tok == CONST || *tok == SYMBOL) || (*tok >= KW_R0 && *tok <= KW_R31))
                && (tokenClass[tok[2]] < UNARY)))
        {