From e53251a2f7a4dda09afd3d43e22375d345e31a95 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 18 Apr 2023 14:46:43 +0200 Subject: [PATCH] Fix offset for unrecognized tokens --- compiler/parser/src/parser.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/parser/src/parser.rs b/compiler/parser/src/parser.rs index 7704c2ada39..d922eb9cbbc 100644 --- a/compiler/parser/src/parser.rs +++ b/compiler/parser/src/parser.rs @@ -24,7 +24,6 @@ use itertools::Itertools; use std::iter; pub(super) use lalrpop_util::ParseError as LalrpopError; -use ruff_text_size::TextSize; /// Parse a full Python program usually consisting of multiple lines. /// @@ -255,7 +254,7 @@ fn parse_error_from_lalrpop( let expected = (expected.len() == 1).then(|| expected[0].clone()); ParseError { error: ParseErrorType::UnrecognizedToken(token.1, expected), - location: token.0 + TextSize::from(1), + location: token.0, source_path, } }