replace TYPE_ERROR_VARIABLE for attributes #57

This commit is contained in:
Vitor Santos Costa 2009-05-22 21:51:48 -05:00
parent 264d9322b9
commit f79d79e926
5 changed files with 21 additions and 18 deletions

View File

@ -482,8 +482,8 @@ p_put_att(void) {
PutAtt(IntegerOfTerm(Deref(ARG4)), tatts, Deref(ARG5));
return TRUE;
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"put_attributes/2");
return(FALSE);
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of put_attributes/2");
return FALSE;
}
}
@ -516,7 +516,7 @@ p_put_att_term(void) {
}
return TRUE;
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"put_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of put_att_term/2");
return(FALSE);
}
}
@ -561,7 +561,7 @@ p_rm_att(void) {
}
return TRUE;
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"put_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of rm_att/2");
return(FALSE);
}
}
@ -599,7 +599,7 @@ p_put_atts(void) {
}
return TRUE;
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"put_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of put_att/2");
return FALSE;
}
}
@ -655,7 +655,7 @@ p_get_att(void) {
return FALSE;
}
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"put_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of get_att/2");
return(FALSE);
}
}
@ -682,7 +682,7 @@ p_free_att(void) {
return TRUE;
}
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"put_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of free_att/2");
return(FALSE);
}
}
@ -723,7 +723,7 @@ p_get_atts(void) {
return FALSE;
}
} else {
// Yap_Error(TYPE_ERROR_VARIABLE,inp,"get_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of get_att/2");
return(FALSE);
}
}
@ -747,7 +747,7 @@ p_has_atts(void) {
return FALSE;
}
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"has_attributes/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of has_atts/2");
return(FALSE);
}
}
@ -764,7 +764,7 @@ p_bind_attvar(void) {
}
return(TRUE);
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"bind_att/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of bind_attvar/2");
return(FALSE);
}
}
@ -781,7 +781,7 @@ p_get_all_atts(void) {
}
return TRUE;
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"get_att/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of get_all_atts/2");
return FALSE;
}
}
@ -829,7 +829,7 @@ p_modules_with_atts(void) {
}
return Yap_unify(ARG2,TermNil);
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"get_att/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of modules_with_attributes/2");
return FALSE;
}
}
@ -869,7 +869,7 @@ p_swi_all_atts(void) {
}
return Yap_unify(ARG2,TermNil);
} else {
Yap_Error(TYPE_ERROR_VARIABLE,inp,"get_att/2");
Yap_Error(REPRESENTATION_ERROR_VARIABLE,inp,"first argument of get_all_swi_atts/2");
return FALSE;
}
}

View File

@ -1323,14 +1323,14 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
serious = TRUE;
}
break;
case RESOURCE_ERROR_MAX_THREADS:
case REPRESENTATION_ERROR_VARIABLE:
{
int i;
Term ti[1];
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomThreads);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
ti[0] = MkAtomTerm(AtomVariable);
nt[0] = Yap_MkApplTerm(FunctorRepresentationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;

View File

@ -1540,8 +1540,8 @@ JumpToEnv(Term t) {
B->cp_cp = (yamop *)env[E_CP];
B->cp_env = (CELL *)env[E_E];
B->cp_ap = NEXTOP(PredHandleThrow->CodeOfPred,l);
/* cannot recover Heap because of copy term :-( */
B->cp_h = H;
/* can recover Heap thanks to copy term :-( */
/* B->cp_h = H; */
/* I could backtrack here, but it is easier to leave the unwinding
to the emulator */
B->cp_a3 = t;

View File

@ -478,6 +478,7 @@ typedef enum
REPRESENTATION_ERROR_CHARACTER,
REPRESENTATION_ERROR_CHARACTER_CODE,
REPRESENTATION_ERROR_MAX_ARITY,
REPRESENTATION_ERROR_VARIABLE,
RESOURCE_ERROR_HUGE_INT,
RESOURCE_ERROR_MAX_STREAMS,
RESOURCE_ERROR_MAX_THREADS,

View File

@ -244,6 +244,8 @@ system_message(error(representation_error(character_code), Where)) -->
[ 'REPRESENTATION ERROR- ~w: expected character code' - [Where] ].
system_message(error(representation_error(max_arity), Where)) -->
[ 'REPRESENTATION ERROR- ~w: number too big' - [Where] ].
system_message(error(representation_error(variable), Where)) -->
[ 'REPRESENTATION ERROR- ~w: should be a variable' - [Where] ].
system_message(error(resource_error(code_space), Where)) -->
[ 'RESOURCE ERROR- not enough code space' - [Where] ].
system_message(error(resource_error(huge_int), Where)) -->