]> Shamusworld >> Repos - rmac/blobdiff - token.c
.equr overhaul part 2: added equr evaluation during parsing. So far the gpu/dsp test...
[rmac] / token.c
diff --git a/token.c b/token.c
index 811ae854c401882da80adf742d988b41ee28b70b..3e42501d604a2f80efae1356fb5b96e1e648553c 100644 (file)
--- a/token.c
+++ b/token.c
@@ -974,6 +974,7 @@ int TokenizeLine(void)
        int stuffnull;                          // 1:terminate SYMBOL '\0' at *nullspot
        uint8_t c1;
        int stringNum = 0;                      // Pointer to string locations in tokenized line
+       SYM* sy;                                        // For looking up symbols (.equr)
 
 retry:
 
@@ -1203,6 +1204,18 @@ DEBUG { printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); }
                        // If not tokenized keyword OR token was not found
                        if ((j < 0) || (state < 0))
                        {
+                               // Last attempt: let's see if this is an equated register
+                               sy = lookup(nullspot, LABEL, 0);
+                               if (sy)
+                               {
+                                       if (sy->sattre & EQUATEDREG)
+                                       {
+                                               *tk.u32++ = sy->svalue;
+                                               stuffnull = 0;
+                                               continue;
+                                       }
+                               }
+                               // Ok, that failed, let's store the symbol instead
                                *tk.u32++ = SYMBOL;
                                string[stringNum] = nullspot;
                                *tk.u32++ = stringNum;