Skip to content

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

Merged
baetheus merged 1 commit into
baetheus:mainfrom
trackoor:fix/parser-integer-decimal-zero
Nov 19, 2026
Merged

baetheus merged 1 commit into
baetheus:mainfrom
trackoor:fix/parser-integer-decimal-zero

Conversation

@trackoor

Copy link
Copy Markdown
Contributor

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.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 43761903012

Coverage remained the same at 99.702%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 5 of 5 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7188
Covered Lines: 7175
Line Coverage: 99.82%
Relevant Branches: 855
Covered Branches: 844
Branch Coverage: 98.71%
Branches in Coverage %: Yes
Coverage Strength: 152.31 hits per line

💛 - Coveralls

@baetheus
baetheus merged commit a8d5430 into baetheus:main Nov 19, 2026
8 checks passed
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

3 participants