diff --git a/src/lsc/lexer.l b/src/lsc/lexer.l index 898288d..6322671 100644 --- a/src/lsc/lexer.l +++ b/src/lsc/lexer.l @@ -105,6 +105,8 @@ return return TOKRETURN; [0-9]+ yylval.Tinteger = atoi(yytext); return NUMBER; -[0-9]+ yylval.Tinteger = atoi(yytext); return NUMBER; +0x[0-9]+ yylval.Tinteger = strtol(yytext+2, (char **)NULL, 16); return NUMBER; +-0x[0-9]+ yylval.Tinteger = strtol(yytext+2, (char **)NULL, 16); return NUMBER; [0-9]+\.[0-9]+ yylval.Treal = atof(yytext); return REAL; -[0-9]+\.[0-9]+ yylval.Treal = atof(yytext); return REAL; [_a-zA-Z0-9]+ yylval.Tstring = strdup(yytext); return IDENTIFIER;