Adding a space after a comma or near the brackets stops the parser. Note a space after a colon has no effect.
It would be nice if we could be allowed a space after the comma so it is more human readable.
Code: Select all
game.json_to_table('{"foo":[1,2,3],"bar":[1,2,3]}') -- returns { foo = { 1,2,3 }, bar = { 1,2,3 } }
game.json_to_table('{"foo": [1,2,3],"bar": [1,2,3]}') -- returns { foo = { 1,2,3 }, bar = { 1,2,3 } }
game.json_to_table('{"foo": [1,2,3], "bar": [1,2,3]}') -- returns nil
game.json_to_table('{ "foo": [1,2,3],"bar": [1,2,3] }') -- returns nil