Add with_col_offset and with_row_offset to Location

This commit is contained in:
harupy 2023-01-04 13:16:03 +09:00
parent 515dceb07b
commit 6d140426c1
3 changed files with 43 additions and 7 deletions

View file

@ -213,7 +213,7 @@ pub(crate) fn parse_error_from_lalrpop(
let expected = (expected.len() == 1).then(|| expected[0].clone());
ParseError {
error: ParseErrorType::UnrecognizedToken(token.1, expected),
location: Location::new(token.0.row(), token.0.column() + 1),
location: token.0.with_col_offset(1),
source_path,
}
}