From: Mark Thom Date: Sun, 17 May 2020 05:10:38 +0000 (-0600) Subject: propagate syntax errors from read_term when they're not UnexpectedEOF (#507) X-Git-Tag: v0.8.123~25 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=b3cff6555f12a71dc70b7c85c5b125aa216f1153;p=scryer-prolog.git propagate syntax errors from read_term when they're not UnexpectedEOF (#507) --- diff --git a/src/prolog/machine/machine_state.rs b/src/prolog/machine/machine_state.rs index 6f6c5365..ad2dce34 100644 --- a/src/prolog/machine/machine_state.rs +++ b/src/prolog/machine/machine_state.rs @@ -730,13 +730,16 @@ impl MachineState { if orig_stream.options.eof_action == EOFAction::Reset { if self.fail == false { continue; - } else { - return Ok(()); } } + + return Ok(()); } - return Ok(()); + let stub = MachineError::functor_stub(clause_name!("read_term"), 3); + let err = MachineError::syntax_error(self.heap.h(), err); + + return Err(self.error_form(err, stub)); } } }