mirror of
https://github.com/TheM1Stery/izanami.git
synced 2025-04-20 00:41:11 +00:00
fix: correct number scan
i used peek_double instead of peek lol
This commit is contained in:
parent
02eb6bbc26
commit
2bac50ecba
@ -187,14 +187,14 @@ impl Scanner {
|
|||||||
if self.peek().is_some_and(|x| x == '.') && matches!(self.peek_double(), Some('0'..='9')) {
|
if self.peek().is_some_and(|x| x == '.') && matches!(self.peek_double(), Some('0'..='9')) {
|
||||||
self.advance();
|
self.advance();
|
||||||
|
|
||||||
while matches!(self.peek_double(), Some('0'..='9')) {
|
while matches!(self.peek(), Some('0'..='9')) {
|
||||||
self.advance();
|
self.advance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let number: f64 = self
|
let number: f64 = self
|
||||||
.source
|
.source
|
||||||
.slice(self.start..=self.current)
|
.slice(self.start..self.current)
|
||||||
.parse()
|
.parse()
|
||||||
.expect("There shouldn't be any errors. Please check");
|
.expect("There shouldn't be any errors. Please check");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user