make top-level error handling a bit more compatible with SWI.

This commit is contained in:
Vitor Santos Costa 2009-03-10 18:07:50 +00:00
parent fc2e01f320
commit 503d97af90
6 changed files with 19 additions and 15 deletions

View File

@ -697,9 +697,9 @@ install_data:
$(INSTALL_DATA) $(srcdir)/LGPL/pillow/pillow.pl $(DESTDIR)$(SHAREDIR)/Yap/
# (cd CLPQR ; $(MAKE) install)
@INSTALLCLP@(cd LGPL/clp ; $(MAKE) install)
@INSTALLCLP@(cd GPL/clpqr ; $(MAKE) install)
# (cd CHR ; $(MAKE) install)
@INSTALLCLP@(cd packages/chr ; $(MAKE) install)
@INSTALLCLP@(cd packages/clpqr ; $(MAKE) install)
@INSTALLCLP@(cd packages/CLPBN ; $(MAKE) install)
(cd packages/ProbLog ; $(MAKE) install)

View File

@ -1469,9 +1469,6 @@ mkdir -p library/tries
mkdir -p library/rltree
mkdir -p library/lammpi
mkdir -p library/yap2swi
mkdir -p CHR
mkdir -p CLPQR
mkdir -p packages/CLPBN
mkdir -p LGPL
mkdir -p LGPL/JPL
mkdir -p LGPL/JPL/java
@ -1480,18 +1477,19 @@ mkdir -p LGPL/JPL/java/jpl/fli
mkdir -p LGPL/JPL/java/jpl/test
mkdir -p LGPL/JPL/src
mkdir -p LGPL/clp
mkdir -p packages/chr
mkdir -p LGPL/swi_console
mkdir -p packages/PLStream
mkdir -p GPL
mkdir -p GPL/clpqr
mkdir -p GPL/http
mkdir -p packages/chr
mkdir -p packages/CLPBN
mkdir -p packages/cplint
mkdir -p packages/ProbLog
mkdir -p packages/ProbLog/simplecudd
mkdir -p packages/clpqr
AC_OUTPUT(Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile packages/chr/Makefile packages/CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile packages/cplint/Makefile packages/PLStream/Makefile packages/ProbLog/Makefile packages/ProbLog/simplecudd/Makefile)
AC_OUTPUT(Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile packages/chr/Makefile packages/CLPBN/Makefile LGPL/clp/Makefile packages/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile packages/cplint/Makefile packages/PLStream/Makefile packages/ProbLog/Makefile packages/ProbLog/simplecudd/Makefile)
make depend
(cd packages/PLStream; make depend; cd ../..)

View File

@ -246,7 +246,7 @@ print_message(Severity, Term) :-
'$oncenotrace'(prolog:message(Term, Lines, [])) ->
true
;
'$message':generate_message(Term, Lines, [])
'$messages':generate_message(Term, Lines, [])
)
-> ( nonvar(Term),
'$oncenotrace'(user:message_hook(Term, Severity, Lines))
@ -280,19 +280,19 @@ print_message(_, Term) :-
Term = error(syntax_error(_,_,_,_,_,_,_),_), !,
flush_output(user_output),
flush_output(user_error),
'$message':prefix(Level, LinePrefix, Stream, _, Lines), !,
'$messages':prefix(Level, LinePrefix, Stream, _, Lines), !,
% make sure we don't give a PC.
print_message_lines(Stream, LinePrefix, Lines).
'$print_system_message'(Term, Level, Lines) :-
'$message':prefix(Level, LinePrefix, Stream, Prefix),
'$message':file_location(Prefix, LinesF, Lines), !,
'$messages':prefix(Level, LinePrefix, Stream, Prefix),
'$messages':file_location(Prefix, LinesF, Lines), !,
flush_output(user_output),
flush_output(user_error),
print_message_lines(Stream, LinePrefix, LinesF).
'$print_system_message'(Error, Level, Lines) :-
flush_output(user_output),
flush_output(user_error),
'$message':prefix(Level, LinePrefix, Stream, LinesF, Lines), !,
'$messages':prefix(Level, LinePrefix, Stream, LinesF, Lines), !,
print_message_lines(Stream, LinePrefix, LinesF).

View File

@ -127,7 +127,7 @@ system_mode(verbose,off) :- set_value('$verbose',off).
:- use_module('messages.yap').
:- use_module('hacks.yap').
'$system_module'('$message').
'$system_module'('$messages').
'$system_module'('$hacks').
yap_hacks:cut_by(CP) :- '$$cut_by'(CP).

View File

@ -16,7 +16,7 @@
* *
*************************************************************************/
:- module('$message',
:- module('$messages',
[system_message/4,
prefix/6,
prefix/5,
@ -79,7 +79,11 @@ stack_dump(error(_,_)) -->
'$hacks':display_stack_info(CPs, Envs, 20, CP).
stack_dump(_) --> [].
prolog_message(X,Y,Z) :-
system_message(X,Y,Z).
%message(loaded(Past,AbsoluteFileName,user,Msec,Bytes), Prefix, Suffix) :- !,
system_message(query(_QueryResult,_)) --> [].
system_message(format(Msg, Args)) -->
[Msg - Args].
system_message(ancestors([])) -->
@ -485,3 +489,4 @@ prefix(banner, '', user_error) --> [].
prefix(informational, '~*|% '-[LC], user_error) -->
{ '$show_consult_level'(LC) }.

View File

@ -38,6 +38,7 @@
'$hide'('$dbref') :- !, fail. /* not stream position */
'$hide'('$stream') :- !, fail. /* not $STREAM */
'$hide'('$stream_position') :- !, fail. /* not stream position */
'$hide'('$hacks') :- !, fail. /* not stream position */
'$hide'('$hacks') :- !, fail.
'$hide'('$messages') :- !, fail.
'$hide'(Name) :- hide(Name), fail.