Skip to content

Commit

Permalink
WIP: New command line option nobreakloop
Browse files Browse the repository at this point in the history
Also introduces a new global variable AlwaysPrintTracebackOnError.

Funtionality and documentation yet to be implemented.
  • Loading branch information
ssiccha committed Jun 14, 2018
1 parent c6bd9d1 commit 4361ace
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ fi;
##
## - Unbind `DEBUG_LOADING', since later the `-D' option can be checked.
## - Set or disable break loop according to the `-T' option.
## - Set or disable break loop but keep traceback according to the
## `--nobreakloop' option.
##
CallAndInstallPostRestore( function()
if DEBUG_LOADING then
Expand All @@ -250,11 +252,22 @@ CallAndInstallPostRestore( function()
UNBIND_GLOBAL( "TEACHING_MODE" );
BIND_GLOBAL( "TEACHING_MODE", GAPInfo.CommandLineOptions.T );
if IsHPCGAP then
BindThreadLocal( "BreakOnError", not GAPInfo.CommandLineOptions.T );
BindThreadLocal(
"BreakOnError",
not ( GAPInfo.CommandLineOptions.T or GAPInfo.CommandLineOptions.nobreakloop )
);
BindThreadLocal(
"AlwaysPrintTracebackOnError",
GAPInfo.CommandLineOptions.nobreakloop
);
BindThreadLocal( "SilentErrors", false );
BindThreadLocal( "LastErrorMessage", "" );
else
ASS_GVAR( "BreakOnError", not GAPInfo.CommandLineOptions.T );
ASS_GVAR(
"BreakOnError",
not ( GAPInfo.CommandLineOptions.T or GAPInfo.CommandLineOptions.nobreakloop )
);
ASS_GVAR( "AlwaysPrintTracebackOnError", GAPInfo.CommandLineOptions.nobreakloop );
fi;
end);

Expand Down
1 change: 1 addition & 0 deletions lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ BIND_GLOBAL( "GAPInfo", rec(
rec( short:= "N", default := false, help := ["do not use hidden implications"] ),
rec( short:= "O", default := false, help := ["disable/enable loading of obsolete files"] ),
rec( short:= "T", default := false, help := ["disable/enable break loop"] ),
rec( long := "nobreakloop", default := false, help := ["disable/enable break loop but keep printing error traceback"]),
rec( long := "quitonbreak", default := false, help := ["quit GAP with non-zero return value instead of entering break loop"]),
,
rec( short:= "L", default := "", arg := "<file>", help := [ "restore a saved workspace"] ),
Expand Down

0 comments on commit 4361ace

Please sign in to comment.