indenting and fix bad usage of recover slots.
This commit is contained in:
parent
24b90ae6bd
commit
503b2b93f9
44
C/write.c
44
C/write.c
@ -1,19 +1,19 @@
|
|||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* *
|
* *
|
||||||
* YAP Prolog *
|
* YAP Prolog *
|
||||||
* *
|
* *
|
||||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||||
* *
|
* *
|
||||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||||
* *
|
* *
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
* *
|
* *
|
||||||
* File: write.c *
|
* File: write.c *
|
||||||
* Last rev: *
|
* Last rev: *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: Writing a Prolog Term *
|
* comments: Writing a Prolog Term *
|
||||||
* *
|
* *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
@ -98,7 +98,7 @@ static void writeTerm(Term, int, int, int, struct write_globs *, struct rewind_t
|
|||||||
/*
|
/*
|
||||||
protect bracket from merging with previoous character.
|
protect bracket from merging with previoous character.
|
||||||
avoid stuff like not (2,3) -> not(2,3) or
|
avoid stuff like not (2,3) -> not(2,3) or
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
wropen_bracket(struct write_globs *wglb, int protect)
|
wropen_bracket(struct write_globs *wglb, int protect)
|
||||||
{
|
{
|
||||||
@ -237,7 +237,7 @@ write_mpint(MP_INT *big, struct write_globs *wglb) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* writes a bignum */
|
/* writes a bignum */
|
||||||
static void
|
static void
|
||||||
writebig(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, struct rewind_term *rwt)
|
writebig(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, struct rewind_term *rwt)
|
||||||
{
|
{
|
||||||
@ -729,7 +729,7 @@ restore_from_write(struct rewind_term *rwt, struct write_globs *wglb)
|
|||||||
|
|
||||||
if (wglb->Keep_terms) {
|
if (wglb->Keep_terms) {
|
||||||
ptr = (CELL*)Yap_GetPtrFromSlot(rwt->u_sd.s.ptr PASS_REGS);
|
ptr = (CELL*)Yap_GetPtrFromSlot(rwt->u_sd.s.ptr PASS_REGS);
|
||||||
Yap_RecoverSlots(2 PASS_REGS);
|
//Yap_RecoverSlots(2 PASS_REGS);
|
||||||
} else {
|
} else {
|
||||||
ptr = rwt->u_sd.d.ptr;
|
ptr = rwt->u_sd.d.ptr;
|
||||||
}
|
}
|
||||||
@ -865,7 +865,7 @@ write_list(Term t, int direction, int depth, struct write_globs *wglb, struct re
|
|||||||
writeTerm(from_pointer(RepPair(t)+1, &nrwt, wglb), 999, depth, FALSE, wglb, &nrwt);
|
writeTerm(from_pointer(RepPair(t)+1, &nrwt, wglb), 999, depth, FALSE, wglb, &nrwt);
|
||||||
restore_from_write(&nrwt, wglb);
|
restore_from_write(&nrwt, wglb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1211,9 +1211,9 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
|||||||
|
|
||||||
void
|
void
|
||||||
Yap_plwrite(Term t, void *mywrite, int max_depth, int flags, int priority)
|
Yap_plwrite(Term t, void *mywrite, int max_depth, int flags, int priority)
|
||||||
/* term to be written */
|
/* term to be written */
|
||||||
/* consumer */
|
/* consumer */
|
||||||
/* write options */
|
/* write options */
|
||||||
{
|
{
|
||||||
struct write_globs wglb;
|
struct write_globs wglb;
|
||||||
struct rewind_term rwt;
|
struct rewind_term rwt;
|
||||||
|
Reference in New Issue
Block a user