fix number_chars
This commit is contained in:
parent
72c34cdb8f
commit
8f7c43997e
@ -522,15 +522,19 @@ number_chars( USES_REGS1 )
|
|||||||
if (Yap_IsGroundTerm(t1)) {
|
if (Yap_IsGroundTerm(t1)) {
|
||||||
Term tf;
|
Term tf;
|
||||||
tf = Yap_NumberToListOfAtoms(t1 PASS_REGS);
|
tf = Yap_NumberToListOfAtoms(t1 PASS_REGS);
|
||||||
if (tf)
|
if (tf) {
|
||||||
|
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
||||||
return Yap_unify( ARG2, tf );
|
return Yap_unify( ARG2, tf );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* ARG1 unbound */
|
/* ARG1 unbound */
|
||||||
Term t = Deref(ARG2);
|
Term t = Deref(ARG2);
|
||||||
Term tf = Yap_ListToNumber(t PASS_REGS);
|
Term tf = Yap_ListToNumber(t PASS_REGS);
|
||||||
if (tf)
|
if (tf) {
|
||||||
|
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
||||||
return Yap_unify( ARG1, tf );
|
return Yap_unify( ARG1, tf );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* error handling */
|
/* error handling */
|
||||||
if (LOCAL_Error_TYPE && Yap_HandleError( "number_chars/2" )) {
|
if (LOCAL_Error_TYPE && Yap_HandleError( "number_chars/2" )) {
|
||||||
goto restart_aux;
|
goto restart_aux;
|
||||||
|
Reference in New Issue
Block a user