modujson: .loads(): Handle more whitespace characters.
This commit is contained in:
parent
1f04336b23
commit
444331c07f
|
@ -81,6 +81,9 @@ STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) {
|
|||
case ',':
|
||||
case ':':
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\n':
|
||||
case '\r':
|
||||
s += 1;
|
||||
goto cont;
|
||||
case 'n':
|
||||
|
|
|
@ -30,3 +30,6 @@ my_print(json.loads('{}'))
|
|||
my_print(json.loads('{"a":true}'))
|
||||
my_print(json.loads('{"a":null, "b":false, "c":true}'))
|
||||
my_print(json.loads('{"a":[], "b":[1], "c":{"3":4}}'))
|
||||
|
||||
# whitespace handling
|
||||
my_print(json.loads('{\n\t"a":[]\r\n, "b":[1], "c":{"3":4} \n\r\t\r\r\r\n}'))
|
||||
|
|
Loading…
Reference in New Issue