Commit 7c5cf59f authored by Damien George's avatar Damien George

extmod/modujson: Handle parsing of floats with + in the exponent.

Fixes issue #4780.
parent 7359a9e2
......@@ -185,7 +185,7 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
cur = S_CUR(s);
if (cur == '.' || cur == 'E' || cur == 'e') {
flt = true;
} else if (cur == '-' || unichar_isdigit(cur)) {
} else if (cur == '+' || cur == '-' || unichar_isdigit(cur)) {
// pass
} else {
break;
......
......@@ -14,4 +14,5 @@ my_print(json.loads('1.2'))
my_print(json.loads('1e2'))
my_print(json.loads('-2.3'))
my_print(json.loads('-2e3'))
my_print(json.loads('-2e+3'))
my_print(json.loads('-2e-3'))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment