configurarion changes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@369 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
53
C/arrays.c
53
C/arrays.c
@@ -1260,38 +1260,31 @@ replace_array_references(Term t0)
|
||||
Term t;
|
||||
|
||||
t = Deref(t0);
|
||||
do {
|
||||
if (IsVarTerm(t)) {
|
||||
/* we found a variable */
|
||||
return (MkPairTerm(t, TermNil));
|
||||
}
|
||||
else if (IsAtomOrIntTerm(t)) {
|
||||
return (MkPairTerm(t, TermNil));
|
||||
}
|
||||
else if (IsPairTerm(t)) {
|
||||
Term VList = MkVarTerm();
|
||||
CELL *h0 = H;
|
||||
if (IsVarTerm(t)) {
|
||||
/* we found a variable */
|
||||
return (MkPairTerm(t, TermNil));
|
||||
} else if (IsAtomOrIntTerm(t)) {
|
||||
return (MkPairTerm(t, TermNil));
|
||||
} else if (IsPairTerm(t)) {
|
||||
Term VList = MkVarTerm();
|
||||
CELL *h0 = H;
|
||||
|
||||
H += 2;
|
||||
replace_array_references_complex(RepPair(t) - 1, RepPair(t) + 1, h0,
|
||||
VList);
|
||||
return (MkPairTerm(AbsPair(h0), VList));
|
||||
}
|
||||
else {
|
||||
Term VList = MkVarTerm();
|
||||
CELL *h0 = H;
|
||||
Functor f = FunctorOfTerm(t);
|
||||
H += 2;
|
||||
replace_array_references_complex(RepPair(t) - 1, RepPair(t) + 1, h0,
|
||||
VList);
|
||||
return (MkPairTerm(AbsPair(h0), VList));
|
||||
} else {
|
||||
Term VList = MkVarTerm();
|
||||
CELL *h0 = H;
|
||||
Functor f = FunctorOfTerm(t);
|
||||
|
||||
*H++ = (CELL) (f);
|
||||
H += ArityOfFunctor(f);
|
||||
replace_array_references_complex(RepAppl(t),
|
||||
RepAppl(t) + ArityOfFunctor(FunctorOfTerm(t)), h0 + 1,
|
||||
VList);
|
||||
return (MkPairTerm(AbsAppl(h0), VList));
|
||||
}
|
||||
} while (TRUE);
|
||||
/* make lcc happy */
|
||||
return(FALSE);
|
||||
*H++ = (CELL) (f);
|
||||
H += ArityOfFunctor(f);
|
||||
replace_array_references_complex(RepAppl(t),
|
||||
RepAppl(t) + ArityOfFunctor(FunctorOfTerm(t)), h0 + 1,
|
||||
VList);
|
||||
return (MkPairTerm(AbsAppl(h0), VList));
|
||||
}
|
||||
}
|
||||
|
||||
static Int
|
||||
|
Reference in New Issue
Block a user