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

@@ -1016,7 +1016,7 @@ impl MachineState {
self.unify_fixnum(n, nx);
}
_ => {
let err = ParserError::ParseBigInt(0, 0);
let err = ParserError::ParseBigInt(parser.lexer.location.clone());
let err = self.syntax_error(err);
return Err(self.error_form(err, stub_gen()));
@@ -1026,9 +1026,7 @@ impl MachineState {
return Ok(());
}
Ok(c) => {
let (line_num, col_num) = (lexer.line_num, lexer.col_num);
let err = ParserError::UnexpectedChar(c, line_num, col_num);
let err = ParserError::UnexpectedChar(c, lexer.location);
let err = self.syntax_error(err);
return Err(self.error_form(err, stub_gen()));
@@ -9196,7 +9194,7 @@ impl Machine {
stream.add_lines_read(parser.lines_read());
}
Ok(true) => {
stream.add_lines_read(parser.lexer.line_num);
stream.add_lines_read(parser.lexer.location.line());
self.machine_st.fail = true;
}
Err(err) => {