From e241051870a8030a64c5e41f94673e42c0652c72 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 3 Dec 2024 16:57:35 -0500 Subject: [PATCH] Fix lexer bug --- dust-lang/src/lexer.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dust-lang/src/lexer.rs b/dust-lang/src/lexer.rs index 258187e..5a0aad8 100644 --- a/dust-lang/src/lexer.rs +++ b/dust-lang/src/lexer.rs @@ -218,7 +218,7 @@ impl<'src> Lexer<'src> { continue; } - if let ('e' | 'E', Some('+')) = (peek_char, peek_second_char) { + if let ('e' | 'E', Some('+' | '-')) = (peek_char, peek_second_char) { self.next_char(); self.next_char(); @@ -227,7 +227,8 @@ impl<'src> Lexer<'src> { return Err(LexError::ExpectedCharacterMultiple { expected: &[ - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '-', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '+', + '-', ], actual: peek_char, position: self.position,