From 3e2429af1587bca85cccd3bc3effc0ca014a2c0f Mon Sep 17 00:00:00 2001 From: LunaStev Date: Thu, 19 Dec 2024 14:32:00 +0900 Subject: [PATCH] Improved readability, but failed to resolve the issue of fun tokens not being separated --- src/lexer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lexer.rs b/src/lexer.rs index 774a96d..3e08420 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -765,7 +765,11 @@ impl<'a> Lexer<'a> { } fn identifier(&mut self) -> String { - let start = if self.current > 0 { self.current - 1 } else { 0 }; + let start = if self.current > 0 { + self.current - 1 + } else { + 0 + }; while !self.is_at_end() && self.peek().is_alphanumeric() { self.advance();