Closed TimothyWrightSoftware closed 8 years ago
Ok so this error is caused because with simplified JSON I require a global object. So what it does is it thinks the scope around the first {} is an object in its own right, and it first looks for a key for the first element of the object (and it succeeds where it probably shouldn't), and then looks for a : or = to separate the key from the value, and then bails out.
I could maybe see an argument that I should say 'you can have a global object or not' when you turn simplified JSON on, what do you think?
That was my assumption. That no matter what flags I pass in, valid JSON is always valid.
Ok I'll rework the code with that in mind!
I've got an MR in testing now for this fix https://github.com/sheredom/json.h/pull/29
Thank you so much for your quick attention. I wasn't sure how to tell the fix is through testing or ready to be pulled.
So I just merged the MR into master, just pull and it should work! And don't thank me, thank YOU. It's super awesome for me that you want to use my library over others! Keep the requests coming in, always happy to add more :)
This give me a parser error when the json_parse_flags_allow_simplified_json flag is give, but work with the json_parse_flags_default flag. {"frames":[]}
The error type is error: json_parse_error_expected_colon