clarify EOF error across stream types and predicates (#1867, #1870)

This commit is contained in:
Mark
2023-07-08 13:38:32 -06:00
parent 2e26f37f5e
commit 067b5998ee
11 changed files with 84 additions and 71 deletions

View File

@@ -634,21 +634,24 @@ impl MachineState {
return Ok(unify_fn!(*self, var_names_offset, var_names_addr));
}
Err(err) => {
if let CompilationError::ParserError(ParserError::UnexpectedEOF) = err {
self.eof_action(
self.registers[2],
stream,
atom!("read_term"),
3,
)?;
match err {
CompilationError::ParserError(e) if e.is_unexpected_eof() => {
self.eof_action(
self.registers[2],
stream,
atom!("read_term"),
3,
)?;
if stream.options().eof_action() == EOFAction::Reset {
if self.fail == false {
continue;
if stream.options().eof_action() == EOFAction::Reset {
if self.fail == false {
continue;
}
}
}
return Ok(());
return Ok(());
}
_ => {}
}
let stub = functor_stub(atom!("read_term"), 3);