metas
This commit is contained in:
parent
004bbef62b
commit
a6090a61ab
30
pl/boot.yap
30
pl/boot.yap
@ -50,30 +50,7 @@ private(_).
|
|||||||
(not)/1,
|
(not)/1,
|
||||||
repeat/0,
|
repeat/0,
|
||||||
throw/1,
|
throw/1,
|
||||||
true/0], ['$$compile'/4,
|
true/0], []).
|
||||||
'$call'/4,
|
|
||||||
'$catch'/3,
|
|
||||||
'$check_callable'/2,
|
|
||||||
'$check_head_and_body'/4,
|
|
||||||
'$check_if_reconsulted'/2,
|
|
||||||
'$clear_reconsulting'/0,
|
|
||||||
'$command'/4,
|
|
||||||
'$cut_by'/1,
|
|
||||||
'$disable_debugging'/0,
|
|
||||||
'$do_live'/0,
|
|
||||||
'$'/0,
|
|
||||||
'$find_goal_definition'/4,
|
|
||||||
'$head_and_body'/3,
|
|
||||||
'$inform_as_reconsulted'/2,
|
|
||||||
'$init_system'/0,
|
|
||||||
'$init_win_graphics'/0,
|
|
||||||
'$loop'/2,
|
|
||||||
'$meta_call'/2,
|
|
||||||
'$prompt_alternatives_on'/1,
|
|
||||||
'$run_at_thread_start'/0,
|
|
||||||
'$system_catch'/4,
|
|
||||||
'$undefp'/1,
|
|
||||||
'$version'/0]).
|
|
||||||
|
|
||||||
:- use_system_module( '$_absf', ['$system_library_directories'/2]).
|
:- use_system_module( '$_absf', ['$system_library_directories'/2]).
|
||||||
|
|
||||||
@ -110,6 +87,11 @@ private(_).
|
|||||||
|
|
||||||
% be careful here not to generate an undefined exception..
|
% be careful here not to generate an undefined exception..
|
||||||
|
|
||||||
|
'$setup_call_catcher_cleanup'(Setup, Goal, Catcher, Cleanup) :-
|
||||||
|
'$setup_call_catcher_cleanup'('$h'(Setup)),
|
||||||
|
'$gated_call'( false , '$h'(Goal), Catcher, '$h'(Cleanup)) .
|
||||||
|
|
||||||
|
|
||||||
print_message(L,E) :-
|
print_message(L,E) :-
|
||||||
'$number_of_clauses'(print_message(L,E), prolog_complete, 1),
|
'$number_of_clauses'(print_message(L,E), prolog_complete, 1),
|
||||||
!,
|
!,
|
||||||
|
@ -40,21 +40,7 @@
|
|||||||
source_file/2,
|
source_file/2,
|
||||||
source_file_property/2,
|
source_file_property/2,
|
||||||
use_module/3],
|
use_module/3],
|
||||||
['$add_multifile'/3,
|
['$initialization'/2]).
|
||||||
'$csult'/2,
|
|
||||||
'$do_startup_reconsult'/1,
|
|
||||||
'$elif'/2,
|
|
||||||
'$else'/1,
|
|
||||||
'$endif'/1,
|
|
||||||
'$if'/2,
|
|
||||||
'$include'/2,
|
|
||||||
'$initialization'/1,
|
|
||||||
'$initialization'/2,
|
|
||||||
'$lf_opt'/3,
|
|
||||||
'$load_files'/3,
|
|
||||||
'$require'/2,
|
|
||||||
'$set_encoding'/1,
|
|
||||||
'$use_module'/3]).
|
|
||||||
|
|
||||||
:- use_system_module( '$_absf', ['$full_filename'/2]).
|
:- use_system_module( '$_absf', ['$full_filename'/2]).
|
||||||
|
|
||||||
@ -1650,11 +1636,11 @@ End of conditional compilation.
|
|||||||
nb_setval('$if_skip_mode',OldMode).
|
nb_setval('$if_skip_mode',OldMode).
|
||||||
|
|
||||||
|
|
||||||
'$if_call'(G) :-
|
'$if_call'(Goal) :-
|
||||||
catch('$eval_if'(G), E, (print_message(error, E), fail)).
|
'$expand_term'(Goal,TrueGoal),
|
||||||
|
catch(once(TrueGoal), E, (print_message(error, E), fail)).
|
||||||
|
|
||||||
'$eval_if'(Goal) :-
|
'$eval_if'(Goal) :-
|
||||||
'$expand_term'(Goal,TrueGoal),
|
|
||||||
once(TrueGoal).
|
once(TrueGoal).
|
||||||
|
|
||||||
'$if_directive'((:- if(_))).
|
'$if_directive'((:- if(_))).
|
||||||
|
@ -471,14 +471,13 @@ b_getval(GlobalVariable, Val) :-
|
|||||||
it saves the importante data about current streams and
|
it saves the importante data about current streams and
|
||||||
debugger state */
|
debugger state */
|
||||||
|
|
||||||
'$debug_state'(state(Trace, Debug, State, SPY_GN, GList, GDList)) :-
|
'$debug_state'(state(Trace, Debug, State, SPY_GN, GList)) :-
|
||||||
'$init_debugger',
|
'$init_debugger',
|
||||||
nb_getval('$trace',Trace),
|
nb_getval('$trace',Trace),
|
||||||
nb_getval('$debug_state',State),
|
nb_getval('$debug_state',State),
|
||||||
current_prolog_flag(debug, Debug),
|
current_prolog_flag(debug, Debug),
|
||||||
nb_getval('$spy_gn',SPY_GN),
|
nb_getval('$spy_gn',SPY_GN),
|
||||||
b_getval('$spy_glist',GList),
|
b_getval('$spy_glist',GList).
|
||||||
b_getval('$spy_depth',GDList).
|
|
||||||
|
|
||||||
|
|
||||||
'$debug_stop' :-
|
'$debug_stop' :-
|
||||||
@ -486,17 +485,15 @@ b_getval(GlobalVariable, Val) :-
|
|||||||
b_setval('$trace',off),
|
b_setval('$trace',off),
|
||||||
set_prolog_flag(debug, false),
|
set_prolog_flag(debug, false),
|
||||||
b_setval('$spy_glist',[]),
|
b_setval('$spy_glist',[]),
|
||||||
b_setval('$spy_gdlist',[]),
|
b_setval('$spy_gdlist',[]).
|
||||||
'$disable_debugging'.
|
|
||||||
|
|
||||||
'$debug_restart'(state(Trace, Debug, State, SPY_GN, GList, GDList)) :-
|
|
||||||
|
'$debug_restart'(state(Trace, Debug, State, SPY_GN, GList)) :-
|
||||||
b_setval('$spy_glist',GList),
|
b_setval('$spy_glist',GList),
|
||||||
b_setval('$spy_gdlist',GDList),
|
|
||||||
b_setval('$spy_gn',SPY_GN),
|
b_setval('$spy_gn',SPY_GN),
|
||||||
set_prolog_flag(debug, Debug),
|
set_prolog_flag(debug, Debug),
|
||||||
nb_setval('$debug_state',State),
|
nb_setval('$debug_state',State),
|
||||||
b_setval('$trace',Trace),
|
b_setval('$trace',Trace).
|
||||||
'$enable_debugging'.
|
|
||||||
|
|
||||||
/** @pred break
|
/** @pred break
|
||||||
|
|
||||||
@ -515,20 +512,34 @@ debugging.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
break :-
|
break :-
|
||||||
|
'$e_setup_call_cleanup'(
|
||||||
|
prolog:'$enter_break'(Dstate,StdStreams,BL,NBL),
|
||||||
|
prolog:'$do_break'(NBL),
|
||||||
|
prolog:'$leave_break'(Dstate,StdStreams,BL)
|
||||||
|
).
|
||||||
|
|
||||||
|
'$enter_break'(DState,streams(InpStream,OutStream,ErrStream),BL,NBL),
|
||||||
'$debug_state'(DState),
|
'$debug_state'(DState),
|
||||||
'$debug_start',
|
|
||||||
'$break'( true ),
|
'$break'( true ),
|
||||||
current_output(OutStream), current_input(InpStream),
|
yap_flag( user_input, InpStream ),
|
||||||
|
yap_flag( user_output, OutStream ),
|
||||||
|
yap_flag( user_error, ErrStream ),
|
||||||
current_prolog_flag(break_level, BL ),
|
current_prolog_flag(break_level, BL ),
|
||||||
NBL is BL+1,
|
NBL is BL+1,
|
||||||
set_prolog_flag(break_level, NBL ),
|
set_prolog_flag(break_level, NBL ).
|
||||||
|
|
||||||
|
|
||||||
|
'$do_break'(NBL) :-
|
||||||
format(user_error, '% Break (level ~w)~n', [NBL]),
|
format(user_error, '% Break (level ~w)~n', [NBL]),
|
||||||
'$do_live',
|
'$do_live',
|
||||||
!,
|
!.
|
||||||
|
|
||||||
|
'$leave_break'(DState,streams(InpStream,OutStream,ErrStream),BL) :-
|
||||||
set_value('$live','$true'),
|
set_value('$live','$true'),
|
||||||
'$debug_restore'(DState),
|
'$debug_restore'(DState),
|
||||||
set_input(InpStream),
|
yap_flag( user_input, InpStream ),
|
||||||
set_output(OutStream),
|
yap_flag( user_output, OutStream ),
|
||||||
|
yap_flag( user_error, ErrStream ),
|
||||||
set_prolog_flag(break_level, BL ),
|
set_prolog_flag(break_level, BL ),
|
||||||
'$break'( false ).
|
'$break'( false ).
|
||||||
|
|
||||||
|
@ -780,7 +780,7 @@ be lost.
|
|||||||
skip( debugger_input, 10),
|
skip( debugger_input, 10),
|
||||||
break,
|
break,
|
||||||
fail.
|
fail.
|
||||||
'$action'('A',_,_,_,_,_) :- !, % 'b break
|
'$action'('A',_,_,_,_,_) :- !, % A ancestors
|
||||||
skip( debugger_input, 10),
|
skip( debugger_input, 10),
|
||||||
'$stack_dump',
|
'$stack_dump',
|
||||||
fail.
|
fail.
|
||||||
|
@ -125,11 +125,13 @@
|
|||||||
|
|
||||||
|
|
||||||
'$exec_directive'(multifile(D), _, M, _, _) :-
|
'$exec_directive'(multifile(D), _, M, _, _) :-
|
||||||
'$system_catch'('$multifile'(D, M), M,
|
catch(multifile(M:D),
|
||||||
Error,
|
Error,
|
||||||
user:'$LoopError'(Error, top)).
|
loop_Error(Error, top)).
|
||||||
'$exec_directive'(discontiguous(D), _, M, _, _) :-
|
'$exec_directive'(discontiguous(D), _, M, _, _) :-
|
||||||
'$discontiguous'(D,M).
|
catch(discontiguous(M:D),
|
||||||
|
Error,
|
||||||
|
loop_Error(Error, top)).
|
||||||
/** @pred initialization
|
/** @pred initialization
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user