Skip to content
Snippets Groups Projects
Commit 7c5cf59f authored by Damien George's avatar Damien George
Browse files

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

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