Skip to content

Commit 4361ace

Browse files
committed
WIP: New command line option nobreakloop
Also introduces a new global variable AlwaysPrintTracebackOnError. Funtionality and documentation yet to be implemented.
1 parent c6bd9d1 commit 4361ace

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

lib/init.g

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ fi;
236236
##
237237
## - Unbind `DEBUG_LOADING', since later the `-D' option can be checked.
238238
## - Set or disable break loop according to the `-T' option.
239+
## - Set or disable break loop but keep traceback according to the
240+
## `--nobreakloop' option.
239241
##
240242
CallAndInstallPostRestore( function()
241243
if DEBUG_LOADING then
@@ -250,11 +252,22 @@ CallAndInstallPostRestore( function()
250252
UNBIND_GLOBAL( "TEACHING_MODE" );
251253
BIND_GLOBAL( "TEACHING_MODE", GAPInfo.CommandLineOptions.T );
252254
if IsHPCGAP then
253-
BindThreadLocal( "BreakOnError", not GAPInfo.CommandLineOptions.T );
255+
BindThreadLocal(
256+
"BreakOnError",
257+
not ( GAPInfo.CommandLineOptions.T or GAPInfo.CommandLineOptions.nobreakloop )
258+
);
259+
BindThreadLocal(
260+
"AlwaysPrintTracebackOnError",
261+
GAPInfo.CommandLineOptions.nobreakloop
262+
);
254263
BindThreadLocal( "SilentErrors", false );
255264
BindThreadLocal( "LastErrorMessage", "" );
256265
else
257-
ASS_GVAR( "BreakOnError", not GAPInfo.CommandLineOptions.T );
266+
ASS_GVAR(
267+
"BreakOnError",
268+
not ( GAPInfo.CommandLineOptions.T or GAPInfo.CommandLineOptions.nobreakloop )
269+
);
270+
ASS_GVAR( "AlwaysPrintTracebackOnError", GAPInfo.CommandLineOptions.nobreakloop );
258271
fi;
259272
end);
260273

lib/system.g

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ BIND_GLOBAL( "GAPInfo", rec(
9595
rec( short:= "N", default := false, help := ["do not use hidden implications"] ),
9696
rec( short:= "O", default := false, help := ["disable/enable loading of obsolete files"] ),
9797
rec( short:= "T", default := false, help := ["disable/enable break loop"] ),
98+
rec( long := "nobreakloop", default := false, help := ["disable/enable break loop but keep printing error traceback"]),
9899
rec( long := "quitonbreak", default := false, help := ["quit GAP with non-zero return value instead of entering break loop"]),
99100
,
100101
rec( short:= "L", default := "", arg := "<file>", help := [ "restore a saved workspace"] ),

0 commit comments

Comments
 (0)