From: Thierry Marianne Date: Mon, 15 Sep 2025 06:28:23 +0000 (+0200) Subject: throw permission_error when non-input stream is read X-Git-Tag: v0.10.0~2^2~1 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=e9834ffa3ea8680479205bc0dbfaa4de092075fe;p=scryer-prolog.git throw permission_error when non-input stream is read Signed-off-by: Thierry Marianne --- diff --git a/src/machine/machine_state.rs b/src/machine/machine_state.rs index a3c141e0..26ba9a69 100644 --- a/src/machine/machine_state.rs +++ b/src/machine/machine_state.rs @@ -766,7 +766,16 @@ impl MachineState { indices, MachineState::read_term_from_user_input_eof_handler, ), - _ => Err(functor_stub(atom!("read_term_from_user_input"), 3)), + _ => { + let stub = functor_stub(atom!("read_term_from_user_input"), 3); + let err = self.permission_error( + Permission::InputStream, + atom!("stream"), + atom_as_cell!(atom!("user_input")), + ); + + Err(self.error_form(err, stub)) + } } }