fix error messages
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@338 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
0fa942e238
commit
be135b514f
@ -319,7 +319,7 @@ Error (yap_error_number type, Term where, char *format,...)
|
|||||||
if (type == PURE_ABORT)
|
if (type == PURE_ABORT)
|
||||||
where = TermNil;
|
where = TermNil;
|
||||||
else
|
else
|
||||||
where = Deref(where);
|
where = CopyTerm(Deref(where));
|
||||||
if (IsVarTerm(where)) {
|
if (IsVarTerm(where)) {
|
||||||
/* we must be careful someone gave us a copy to a local variable */
|
/* we must be careful someone gave us a copy to a local variable */
|
||||||
Term t = MkVarTerm();
|
Term t = MkVarTerm();
|
||||||
@ -327,6 +327,7 @@ Error (yap_error_number type, Term where, char *format,...)
|
|||||||
where = Deref(where);
|
where = Deref(where);
|
||||||
}
|
}
|
||||||
PrologMode |= InErrorMode;
|
PrologMode |= InErrorMode;
|
||||||
|
where = CopyTerm(where);
|
||||||
va_start (ap, format);
|
va_start (ap, format);
|
||||||
/* now build the error string */
|
/* now build the error string */
|
||||||
if (format != NULL)
|
if (format != NULL)
|
||||||
@ -1752,7 +1753,7 @@ Error (yap_error_number type, Term where, char *format,...)
|
|||||||
if (type == PURE_ABORT)
|
if (type == PURE_ABORT)
|
||||||
JumpToEnv(MkAtomTerm(LookupAtom("abort")));
|
JumpToEnv(MkAtomTerm(LookupAtom("abort")));
|
||||||
else
|
else
|
||||||
JumpToEnv(CopyTerm(MkApplTerm(fun, 2, nt)));
|
JumpToEnv(MkApplTerm(fun, 2, nt));
|
||||||
P = (yamop *)FAILCODE;
|
P = (yamop *)FAILCODE;
|
||||||
}
|
}
|
||||||
PrologMode &= ~InErrorMode;
|
PrologMode &= ~InErrorMode;
|
||||||
|
@ -251,10 +251,9 @@ module(N) :-
|
|||||||
( '$check_import'(M,T,N,K) ->
|
( '$check_import'(M,T,N,K) ->
|
||||||
% '$format'(user_error,"[vsc1: Importing ~w to ~w]~n",[M:N/K,T]),
|
% '$format'(user_error,"[vsc1: Importing ~w to ~w]~n",[M:N/K,T]),
|
||||||
( T = user ->
|
( T = user ->
|
||||||
( recordzifnot('$import','$import'(M,user,N,K),_) -> write(importing(M,T,N,K)),nl
|
( recordzifnot('$import','$import'(M,user,N,K),_) -> true ; true)
|
||||||
; true)
|
|
||||||
;
|
;
|
||||||
( recordaifnot('$import','$import'(M,T,N,K),_) -> write(importing(M,T,N,K)),nl ; true )
|
( recordaifnot('$import','$import'(M,T,N,K),_) -> true ; true )
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
true
|
true
|
||||||
@ -292,9 +291,9 @@ module(N) :-
|
|||||||
% '$trace_module'(importing(M:N/K,Mod)),
|
% '$trace_module'(importing(M:N/K,Mod)),
|
||||||
% '$format'(user_error,"[vsc2: Importing ~w to ~w]~n",[M:N/K,T]),
|
% '$format'(user_error,"[vsc2: Importing ~w to ~w]~n",[M:N/K,T]),
|
||||||
(Mod = user ->
|
(Mod = user ->
|
||||||
( recordzifnot('$import','$import'(M,user,N,K),_) -> write(importing(M,T,N,K)),nl ; true )
|
( recordzifnot('$import','$import'(M,user,N,K),_) -> true ; true )
|
||||||
;
|
;
|
||||||
( recordaifnot('$import','$import'(M,Mod,N,K),_) -> write(importing(M,T,N,K)),nl ; true )
|
( recordaifnot('$import','$import'(M,Mod,N,K),_) -> true ; true )
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
true
|
true
|
||||||
|
Reference in New Issue
Block a user