]> Shamusworld >> Repos - rmac/blobdiff - expr.c
Bump version #.
[rmac] / expr.c
diff --git a/expr.c b/expr.c
index d1b9ac2e08e50114af26a0272cc93f5e0123348b..063066ede1dd58ba9265ae1bba965d5789d4593e 100644 (file)
--- a/expr.c
+++ b/expr.c
@@ -34,7 +34,8 @@ char itokcl[] = {
        ')', ']', '}', 0,                               // CPAR 
        CR_DEFINED, CR_REFERENCED,              // SUNARY (special unary)
        CR_STREQ, CR_MACDEF,
-       CR_DATE, CR_TIME, 0,
+       CR_DATE, CR_TIME, 
+       CR_ABSCOUNT, 0,
        '!', '~', UNMINUS, 0,                   // UNARY
        '*', '/', '%', 0,                               // MULT 
        '+', '-', 0,                                    // ADD 
@@ -121,6 +122,9 @@ int expr0(void)
 
 //
 // Unary operators (detect unary '-')
+// ggn: If expression starts with a plus then also eat it up.
+//      For some reason the parser gets confused when this happens and
+//      emits a "bad expression".
 //
 int expr1(void)
 {
@@ -133,7 +137,7 @@ int expr1(void)
 
        class = tokenClass[*tok];
 
-       if (*tok == '-' || class == UNARY)
+       if (*tok == '-' || *tok == '+' || class == UNARY)
        {
                t = *tok++;
 
@@ -149,6 +153,10 @@ int expr1(void)
        {
                switch ((int)*tok++)
                {
+               case CR_ABSCOUNT:
+                       *evalTokenBuffer++ = CONST;
+                       *evalTokenBuffer++ = (LONG)sect[ABS].sloc;
+                       break;
                case CR_TIME:
                        *evalTokenBuffer++ = CONST;
                        *evalTokenBuffer++ = dos_time();