From 778dbbde3e5d98a70a19928b0d867662fad1580b Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 23 Apr 2002 22:43:10 +0000 Subject: [PATCH] fix anon vars in new syntax_error git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@452 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/errors.c | 1 + C/iopreds.c | 1 + C/utilpreds.c | 4 ++-- docs/yap.tex | 6 ++++++ library/splay.yap | 3 +++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C/errors.c b/C/errors.c index 9421907f5..77decbe27 100644 --- a/C/errors.c +++ b/C/errors.c @@ -363,6 +363,7 @@ Error (yap_error_number type, Term where, char *format,...) PrologMode &= ~AbortMode; PrologMode |= InErrorMode; } else { + plwrite( where, DebugPutc, 0); where = CopyTerm(Deref(where)); if (IsVarTerm(where)) { /* we must be careful someone gave us a copy to a local variable */ diff --git a/C/iopreds.c b/C/iopreds.c index f65554370..ce8276e74 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -2692,6 +2692,7 @@ syntax_error (TokEntry * tokptr) start = tokptr->TokPos; clean_vars(VarTable); + clean_vars(AnonVarTable); while (1) { Term ts[2]; diff --git a/C/utilpreds.c b/C/utilpreds.c index bfca68683..1c1093dbe 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -108,7 +108,7 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H pt0_end = ap2 + 1; ptf = H; H += 2; - if (H > ENV - 2048) { + if (H > ASP - 2048) { goto overflow; } } else if (IsApplTerm(d0)) { @@ -161,7 +161,7 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H H[0] = (CELL)f; ptf = H+1; H += 1+d0; - if (H > ENV - 2048) { + if (H > ASP - 2048) { goto overflow; } } else { diff --git a/docs/yap.tex b/docs/yap.tex index 5c142b843..7299fc415 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -7411,6 +7411,12 @@ already. The variable @var{Val} unifies with a value for key @var{Key}, and the variable @var{NewTree} unifies with the new tree. The predicate will fail if @var{Key} is not present. +@item splay_init(-@var{NewTree}) +@findex splay_init/3 +@snindex splay_init/3 +@cnindex splay_init/3 +Initialise a new splay tree. + @item splay_insert(+@var{Key},?@var{Val},+@var{Tree},-@var{NewTree}) @findex splay_insert/4 @snindex splay_insert/4 diff --git a/library/splay.yap b/library/splay.yap index bcb5ab06c..841c0e198 100644 --- a/library/splay.yap +++ b/library/splay.yap @@ -19,6 +19,7 @@ splay_access/5, splay_insert/4, splay_del/3, + splay_init/1, splay_join/3, splay_split/5]). @@ -184,3 +185,5 @@ join(Left-n(Y, VY, n(X, VX, C, B), NL), n(X, VX, C, n(Y, VY, B, n(Z, VZ, A1, A2) join(Left-NL, n(Z, VZ,A1, A2), Right, New). +splay_init(_). +