Improve float support
This commit is contained in:
parent
1f195da2ad
commit
ef387fc051
1 changed files with 2 additions and 7 deletions
|
@ -170,18 +170,13 @@ impl Tokenizer {
|
||||||
self.storage.clear();
|
self.storage.clear();
|
||||||
self.storage.push(c);
|
self.storage.push(c);
|
||||||
continue;
|
continue;
|
||||||
|
} else if c.is_numeric() || c == '.' {
|
||||||
|
|
||||||
// Allow numbers to also start with _ for fun
|
|
||||||
// ______100_0__: 1,000
|
|
||||||
|
|
||||||
// TODO: delete this when I expand identifiers to include more symbols
|
|
||||||
} else if c.is_numeric() || c == '_' || c == '.' {
|
|
||||||
self.reading_num = true;
|
self.reading_num = true;
|
||||||
self.storage.clear();
|
self.storage.clear();
|
||||||
if c.is_numeric() {
|
if c.is_numeric() {
|
||||||
self.storage.push(c);
|
self.storage.push(c);
|
||||||
} else if c == '.' {
|
} else if c == '.' {
|
||||||
|
self.is_float = true;
|
||||||
self.storage.push('0');
|
self.storage.push('0');
|
||||||
self.storage.push(c);
|
self.storage.push(c);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue