The unified diff between revisions [a7f61676..] and [43bb367e..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/lsc/lexer.l'
# # old_revision [a7f61676c8d04ecf082be8ae39a40b4e7bba3462] # new_revision [43bb367e69d2a944206fd7f641ce73111e4bb780] # # patch "src/lsc/lexer.l" # from [c84e522ab7268008c572c8d1670438471d7287e1] # to [88be4de3325822fc6a95e81cc8c615a6c70078bf] # ============================================================ --- src/lsc/lexer.l c84e522ab7268008c572c8d1670438471d7287e1 +++ src/lsc/lexer.l 88be4de3325822fc6a95e81cc8c615a6c70078bf @@ -105,8 +105,10 @@ 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; + /* Cater for the possibility that things might be signed or + unsigned. This is horrible and ugly, but might just work. */ +0x[0-9a-fA-F]+ yylval.Tinteger = strtoul(yytext+2, (char **)NULL, 16); return NUMBER; +-0x[0-9a-fA-F]+ 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;