Skip to content
This repository was archived by the owner on May 11, 2023. It is now read-only.

Commit 9787548

Browse files
committed
Fix offset for unrecognized tokens
1 parent 27955e6 commit 9787548

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/parser/src/parser.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use itertools::Itertools;
2424
use std::iter;
2525

2626
pub(super) use lalrpop_util::ParseError as LalrpopError;
27-
use ruff_text_size::TextSize;
2827

2928
/// Parse a full Python program usually consisting of multiple lines.
3029
///
@@ -255,7 +254,7 @@ fn parse_error_from_lalrpop(
255254
let expected = (expected.len() == 1).then(|| expected[0].clone());
256255
ParseError {
257256
error: ParseErrorType::UnrecognizedToken(token.1, expected),
258-
location: token.0 + TextSize::from(1),
257+
location: token.0,
259258
source_path,
260259
}
261260
}

0 commit comments

Comments
 (0)