From 3d7c89634e1f7032cac963bb703effc1bcfc42c4 Mon Sep 17 00:00:00 2001 From: Erin Date: Fri, 11 Jun 2021 18:31:25 +0200 Subject: [PATCH] Fixed invalid spanning of UnexpectedToken in `parse_expr` --- src/parser.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 0ee4c4f8..31c695e6 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -208,10 +208,7 @@ impl<'source> Parser<'source> { start..self.lexer.span().end, )), Token::LeftParen => self.expr_flow(Token::RightParen), - t => Err(Error::new( - ErrorKind::UnexpectedToken(t), - start..self.lexer.span().end, - )), + t => Err(Error::new(ErrorKind::UnexpectedToken(t), self.lexer.span())), } }