Commit 444331c0 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

modujson: .loads(): Handle more whitespace characters.

parent 1f04336b
......@@ -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}'))
Supports Markdown
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