diff options
author | Damien <damien.p.george@gmail.com> | 2013-12-29 13:03:49 +0000 |
---|---|---|
committer | Damien <damien.p.george@gmail.com> | 2013-12-29 13:03:49 +0000 |
commit | dd12d1378f6c7841498d960e49d1860c567b51f8 (patch) | |
tree | 6d3b9a9f427d8727ab2f298589c3ed1ba144da99 | |
parent | 7f7636e41c930ab5044dd795e36bc9253a403ee9 (diff) | |
download | micropython-dd12d1378f6c7841498d960e49d1860c567b51f8.tar.gz micropython-dd12d1378f6c7841498d960e49d1860c567b51f8.zip |
Parse upper-case hex numbers correctly.
-rw-r--r-- | py/parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/parse.c b/py/parse.c index 48c3048056..b939ab8db7 100644 --- a/py/parse.c +++ b/py/parse.c @@ -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'; } else if (base == 16 && 'a' <= str[i] && str[i] <= 'f') { 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; } else if (str[i] == '.' || str[i] == 'e' || str[i] == 'E' || str[i] == 'j' || str[i] == 'J') { dec = true; |