]> Repositorios git - scryer-prolog.git/commitdiff
propagate syntax errors from read_term when they're not UnexpectedEOF (#507)
authorMark Thom <[email protected]>
Sun, 17 May 2020 05:10:38 +0000 (23:10 -0600)
committerMark Thom <[email protected]>
Sun, 17 May 2020 05:10:38 +0000 (23:10 -0600)
src/prolog/machine/machine_state.rs

index 6f6c53654bafdc8c6a56a74f88ab5eafbe2e08c2..ad2dce34483b897fe51d6edda6880831d66c5303 100644 (file)
@@ -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));
                 }
             }
         }