small fixes for error handling

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@185 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2001-11-19 03:36:51 +00:00
parent a758ef8cc6
commit 5ab74e898a
3 changed files with 11 additions and 11 deletions

View File

@ -107,15 +107,10 @@ Eval(Term t, E_ARGS)
ExpEntry *p; ExpEntry *p;
if (EndOfPAEntr(p = RepExpProp(GetExpProp(name, 0)))) { if (EndOfPAEntr(p = RepExpProp(GetExpProp(name, 0)))) {
Term ti[2];
/* error */ /* error */
ti[0] = t;
ti[1] = MkIntTerm(0);
t = MkApplTerm(MkFunctor(LookupAtom("/"),2), 2, ti);
Error(TYPE_ERROR_EVALUABLE, t, Error(TYPE_ERROR_EVALUABLE, t,
"functor %s/%d for arithmetic expression", "atom %s for arithmetic expression",
RepAtom(name)->StrOfAE,0); RepAtom(name)->StrOfAE);
P = (yamop *)FAILCODE; P = (yamop *)FAILCODE;
RERROR(); RERROR();
} }

View File

@ -516,7 +516,10 @@ p_execute0(void)
Prop pe; Prop pe;
SMALLUNSGN mod = LookupModule(tmod); SMALLUNSGN mod = LookupModule(tmod);
if (IsAtomTerm(t)) { if (IsVarTerm(t)) {
Error(INSTANTIATION_ERROR,ARG3,"call/1");
return(FALSE);
} else if (IsAtomTerm(t)) {
Atom a = AtomOfTerm(t); Atom a = AtomOfTerm(t);
pe = PredPropByAtom(a, mod); pe = PredPropByAtom(a, mod);
} else if (IsApplTerm(t)) { } else if (IsApplTerm(t)) {
@ -543,8 +546,10 @@ p_execute0(void)
#endif #endif
} }
pe = PredPropByFunc(f, mod); pe = PredPropByFunc(f, mod);
} else } else {
return (FALSE); /* for the moment */ Error(TYPE_ERROR_CALLABLE,ARG3,"call/1");
return(FALSE);
}
/* N = arity; */ /* N = arity; */
/* call may not define new system predicates!! */ /* call may not define new system predicates!! */
return (CallPredicate(RepPredProp(pe), B)); return (CallPredicate(RepPredProp(pe), B));

View File

@ -225,7 +225,7 @@ reconsult(Fs) :-
; ;
throw(error(permission_error(input,stream,Y),include(X))) throw(error(permission_error(input,stream,Y),include(X)))
), ),
'$put_value'('$included_file',OY). '$set_value'('$included_file',OY).
'$include'(V, _) :- '$include'(V, _) :-
throw(error(type_error(atom,V),include(V))). throw(error(type_error(atom,V),include(V))).