From: Mark Date: Mon, 4 Dec 2023 18:19:36 +0000 (-0700) Subject: add module name and missing predicate key to module_does_not_contain_claimed_export... X-Git-Tag: v0.9.4~87 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=004201abda111d786d6f899c98b9603f18c5f5d1;p=scryer-prolog.git add module name and missing predicate key to module_does_not_contain_claimed_export error (#2195) --- diff --git a/src/machine/machine_errors.rs b/src/machine/machine_errors.rs index f509b46c..02133f32 100644 --- a/src/machine/machine_errors.rs +++ b/src/machine/machine_errors.rs @@ -492,13 +492,22 @@ impl MachineState { self.permission_error(Permission::Modify, atom!("static_module"), module) } SessionError::ExistenceError(err) => self.existence_error(err), - SessionError::ModuleDoesNotContainExport(..) => { - let error_atom = atom!("module_does_not_contain_claimed_export"); + SessionError::ModuleDoesNotContainExport(module_name, key) => { + let functor_stub = functor_stub(key.0, key.1); + + let stub = functor!( + atom!("module_does_not_contain_claimed_export"), + [ + atom(module_name), + str(self.heap.len() + 4, 0) + ], + [functor_stub] + ); self.permission_error( Permission::Access, atom!("private_procedure"), - functor!(error_atom), + stub, ) } SessionError::ModuleCannotImportSelf(module_name) => {