Skip to content

fix: accept 0 and 0.x in integer and decimal parsers - #182

Closed
trackoor wants to merge 1 commit into
baetheus:mainfrom
trackoor:fix/integer-decimal-zero
Closed

trackoor wants to merge 1 commit into
baetheus:mainfrom
trackoor:fix/integer-decimal-zero

Conversation

@trackoor

Copy link
Copy Markdown
Contributor

The integer and decimal parsers used natural_number for the whole part, so they rejected 0 and anything like 0.5 or -0.5. They now read the whole part with some(digit), and digit is now range("0", "9") as you suggested. natural_number itself is unchanged and still rejects 0. Added tests for 0, -0, 0.5, -0.5 and +0.25.

Fixes #180

@baetheus

Copy link
Copy Markdown
Owner

Looks like this was fixed in #181, right?

@trackoor

Copy link
Copy Markdown
Contributor Author

Yes, #181 covers it, I opened this one by mistake. Closing it.

@trackoor trackoor closed this Nov 20, 2026
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.

parser: integer and decimal fail on 0 and 0.x

2 participants