author | Alan Dipert
<alan@dipert.org> 2024-04-26 20:04:16 UTC |
committer | Alan Dipert
<alan@dipert.org> 2024-04-26 20:04:16 UTC |
parent | f504779168ed989eea6aa09e71c762c9d5db4942 |
usbasic.l | +1 | -1 |
diff --git a/usbasic.l b/usbasic.l index 005c8ab..821c755 100644 --- a/usbasic.l +++ b/usbasic.l @@ -30,7 +30,7 @@ ">" return GT; ">=" return GTE; "==" return EQ; -[0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+)? { yylval.number = atof(yytext); return NUMBER; } +-?[0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+)? { yylval.number = atof(yytext); return NUMBER; } [a-zA-Z][a-zA-Z0-9]* { yylval.id = strdup(yytext); return IDENTIFIER; } \"([^\\\"]|\\.)*\" { yylval.str = strdup(yytext); return STRING; } . return *yytext;