fix startline.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2094 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2008-02-12 22:53:02 +00:00
parent afb734b51a
commit 4fa75e361a
2 changed files with 5 additions and 5 deletions

View File

@ -3816,6 +3816,7 @@ static Int
old_H = H; old_H = H;
Yap_eot_before_eof = FALSE; Yap_eot_before_eof = FALSE;
tpos = StreamPosition(inp_stream); tpos = StreamPosition(inp_stream);
StartLine = Stream[inp_stream].linecount;
tokstart = Yap_tokptr = Yap_toktide = Yap_tokenizer(inp_stream); tokstart = Yap_tokptr = Yap_toktide = Yap_tokenizer(inp_stream);
if (Yap_Error_TYPE != YAP_NO_ERROR && seekable) { if (Yap_Error_TYPE != YAP_NO_ERROR && seekable) {
H = old_H; H = old_H;
@ -3876,7 +3877,7 @@ static Int
} else { } else {
Yap_clean_tokenizer(tokstart, Yap_VarTable, Yap_AnonVarTable); 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)); Yap_unify_constant(ARG2, MkAtomTerm (AtomEof));
} }
} }
@ -3934,12 +3935,11 @@ static Int
Yap_Error(SYNTAX_ERROR,terr,Yap_ErrorMessage); Yap_Error(SYNTAX_ERROR,terr,Yap_ErrorMessage);
return FALSE; return FALSE;
} else /* FAIL ON PARSER ERROR */ { } else /* FAIL ON PARSER ERROR */ {
Term t[2], t1; Term t[2];
t[0] = terr; t[0] = terr;
t[1] = MkAtomTerm(Yap_LookupAtom(Yap_ErrorMessage)); t[1] = MkAtomTerm(Yap_LookupAtom(Yap_ErrorMessage));
t1 = MkIntegerTerm(StartLine = tokstart->TokPos);
Yap_clean_tokenizer(tokstart, Yap_VarTable, Yap_AnonVarTable); 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))); Yap_unify(ARG6,Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("error"),2),2,t)));
} }
} }

View File

@ -109,7 +109,7 @@ extract_vars([_-V|Cache], [V|AllVs]) :-
add_evidence(K, V) :- add_evidence(K, V) :-
evidence(K, Ev), !, evidence(K, Ev), !,
clpbn:get_atts(V, [dist(Id,_)]). clpbn:get_atts(V, [dist(Id,_)]),
get_evidence_position(Ev, Id, EvPos), get_evidence_position(Ev, Id, EvPos),
clpbn:put_atts(V, [evidence(EvPos)]). clpbn:put_atts(V, [evidence(EvPos)]).
add_evidence(_, _). add_evidence(_, _).