more fixes to modules

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2102 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2008-02-15 12:41:33 +00:00
parent 6cc240fe7f
commit e748bd9b33
4 changed files with 30 additions and 15 deletions

View File

@@ -218,14 +218,17 @@ init_current_module(void)
static Int
p_strip_module(void)
{
Term t1 = Deref(ARG1), t2, tmod;
Term t1 = Deref(ARG1), t2, tmod = CurrentModule;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
if (IsVarTerm(t1) ||
!IsApplTerm(t1) ||
FunctorOfTerm(t1) != FunctorModule ||
IsVarTerm(t2 = ArgOfTerm(1,t1)) ||
!IsAtomTerm(t2)) {
return Yap_unify(ARG3, t1) &&
Yap_unify(ARG2, CurrentModule);
Yap_unify(ARG2, tmod);
}
do {
tmod = t2;