Skip to content

Conversation

erosb
Copy link
Contributor

@erosb erosb commented Jan 20, 2018

No description provided.

}
for (char current = curr(); isDigit(current) && pos < input.length() - 1; current = curr())
;
pos--;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work for values that consists of only positive-integer and it has more than one digits e.g. '123'? In that case I think because of the step back the other parsing (parseJsonPointer) will try to process the ending digit.

This could be prevented by something like:
if (!(pos == input.length() - 1)) { pos--; }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zgyorffi I added 2 more tests covering this case in 7f1410f

@zgyorffi
Copy link
Contributor

One more thing: leading zero is not allowed before digits. Could you check and test this case too?

@erosb erosb merged commit dae1b7b into everit-org:draft-07 Jan 27, 2018
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.

2 participants