shrink scope of control_entry_point catch, add CutPoint tag to printer

This commit is contained in:
Mark
2023-07-05 14:50:38 -06:00
parent 5b81bee941
commit 5ffdd2d91a
2 changed files with 5 additions and 12 deletions

View File

@@ -1532,7 +1532,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
});
}
}
(HeapCellValueTag::Fixnum, n) => {
(HeapCellValueTag::Fixnum | HeapCellValueTag::CutPoint, n) => {
self.print_number(max_depth, NumberFocus::Unfocused(Number::Fixnum(n)), &op);
}
(HeapCellValueTag::F64, f) => {

View File

@@ -301,19 +301,12 @@ set_cp(B) :- '$set_cp'(B).
control_entry_point(G) :-
functor(G, Name, Arity),
catch(builtins:control_entry_point_(G),
dispatch_prep_error,
builtins:throw(error(type_error(callable, G), Name/Arity))).
:- non_counted_backtracking control_entry_point_/1.
control_entry_point_(G) :-
'$get_cp'(B),
dispatch_prep(G,B,Conts),
catch('$call'(builtins:dispatch_prep(G,B,Conts)),
dispatch_prep_error,
'$call'(builtins:throw(error(type_error(callable, G), Name/Arity)))),
dispatch_call_list(Conts).
:- non_counted_backtracking cont_list_to_goal/2.
cont_list_goal([Cont], Cont) :- !.
@@ -771,7 +764,7 @@ catch(G,C,R,Bb) :-
end_block(Bb, NBb) :-
'$clean_up_block'(NBb),
'$reset_block'(Bb).
end_block(Bb, NBb) :-
end_block(_Bb, NBb) :-
'$reset_block'(NBb),
'$fail'.