Browse Source

Support hexadecimal numbers

master
Gavan Fantom 18 years ago
parent
commit
13c0bc9b5a
  1. 2
      src/lsc/lexer.l

2
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;

Loading…
Cancel
Save