Skip to content
This repository was archived by the owner on Dec 25, 2019. It is now read-only.

parse numbers that begin with decimals #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sploiselle
Copy link

This library didn't parse .123 as a number; with this patch, it now does.

@sploiselle sploiselle requested a review from benesch December 13, 2019 20:46
@benesch
Copy link
Contributor

benesch commented Dec 18, 2019

Ah shoot, sorry to miss this @sploiselle! Definitely ping if it takes me more than a day for me to respond, though I try to be faster than that.

}
let mut peekable = chars_w_leading_zero.chars().peekable();

self.tokenize_number(&mut peekable)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be wrong—haven't actually tried—but I think this mishandles something like ..07. I'd recommend refactoring tokenize_number to take seen_decimal as a bool parameter, and then initialize s inside of tokenize_number to . if seen_decimal is true.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants