about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/errors.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-12-06T17·03+0100
committertazjin <mail@tazj.in>2020-12-06T17·34+0000
commit42405bfa249c3e6ec5e2b7d8fd9836b55269e68f (patch)
treef27859483b4679b91011c71c44818da83b0c0f8b /users/tazjin/rlox/src/errors.rs
parent1835b2be990f51f4111c847aa8ad3c8477191eba (diff)
feat(tazjin/rlox): Synchronise parser state after errors r/1991
This lets the parser collect multiple errors instead of returning
after the first one, with some optimistic synchronisation after
encountering something that looks wonky.

Change-Id: Ie9d0ce8de9dcc7a3d1e7aa2abe15f74cab0ab96b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2236
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/errors.rs')
-rw-r--r--users/tazjin/rlox/src/errors.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/errors.rs b/users/tazjin/rlox/src/errors.rs
index 6bd922bc6c..9ea303829e 100644
--- a/users/tazjin/rlox/src/errors.rs
+++ b/users/tazjin/rlox/src/errors.rs
@@ -3,6 +3,7 @@ pub enum ErrorKind {
     UnexpectedChar(char),
     UnterminatedString,
     UnmatchedParens,
+    ExpectedExpression(String),
 }
 
 #[derive(Debug)]