WIP: refactor to generalize Machine::run_top_level()

This commit is contained in:
Nicolas Luck
2023-07-17 21:34:26 +02:00
parent c0dd94c8a3
commit 5f8cc3c64b
7 changed files with 196 additions and 204 deletions

View File

@@ -429,28 +429,4 @@ print_exception_with_check(E) :-
% number, a GNU-style error message
% is expected to be printed instead.
; print_exception(E)
).
run_input_once :-
bb_put('$report_all', true),
catch(read_and_match_all_results, E, print_exception(E)).
read_and_match_all_results :-
'$read_query_term'(_, Term, _, _, VarList),
bb_put('$answer_count', 0),
submit_query_and_print_all_results(Term, VarList).
submit_query_and_print_all_results(Term, VarList) :-
'$get_b_value'(B),
bb_put('$report_all', true),
bb_put('$report_n_more', 0),
call(user:Term),
write_eqs_and_read_input(B, VarList),
!.
submit_query_and_print_all_results(_, _) :-
( bb_get('$answer_count', 0) ->
write(' ')
; true
),
write('false.'),
nl.
).