extmod/modujson: Handle parsing of floats with + in the exponent.
Fixes issue #4780.
This commit is contained in:
parent
7359a9e2f2
commit
7c5cf59f8b
@ -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'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user