From 4fa75e361a0e922c3edae7c9d51ce6d540672bb5 Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 12 Feb 2008 22:53:02 +0000 Subject: [PATCH] fix startline. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2094 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/iopreds.c | 8 ++++---- CLPBN/clpbn/evidence.yap | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C/iopreds.c b/C/iopreds.c index ae65643f7..31a3d812c 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -3816,6 +3816,7 @@ static Int old_H = H; Yap_eot_before_eof = FALSE; tpos = StreamPosition(inp_stream); + StartLine = Stream[inp_stream].linecount; tokstart = Yap_tokptr = Yap_toktide = Yap_tokenizer(inp_stream); if (Yap_Error_TYPE != YAP_NO_ERROR && seekable) { H = old_H; @@ -3876,7 +3877,7 @@ static Int } else { Yap_clean_tokenizer(tokstart, Yap_VarTable, Yap_AnonVarTable); - return Yap_unify(MkIntegerTerm(StartLine = Stream[inp_stream].linecount),ARG5) && + return Yap_unify(tpos,ARG5) && Yap_unify_constant(ARG2, MkAtomTerm (AtomEof)); } } @@ -3934,12 +3935,11 @@ static Int Yap_Error(SYNTAX_ERROR,terr,Yap_ErrorMessage); return FALSE; } else /* FAIL ON PARSER ERROR */ { - Term t[2], t1; + Term t[2]; t[0] = terr; t[1] = MkAtomTerm(Yap_LookupAtom(Yap_ErrorMessage)); - t1 = MkIntegerTerm(StartLine = tokstart->TokPos); Yap_clean_tokenizer(tokstart, Yap_VarTable, Yap_AnonVarTable); - return(Yap_unify(t1,ARG5) && + return(Yap_unify(tpos,ARG5) && Yap_unify(ARG6,Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("error"),2),2,t))); } } diff --git a/CLPBN/clpbn/evidence.yap b/CLPBN/clpbn/evidence.yap index 6f3fc735f..42aea2598 100644 --- a/CLPBN/clpbn/evidence.yap +++ b/CLPBN/clpbn/evidence.yap @@ -109,7 +109,7 @@ extract_vars([_-V|Cache], [V|AllVs]) :- add_evidence(K, V) :- evidence(K, Ev), !, - clpbn:get_atts(V, [dist(Id,_)]). + clpbn:get_atts(V, [dist(Id,_)]), get_evidence_position(Ev, Id, EvPos), clpbn:put_atts(V, [evidence(EvPos)]). add_evidence(_, _).