Adding new tokens to the assembler isn't quite as easy as I thought: ensure
authorDavid Given <dg@cowlark.com>
Wed, 12 Sep 2018 20:27:39 +0000 (22:27 +0200)
committerDavid Given <dg@cowlark.com>
Wed, 12 Sep 2018 20:27:39 +0000 (22:27 +0200)
that NUMBERF is stored properly in the temporary file.

mach/proto/as/comm5.c

index b91ad34..9dc7a80 100644 (file)
@@ -144,6 +144,7 @@ void putval(int c)
                        break;
 #endif
                case STRING:
+               case NUMBERF:
                        v = stringlen;
                        putc(c, tempfile);
                        putc(c >> 8, tempfile);
@@ -238,6 +239,7 @@ int getval(int c)
                        break;
 #endif
                case STRING:
+               case NUMBERF:
                        getval(getc(tempfile) + NUMBER0);
                        stringlen = n = yylval.y_valu;
                        p = stringbuf;
@@ -456,6 +458,7 @@ floatconstant:
                *p++ = c;
                c = nextchar();
        } while (isdigit(c) || (c == '.') || (c == 'E') || (c == '+') || (c == '-'));
+       peekc = c;
 
        *p = '\0';
        stringbuf = strdup(num);