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

Fix premature SNBT parsing as number #497

Merged
merged 3 commits into from
Nov 4, 2021

Conversation

kennytv
Copy link
Contributor

@kennytv kennytv commented Nov 4, 2021

┬┴┬┴┤(・_├┬┴┬┴

If a numeric token is found before an unquoted string's end, it will be prematurely parsed as a number and errors because of remaining/unread characters for strings such as 0dd, 11fa, or 1350diamonds_plz.

Instead of constantly looking for the numeric tokens, this just reads the full string and if all chars meet the required criterea (previously possiblyNumeric) except for the very last character, the token parser will be called. If it's possibly numeric all the way through, it goes to the int parser, otherwise to the same code below.

@kashike kashike added this to the 4.10.0 milestone Nov 4, 2021
@kashike kashike self-assigned this Nov 4, 2021
@kashike kashike merged commit aa31d5a into KyoriPowered:master Nov 4, 2021
This was referenced Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants