From 4277d3e6b4ac1525b1810d917ff3820f35285f42 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 28 Nov 2020 16:54:59 +0100 Subject: feat(tazjin/rlox): Handle whitespace in scanner Change-Id: Iead3efa6aa797af5c5b57c67226205bf7e39e647 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2188 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/rlox/src/scanner.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'users/tazjin') diff --git a/users/tazjin/rlox/src/scanner.rs b/users/tazjin/rlox/src/scanner.rs index 6b34288d1082..17c474ba9b2d 100644 --- a/users/tazjin/rlox/src/scanner.rs +++ b/users/tazjin/rlox/src/scanner.rs @@ -119,6 +119,12 @@ impl<'a> Scanner<'a> { } }, + // ignore whitespace + ' ' => {}, + '\r' => {}, + '\t' => {}, + '\n' => self.line += 1, + unexpected => self.errors.push(Error { line: self.line, kind: ErrorKind::UnexpectedChar(unexpected), -- cgit 1.4.1