From 27fa3ef7cf2a31131bef632917280fc31ae4e024 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 7 Nov 2024 19:23:59 -0500 Subject: [PATCH] Fix minus sign lexing --- dust-lang/src/lexer.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dust-lang/src/lexer.rs b/dust-lang/src/lexer.rs index 7853f8f..6a170ae 100644 --- a/dust-lang/src/lexer.rs +++ b/dust-lang/src/lexer.rs @@ -354,7 +354,10 @@ impl<'src> Lexer<'src> { fn lex_minus(&mut self) -> Result<(Token<'src>, Span), LexError> { let start_position = self.position; - if self.peek_char().is_some_and(|char| char.is_ascii_digit()) { + if self + .peek_second_char() + .is_some_and(|char| char.is_ascii_digit()) + { return self.lex_numeric(); }