Skip to content

fix: parse zero in integer and decimal parsers - #181

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

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

Conversation

@trackoor

Copy link
Copy Markdown

Fixes #180

As you suggested, integer and decimal now read their whole-number part with some(digit) instead of natural_number, so 0, 0.5 and -0.5 parse. digit is now range("0", "9"). natural_number is unchanged and still rejects a leading zero.

I added tests for integer on 0 and 10, and for decimal on 0, 0.5, -0.5 and a non-numeric input. deno fmt --check and deno test --parallel pass on Deno 2.2.12, the version CI uses.

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

1 participant