From 183c584e967555aa0ac858c97afdd3c3623b6bea Mon Sep 17 00:00:00 2001 From: Erin Date: Fri, 11 Jun 2021 18:34:34 +0200 Subject: [PATCH] Removed todo when unknown token --- src/parser.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index 31c695e..2b078ad 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -396,7 +396,12 @@ impl<'source> Parser<'source> { len } Token::LeftCurly => None, - _ => todo!(), + token => { + return Err(Error::new( + ErrorKind::UnexpectedToken(token), + self.lexer.span(), + )) + } }; let mut code: Vec = vec![];