Commit fd95305571317f68b67947ffe2e4efdb42681c10
1 parent
c8d44828
Added the recognition of hexadecimal integers in the form '0x4566AD5' (for axample).
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
anubis_dev/compiler/src/lexer.y
| ... | ... | @@ -868,6 +868,7 @@ static char *rec_name(char *s, int del) |
| 868 | 868 | } |
| 869 | 869 | } |
| 870 | 870 | <PAR>[0-9]+ { yylval.integer = atoi(yytext); return yy__integer; } |
| 871 | +<PAR>0[Xx][0-9A-Fa-f]+ { sscanf(yytext,"%i",&(yylval.integer)); return yy__integer; } | |
| 871 | 872 | <PAR>[0-9]+\.[0-9]+ { yylval.expr = new_string(yytext); return yy__float; } |
| 872 | 873 | <PAR>\$[A-Z][A-Za-z0-9\_]* { yylval.expr = new_utvar(yytext+1); return yy__utvar; } |
| 873 | 874 | <PAR>[A-Z][A-Za-z0-9\_]* { yylval.expr = new_string(yytext); return yy__Symbol; } | ... | ... |