Skip to content

Commit

Permalink
Use InfoRead for Read
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Pfeiffer committed Mar 4, 2018
1 parent ce0e593 commit 5b07667
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/files.gi
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ end);
##
#M Read( <filename> ) . . . . . . . . . . . . . . . . . . . read in a file
##
## READ_INDENT is used to indent diagnostic messages
## while reading files
READ_INDENT := "";
if IsHPCGAP then
MakeThreadLocal("READ_INDENT");
Expand All @@ -204,20 +206,20 @@ InstallMethod( Read,
function ( name )
local readIndent;

if GAPInfo.CommandLineOptions.D then
if InfoLevel(InfoRead) >= 5 then
readIndent := SHALLOW_COPY_OBJ( READ_INDENT );
APPEND_LIST_INTR( READ_INDENT, " " );
Print( "#I", READ_INDENT, "Read( \"", name, "\" )\n" );
Info(InfoRead, 5, READ_INDENT, "Read( \"", name, "\" )" );
fi;

if not READ(UserHomeExpand(name)) then
Error( "file \"", name, "\" must exist and be readable" );
fi;

if GAPInfo.CommandLineOptions.D then
if InfoLevel(InfoRead) >= 5 then
READ_INDENT := readIndent;
if READ_INDENT = "" then
Print( "#I Read( \"", name, "\" ) done\n" );
Info(InfoRead, 5, "Read( \"", name, "\" ) done" );
fi;
fi;
end );
Expand Down

0 comments on commit 5b07667

Please sign in to comment.