diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-10 12:54:41 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-10 12:54:41 +0300 |
| commit | 843242e692280d604b74324ba26ead6158223439 (patch) | |
| tree | e5f2d362b1c728f900d8214bc415752336fa4a94 /compiler/src/lex/lexer.rs | |
| parent | 1801afdbd0058cc9cc040b977de0d5652d65aab9 (diff) | |
| download | crisp-843242e692280d604b74324ba26ead6158223439.tar.gz crisp-843242e692280d604b74324ba26ead6158223439.zip | |
Remove Float from parser
Dropped to make the language simpler.
Diffstat (limited to 'compiler/src/lex/lexer.rs')
| -rw-r--r-- | compiler/src/lex/lexer.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/src/lex/lexer.rs b/compiler/src/lex/lexer.rs index 6efbca0..5e45b20 100644 --- a/compiler/src/lex/lexer.rs +++ b/compiler/src/lex/lexer.rs | |||
| @@ -131,12 +131,8 @@ impl<'a> Iterator for Lexer<'a> { | |||
| 131 | 131 | ||
| 132 | // Number | 132 | // Number |
| 133 | ch if ch.is_ascii_digit() | 133 | ch if ch.is_ascii_digit() |
| 134 | || ch == '.' && self.peek_nth(1).is_some_and(|ch| ch.is_ascii_digit()) | ||
| 135 | || matches!(ch, '+' | '-') | 134 | || matches!(ch, '+' | '-') |
| 136 | && self.peek_nth(1).is_some_and(|ch| ch.is_ascii_digit()) | 135 | && self.peek_nth(1).is_some_and(|ch| ch.is_ascii_digit()) => |
| 137 | || matches!(ch, '+' | '-') | ||
| 138 | && self.peek_nth(1).is_some_and(|ch| ch == '.') | ||
| 139 | && self.peek_nth(2).is_some_and(|ch| ch.is_ascii_digit()) => | ||
| 140 | { | 136 | { |
| 141 | Token::Number(self.next_atom()) | 137 | Token::Number(self.next_atom()) |
| 142 | } | 138 | } |
