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

View File

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

View File

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

View File

@ -478,6 +478,7 @@ typedef enum
REPRESENTATION_ERROR_CHARACTER, REPRESENTATION_ERROR_CHARACTER,
REPRESENTATION_ERROR_CHARACTER_CODE, REPRESENTATION_ERROR_CHARACTER_CODE,
REPRESENTATION_ERROR_MAX_ARITY, REPRESENTATION_ERROR_MAX_ARITY,
REPRESENTATION_ERROR_VARIABLE,
RESOURCE_ERROR_HUGE_INT, RESOURCE_ERROR_HUGE_INT,
RESOURCE_ERROR_MAX_STREAMS, RESOURCE_ERROR_MAX_STREAMS,
RESOURCE_ERROR_MAX_THREADS, 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] ]. [ 'REPRESENTATION ERROR- ~w: expected character code' - [Where] ].
system_message(error(representation_error(max_arity), Where)) --> system_message(error(representation_error(max_arity), Where)) -->
[ 'REPRESENTATION ERROR- ~w: number too big' - [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)) --> system_message(error(resource_error(code_space), Where)) -->
[ 'RESOURCE ERROR- not enough code space' - [Where] ]. [ 'RESOURCE ERROR- not enough code space' - [Where] ].
system_message(error(resource_error(huge_int), Where)) --> system_message(error(resource_error(huge_int), Where)) -->