From 24f5b060d57af9c3ade5c06e3dabb9d2a2e8a424 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 2 Mar 2010 23:18:04 +0000 Subject: [PATCH] improve previous patch for syntax_error. --- C/iopreds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C/iopreds.c b/C/iopreds.c index 75a88777c..29c62005f 100755 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -3847,7 +3847,11 @@ syntax_error (TokEntry * tokptr, int sno, Term *outp) } tokptr = tokptr->TokNext; } - tf[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomRead,1),1,outp); + if (IsVarTerm(*outp) && (VarOfTerm(*outp) > H || VarOfTerm(*outp) < H0)) { + tf[0] = Yap_MkNewApplTerm(Yap_MkFunctor(AtomRead,1),1); + } else { + tf[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomRead,1),1,outp); + } { Term t[3];