From f1d09ae799e1835e42bff7ff2cfadc02032ddbf2 Mon Sep 17 00:00:00 2001 From: PaddiM8 Date: Fri, 5 Jun 2020 17:18:36 +0200 Subject: [PATCH] Changed lexer to allow whitespace between number literal. --- kalk/src/lexer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kalk/src/lexer.rs b/kalk/src/lexer.rs index 9293876..13b4481 100644 --- a/kalk/src/lexer.rs +++ b/kalk/src/lexer.rs @@ -102,7 +102,9 @@ impl<'a> Lexer<'a> { let start = self.index; let mut end = start; - while !self.is_at_end() && (self.peek().is_digit(10) || self.peek() == '.') { + while !self.is_at_end() + && (self.peek().is_digit(10) || self.peek() == '.' || self.peek().is_whitespace()) + { end += 1; self.advance(); }