top-level more SWI style.

This commit is contained in:
Costa Vitor 2013-02-12 12:47:30 -06:00
parent f873074961
commit da79af201b
2 changed files with 13 additions and 10 deletions

View File

@ -497,11 +497,11 @@ true :- true.
'$write_answer'(NV, LGs, Written), '$write_answer'(NV, LGs, Written),
'$write_query_answer_true'(Written), '$write_query_answer_true'(Written),
( (
'$prompt_alternatives_on'(determinism), CP = NCP, DCP = 0 -> '$prompt_alternatives_on'(determinism), CP = NCP, DCP = 0
nl(user_error), ->
format(user_error, '.~n', []),
! !
; ;
'$another', '$another',
! !
), ),
@ -517,8 +517,9 @@ true :- true.
'$delayed_goals'(G, [], NV, LGs, _), '$delayed_goals'(G, [], NV, LGs, _),
'$write_answer'(NV, LGs, Written), '$write_answer'(NV, LGs, Written),
( Written = [] -> ( Written = [] ->
!,'$present_answer'(C, yes); !,'$present_answer'(C, true)
'$another', ! ;
'$another', !
), ),
fail. fail.
'$yes_no'(_,_) :- '$yes_no'(_,_) :-
@ -546,9 +547,9 @@ true :- true.
'$out_neg_answer' :- '$out_neg_answer' :-
( '$undefined'(print_message(_,_),prolog) -> ( '$undefined'(print_message(_,_),prolog) ->
'$present_answer'(user_error,"no~n", []) '$present_answer'(user_error,'false.~n', [])
; ;
print_message(help,no) print_message(help,false)
), ),
fail. fail.
@ -559,7 +560,7 @@ true :- true.
( '$enter_system_mode' ; '$exit_system_mode', fail). ( '$enter_system_mode' ; '$exit_system_mode', fail).
'$write_query_answer_true'([]) :- !, '$write_query_answer_true'([]) :- !,
format(user_error,'~ntrue',[]). format(user_error,'true',[]).
'$write_query_answer_true'(_). '$write_query_answer_true'(_).
@ -579,7 +580,7 @@ true :- true.
write_term(user_error,Answ,Opts) ; write_term(user_error,Answ,Opts) ;
format(user_error,'~w',[Answ]) format(user_error,'~w',[Answ])
), ),
format(user_error,'~n', []). format(user_error,'.~n', []).
'$another' :- '$another' :-
format(user_error,' ? ',[]), format(user_error,' ? ',[]),
@ -588,7 +589,7 @@ true :- true.
'$do_another'(C) :- '$do_another'(C) :-
( C== 0'; -> skip(user_input,10), %' ( C== 0'; -> skip(user_input,10), %'
'$add_nl_outside_console', % '$add_nl_outside_console',
fail fail
; ;
C== 10 -> '$add_nl_outside_console', C== 10 -> '$add_nl_outside_console',

View File

@ -37,6 +37,8 @@ file_position(FileName,LN,MsgCodes) -->
generate_message(halt) --> !, generate_message(halt) --> !,
['YAP execution halted']. ['YAP execution halted'].
generate_message(false) --> !,
['false.'].
generate_message('$abort') --> !, generate_message('$abort') --> !,
['YAP execution aborted']. ['YAP execution aborted'].
generate_message(abort(user)) --> !, generate_message(abort(user)) --> !,