From 76e5fb9043d5677974e237c1d2c8d721659e2dbf 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 31c695e6..2b078ad5 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![];