Document run_module_predicate and handle critical failure in toplevel.pl

This commit is contained in:
Emilie Burgun
2025-02-06 13:26:16 +01:00
parent d4bf52e82c
commit e68ac8347f
2 changed files with 19 additions and 0 deletions

View File

@@ -29,6 +29,19 @@ load_scryerrc :-
).
'$repl' :-
catch(
start_repl,
_,
% Something bad enough happened that the REPL itself threw an error.
% This can be caused by a broken user_output stream, so we cannot
% print an error.
%
% The best we can do now is halt with an error code,
% so that users can try to diagnose the issue:
halt(99)
).
start_repl :-
asserta('$toplevel':started),
raw_argv(Args0),
( append(Args1, ["--"|_], Args0) ->