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

Commit

Permalink
Fix offset for unrecognized tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Apr 25, 2023
1 parent 27955e6 commit 9787548
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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,
}
}
Expand Down

0 comments on commit 9787548

Please sign in to comment.