Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser fixes #5

Merged
merged 2 commits into from
Jun 6, 2014
Merged

Parser fixes #5

merged 2 commits into from
Jun 6, 2014

Conversation

ChrisJefferson
Copy link
Contributor

This fixes two bugs, one of the (in my opinion) serious, one just a neatness issue.

The more serious problem is that given: {"a":"b", "c"}, the "c" is lost (as there is no check that we have finished a key/value pair before closing the object). I reused JSON_PARSE_UNEXPECTED_CHARACTER to avoid introducing a new error class in case people are already parsing and expecting a particular set. Obviously this could be tweaked to another value.

The more minor issue that the checking of rejecting initial comma (like [,1]) is incomplete, as extra commas can sneak in inside nested objects. This is fixed by setting separator=true whenever an object or array is opened.

vivkin added a commit that referenced this pull request Jun 6, 2014
@vivkin vivkin merged commit bb674f2 into vivkin:master Jun 6, 2014
@ChrisJefferson ChrisJefferson deleted the parser_fixes branch June 6, 2014 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants