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:
12
C/eval.c
12
C/eval.c
@@ -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));
|
||||
|
Reference in New Issue
Block a user