Parse upper-case hex numbers correctly.

This commit is contained in:
Damien 2013-12-29 13:03:49 +00:00
parent 7f7636e41c
commit dd12d1378f

View File

@ -216,7 +216,7 @@ static void push_result_token(parser_t *parser, const mp_lexer_t *lex) {
int_val = base * int_val + str[i] - '0'; int_val = base * int_val + str[i] - '0';
} else if (base == 16 && 'a' <= str[i] && str[i] <= 'f') { } else if (base == 16 && 'a' <= str[i] && str[i] <= 'f') {
int_val = base * int_val + str[i] - 'a' + 10; int_val = base * int_val + str[i] - 'a' + 10;
} else if (base == 16 && 'F' <= str[i] && str[i] <= 'F') { } else if (base == 16 && 'A' <= str[i] && str[i] <= 'F') {
int_val = base * int_val + str[i] - 'A' + 10; int_val = base * int_val + str[i] - 'A' + 10;
} else if (str[i] == '.' || str[i] == 'e' || str[i] == 'E' || str[i] == 'j' || str[i] == 'J') { } else if (str[i] == '.' || str[i] == 'e' || str[i] == 'E' || str[i] == 'j' || str[i] == 'J') {
dec = true; dec = true;