about summary refs log tree commit diff
path: root/users/tazjin
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-11-28T15·54+0100
committertazjin <mail@tazj.in>2020-11-28T16·33+0000
commit4277d3e6b4ac1525b1810d917ff3820f35285f42 (patch)
treefd4a4e139c92a85393908108110801045533fdb4 /users/tazjin
parent9f61579dde53959486c80f1d2a5a7ab660ca93cd (diff)
feat(tazjin/rlox): Handle whitespace in scanner r/1951
Change-Id: Iead3efa6aa797af5c5b57c67226205bf7e39e647
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2188
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin')
-rw-r--r--users/tazjin/rlox/src/scanner.rs6
1 files changed, 6 insertions, 0 deletions
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),