replace pairs of usize with location struct

This commit is contained in:
Skgland
2026-01-24 01:54:29 +01:00
committed by Bennet Bleßmann
parent 453a88f03e
commit 3343188756
6 changed files with 96 additions and 102 deletions

View File

@@ -48,12 +48,13 @@ pub(crate) fn error_after_read_term<R>(
parser: &Parser<R>,
) -> CompilationError {
if err.is_unexpected_eof() {
let line_num = parser.lexer.line_num;
let col_num = parser.lexer.col_num;
let location = &parser.lexer.location;
// rough overlap with errors 8.14.1.3 k) & l) of the ISO standard here
if !(line_num == prior_num_lines_read && col_num == 0) {
return CompilationError::from(ParserError::IncompleteReduction(line_num, col_num));
if !(location.line() == prior_num_lines_read && location.column() == 0) {
return CompilationError::from(ParserError::IncompleteReduction(
parser.lexer.location.clone(),
));
}
}