From 4a28e5861aec7cff99aa8cc8ab53f822bf5f2c68 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 9 Aug 2018 02:07:57 +0100 Subject: [PATCH] reexport --- pl/consult.yap | 7 +++++-- pl/modules.yap | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pl/consult.yap b/pl/consult.yap index d193cab5c..d3967e0a4 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -1347,8 +1347,11 @@ account the following observations: */ '$reexport'( TOpts, File, Reexport, Imports, OldF ) :- ( Reexport == false -> true ; - '$lf_opt'('$parent_topts', TOpts, OldTOpts), - '$lf_opt'('$context_module', OldTOpts, OldContextModule), + ( '$lf_opt'('$parent_topts', TOpts, OldTOpts), + '$lf_opt'('$context_module', OldTOpts, OldContextModule) + ; + OldContextModule = user + ), '$import_to_current_module'(File, OldContextModule, Imports, _, TOpts), '$extend_exports'(File, Imports, OldF ) ). diff --git a/pl/modules.yap b/pl/modules.yap index 3dcfb5e2e..625094b1d 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -429,6 +429,7 @@ export_list(Module, List) :- '$do_import'(T, Module, ContextModule), '$add_to_imports'(Tab, Module, ContextModule). +%'$do_import'(K, _, _) :- writeln(K), fail. '$do_import'(op(Prio,Assoc,Name), _Mod, ContextMod) :- op(Prio,Assoc,ContextMod:Name). '$do_import'(N0/K0-N0/K0, Mod, Mod) :- !.