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

do not consume extra char when parsing a scalar number #73

Merged
merged 3 commits into from
Feb 29, 2016

Conversation

kazuho
Copy link
Owner

@kazuho kazuho commented Oct 29, 2015

Current implementation of class input increments the input iterator when getc() is called. Therefore, when ungetc() is called laterwards and then if the parse function returns, the iterator will point at next to the end position of JSON.
note: this becomes an issue only when the input is a scalar number; to parse JSON input (number) like: 123abc, the parser needs to read a, call ungetc(), and then return

This PR fixes the issue by delaying the moment when the iterator gets incremented, until to when the next character is fetched by the parser.

kazuho added a commit that referenced this pull request Feb 29, 2016
do not consume extra char when parsing a scalar number
@kazuho kazuho merged commit 6a46f5d into master Feb 29, 2016
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