make error handling close to ISO.

This commit is contained in:
Vitor Santos Costa 2010-02-26 12:01:08 +00:00
parent 59759cc88e
commit b316710db5

View File

@ -49,14 +49,8 @@ Eval(Term t)
Atom name = AtomOfTerm(t); Atom name = AtomOfTerm(t);
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 0)))) { if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 0)))) {
Term ti[2], terror;
/* error */ /* error */
ti[0] = t; return Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
ti[1] = MkIntegerTerm(0);
/* error */
terror = Yap_MkApplTerm(FunctorSlash, 2, ti);
return Yap_ArithError(TYPE_ERROR_EVALUABLE, terror,
"atom %s for arithmetic expression", "atom %s for arithmetic expression",
RepAtom(name)->StrOfAE); RepAtom(name)->StrOfAE);
} }
@ -143,7 +137,7 @@ p_is(void)
return FALSE; return FALSE;
} }
} else { } else {
Yap_Error(Yap_Error_TYPE, ARG2, Yap_ErrorMessage); Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
return FALSE; return FALSE;
} }
} }