Skip to content

Commit

Permalink
fix: numbers before a dot pushed to buffers.1, (fixes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
atahabaki committed Aug 7, 2023
1 parent 5c0b5c2 commit 26737d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ pub fn tokenize(content: &str) -> Result<Vec<Token>, TokenizationError> {
iter = r_iter;
continue;
}
_ => buffers.0.push(c),
_ => {
if !buffers.1.is_empty() {
tokens.push(Token::Number(buffers.1.clone(), i - buffers.1.len()));
buffers.1.clear();
}
buffers.0.push(c);
}
}
} else {
buffers.0.push(c);
Expand Down

0 comments on commit 26737d2

Please sign in to comment.