only evaluate lists with a single character.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2214 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2008-04-08 15:36:53 +00:00
parent 12e18227bb
commit 516a349aad
4 changed files with 24 additions and 9 deletions

View File

@@ -108,6 +108,12 @@ Eval(Term t, E_ARGS)
}
}
} else if (IsPairTerm(t)) {
if (TailOfTerm(t) != TermNil) {
Yap_Error(TYPE_ERROR_EVALUABLE, t,
"string must contain a single character to be evaluated as an arithmetic expression");
P = (yamop *)FAILCODE;
RERROR();
}
return(Eval(HeadOfTerm(t), USE_E_ARGS));
} else if (IsIntTerm(t)) {
RINT(IntOfTerm(t));
@@ -182,6 +188,12 @@ Yap_Eval(Term t, E_ARGS)
}
}
} else if (IsPairTerm(t)) {
if (TailOfTerm(t) != TermNil) {
Yap_Error(TYPE_ERROR_EVALUABLE, t,
"string must contain a single character to be evaluated as an arithmetic expression");
P = (yamop *)FAILCODE;
RERROR();
}
return(Eval(HeadOfTerm(t), USE_E_ARGS));
} else if (IsIntTerm(t)) {
RINT(IntOfTerm(t));