Commit c21a9cd3 authored by dcw's avatar dcw
Browse files

fixed pushback screwup whereby id & int weren't pushed back!

parent 261b7c79
......@@ -42,6 +42,8 @@ FILE *lexfile;
static BOOL havepushedtok = FALSE;
static TOKEN curtok;
static char curid[ MAXIDSIZE ];
static int curint;
/* ----------------- Private procedures ---------------- */
......@@ -105,6 +107,8 @@ TOKEN nexttok()
{
lexidval[pos++] = '\0';
}
strcpy( curid, lexidval );
curtok = tSTR;
break;
default:
if( isalpha( c ) )
......@@ -119,17 +123,19 @@ TOKEN nexttok()
ungetc( c, lexfile );
while( pos<MAXIDSIZE )
lexidval[pos++] = '\0';
strcpy( curid, lexidval );
} else if( isdigit( c ) )
{
int t;
curtok = tNUM;
for( t=0; isdigit(c); t = t*10 + (c-'0'))
for( t=0; isdigit(c); )
{
t = t*10 + c-'0';
c=getc(lexfile);
}
ungetc( c, lexfile );
lexintval = t;
curint = lexintval = t;
} else
{
curtok = tERROR;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment