py
This commit is contained in:
19
C/atomic.c
19
C/atomic.c
@@ -592,8 +592,9 @@ restart_aux:
|
||||
|
||||
|
||||
The predicate holds when at least one of the arguments is
|
||||
ground (otherwise, YAP will generate an error event. _A_ must be unifiable with an atom, and the
|
||||
argument _L_ with the list of the character codes for string _A_.
|
||||
ground (otherwise, YAP will generate an error event. _A_ must be unifiable
|
||||
with an atom, and the argument _L_ with the list of the character codes for
|
||||
string _A_.
|
||||
|
||||
|
||||
*/
|
||||
@@ -620,7 +621,7 @@ restart_aux:
|
||||
}
|
||||
/* error handling */
|
||||
} else {
|
||||
Yap_ThrowError( TYPE_ERROR_ATOM, t1, NULL);
|
||||
Yap_ThrowError(TYPE_ERROR_ATOM, t1, NULL);
|
||||
}
|
||||
if (LOCAL_Error_TYPE && Yap_HandleError("atom_codes/2")) {
|
||||
goto restart_aux;
|
||||
@@ -727,14 +728,14 @@ static Int number_chars(USES_REGS1) {
|
||||
pop_text_stack(l);
|
||||
return Yap_unify(ARG1, tf);
|
||||
}
|
||||
pop_text_stack(l);
|
||||
pop_text_stack(l);
|
||||
|
||||
LOCAL_ActiveError->errorRawTerm = 0;
|
||||
Yap_ThrowExistingError();
|
||||
|
||||
return false;
|
||||
}
|
||||
pop_text_stack(l);
|
||||
pop_text_stack(l);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1377,7 +1378,7 @@ restart_aux:
|
||||
LOCAL_Error_TYPE = TYPE_ERROR_LIST;
|
||||
} else {
|
||||
seq_tv_t *inpv = (seq_tv_t *)Malloc(n * sizeof(seq_tv_t));
|
||||
seq_tv_t *out = (seq_tv_t *)Malloc( sizeof(seq_tv_t));
|
||||
seq_tv_t *out = (seq_tv_t *)Malloc(sizeof(seq_tv_t));
|
||||
int i = 0;
|
||||
if (!inpv) {
|
||||
LOCAL_Error_TYPE = RESOURCE_ERROR_HEAP;
|
||||
@@ -1465,9 +1466,7 @@ error:
|
||||
if (LOCAL_Error_TYPE && Yap_HandleError("atom_concat/3")) {
|
||||
goto restart_aux;
|
||||
}
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
{ return FALSE; }
|
||||
}
|
||||
|
||||
static Int atomics_to_string2(USES_REGS1) {
|
||||
@@ -2766,6 +2765,8 @@ void Yap_InitAtomPreds(void) {
|
||||
Yap_InitCPred("downcase_atom", 2, downcase_text_to_atom, 0);
|
||||
Yap_InitCPred("upcase_text_to_atom", 2, upcase_text_to_atom, 0);
|
||||
Yap_InitCPred("upcase_atom", 2, upcase_text_to_atom, 0);
|
||||
Yap_InitCPred("text_to_string", 2, downcase_text_to_string, 0);
|
||||
Yap_InitCPred("text_to_atom", 2, downcase_text_to_string, 0);
|
||||
Yap_InitCPred("downcase_text_to_string", 2, downcase_text_to_string, 0);
|
||||
Yap_InitCPred("upcase_text_to_string", 2, upcase_text_to_string, 0);
|
||||
Yap_InitCPred("downcase_text_to_codes", 2, downcase_text_to_codes, 0);
|
||||
|
||||
29
C/exec.c
29
C/exec.c
@@ -1460,7 +1460,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
||||
*/
|
||||
/* reset the registers so that we don't have trash in abstract
|
||||
* machine */
|
||||
pop_text_stack(i+1);
|
||||
pop_text_stack(i + 1);
|
||||
Yap_set_fpu_exceptions(
|
||||
getAtomicGlobalPrologFlag(ARITHMETIC_EXCEPTIONS_FLAG));
|
||||
P = (yamop *)FAILCODE;
|
||||
@@ -1470,12 +1470,12 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
||||
} break;
|
||||
case 3: { /* saved state */
|
||||
// LOCAL_ActiveError = err_info;
|
||||
pop_text_stack(i+1);
|
||||
pop_text_stack(i + 1);
|
||||
LOCAL_CBorder = OldBorder;
|
||||
LOCAL_RestartEnv = sighold;
|
||||
LOCAL_PrologMode = UserMode;
|
||||
LOCAL_DoingUndefp = false;
|
||||
Yap_CloseSlots(sls);
|
||||
LOCAL_DoingUndefp = false;
|
||||
Yap_CloseSlots(sls);
|
||||
return false;
|
||||
}
|
||||
case 4:
|
||||
@@ -1485,16 +1485,16 @@ Yap_CloseSlots(sls);
|
||||
// LOCAL_ActiveError = err_info;
|
||||
while (B) {
|
||||
LOCAL_ActiveError->errorNo = ABORT_EVENT;
|
||||
pop_text_stack(i+1);
|
||||
pop_text_stack(i + 1);
|
||||
Yap_CloseSlots(sls);
|
||||
Yap_JumpToEnv();
|
||||
}
|
||||
LOCAL_PrologMode = UserMode;
|
||||
LOCAL_DoingUndefp = false;
|
||||
P = (yamop *)FAILCODE;
|
||||
LOCAL_DoingUndefp = false;
|
||||
P = (yamop *)FAILCODE;
|
||||
LOCAL_RestartEnv = sighold;
|
||||
Yap_CloseSlots(sls);
|
||||
pop_text_stack(i+1);
|
||||
pop_text_stack(i + 1);
|
||||
return false;
|
||||
break;
|
||||
case 5:
|
||||
@@ -1517,15 +1517,15 @@ Yap_CloseSlots(sls);
|
||||
(CELL *)(B->cp_b) > LCL0 - LOCAL_CBorder) {
|
||||
LOCAL_RestartEnv = sighold;
|
||||
LOCAL_CBorder = OldBorder;
|
||||
pop_text_stack(i+1);
|
||||
return false;
|
||||
pop_text_stack(i + 1);
|
||||
return false;
|
||||
}
|
||||
P = FAILCODE;
|
||||
}
|
||||
}
|
||||
YENV = ASP;
|
||||
YENV[E_CB] = Unsigned(B);
|
||||
pop_text_stack(i+1);
|
||||
pop_text_stack(i + 1);
|
||||
out = Yap_absmi(0);
|
||||
/* make sure we don't leave a FAIL signal hanging around */
|
||||
Yap_get_signal(YAP_FAIL_SIGNAL);
|
||||
@@ -1533,7 +1533,7 @@ Yap_CloseSlots(sls);
|
||||
CalculateStackGap(PASS_REGS1);
|
||||
LOCAL_CBorder = OldBorder;
|
||||
LOCAL_RestartEnv = sighold;
|
||||
pop_text_stack(i+1);
|
||||
pop_text_stack(i + 1);
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -2116,7 +2116,8 @@ static Int jump_env(USES_REGS1) {
|
||||
}
|
||||
// Yap_DebugPlWriteln(t);
|
||||
// char *buf = Yap_TermToBuffer(t, ENC_ISO_UTF8,
|
||||
// Quote_illegal_f | Ignore_ops_f | Unfold_cyclics_f);
|
||||
// Quote_illegal_f | Ignore_ops_f |
|
||||
// Unfold_cyclics_f);
|
||||
// __android_log_print(ANDROID_LOG_INFO, "YAPDroid ", " throw(%s)", buf);
|
||||
LOCAL_ActiveError = Yap_UserError(t0, LOCAL_ActiveError);
|
||||
bool out = JumpToEnv(PASS_REGS1);
|
||||
@@ -2124,7 +2125,7 @@ static Int jump_env(USES_REGS1) {
|
||||
LCL0 - (CELL *)B > LOCAL_CBorder) {
|
||||
// we're failing up to the top layer
|
||||
}
|
||||
pop_text_stack(LOCAL_MallocDepth+1);
|
||||
pop_text_stack(LOCAL_MallocDepth + 1);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user