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
sploiselle wants to merge 1 commit into
masterfrom
parse-numbers-begin-decimal
Open

parse numbers that begin with decimals#33
sploiselle wants to merge 1 commit into
masterfrom
parse-numbers-begin-decimal

Conversation

@sploiselle

Copy link
Copy Markdown

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

benesch commented Dec 18, 2019

Copy link
Copy Markdown
Contributor

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.

Comment thread src/tokenizer.rs
}
let mut peekable = chars_w_leading_zero.chars().peekable();

self.tokenize_number(&mut peekable)

Copy link
Copy Markdown
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

2 participants