getting better
This commit is contained in:
parent
60adbb9a75
commit
8f8da92603
16
C/write.c
16
C/write.c
@ -431,9 +431,10 @@ static inline bool was_visited(Term t, wglbs *wg, Term *ta ) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*ta = *tp;
|
||||||
wg->visited[0] = *tp;
|
wg->visited[0] = *tp;
|
||||||
*tp = MkAtomTerm( (Atom)wg->visited );
|
*tp = MkAtomTerm( (Atom)wg->visited );
|
||||||
wg->visited_top++;
|
wg->visited++;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -441,7 +442,7 @@ static inline bool was_visited(Term t, wglbs *wg, Term *ta ) {
|
|||||||
static inline Term visited_indirection(Term t, wglbs *wg ) {
|
static inline Term visited_indirection(Term t, wglbs *wg ) {
|
||||||
Term *tp = (CELL *)AtomOfTerm(t);
|
Term *tp = (CELL *)AtomOfTerm(t);
|
||||||
if (tp >= wg->visited0
|
if (tp >= wg->visited0
|
||||||
&& (CELL *) *tp < wg->visited_top)
|
&& (CELL *) tp < wg->visited_top)
|
||||||
return *tp;
|
return *tp;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -875,11 +876,16 @@ if ((was_visited(t, wglb, &hot))) {
|
|||||||
lastw = separator;
|
lastw = separator;
|
||||||
}
|
}
|
||||||
} else { /* compound term */
|
} else { /* compound term */
|
||||||
Functor functor = FunctorOfTerm(t);
|
Functor functor;
|
||||||
int Arity;
|
int Arity;
|
||||||
Atom atom;
|
Atom atom;
|
||||||
int op, lp, rp;
|
int op, lp, rp;
|
||||||
|
|
||||||
|
Term argf;
|
||||||
|
if (was_visited(t, wglb, &argf)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
functor = (Functor)argf;
|
||||||
if (IsExtensionFunctor(functor)) {
|
if (IsExtensionFunctor(functor)) {
|
||||||
switch ((CELL)functor) {
|
switch ((CELL)functor) {
|
||||||
case (CELL)FunctorDouble:
|
case (CELL)FunctorDouble:
|
||||||
@ -936,10 +942,6 @@ if ((was_visited(t, wglb, &hot))) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Term argf;
|
|
||||||
if (was_visited(t, wglb, &argf)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!wglb->Ignore_ops && Arity == 1 && Yap_IsPrefixOp(atom, &op, &rp)) {
|
if (!wglb->Ignore_ops && Arity == 1 && Yap_IsPrefixOp(atom, &op, &rp)) {
|
||||||
Term tright = ArgOfTerm(1, t);
|
Term tright = ArgOfTerm(1, t);
|
||||||
|
Reference in New Issue
Block a user