add support for negative integers

This commit is contained in:
Eric Smith 2008-03-26 15:06:23 +00:00
parent dae274100d
commit d062b9037f
1 changed files with 5 additions and 0 deletions

5
lex.l
View File

@ -63,6 +63,11 @@ alphanum [0-9a-zA-Z_]
\.[Jj][Tt][Aa][Bb] { return TJTAB; }
\-{digit}+ {
(void)sscanf(yytext, "%d", &token.ival);
return NUMBER;
}
{digit}+ {
(void)sscanf(yytext, "%d", &token.ival);
return NUMBER;