Skip to content

Commit

Permalink
Simplify Read() a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Pfeiffer authored and markuspf committed Nov 14, 2018
1 parent 0adb38b commit 2805c50
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/files.gi
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,24 @@ InstallMethod( Read,
"string",
[ IsString ],
function ( name )
local readIndent, found;
local readIndent;

name := UserHomeExpand(name);

readIndent := SHALLOW_COPY_OBJ( READ_INDENT );
APPEND_LIST_INTR( READ_INDENT, " " );
if GAPInfo.CommandLineOptions.D then
Print( "#I", READ_INDENT, "Read( \"", name, "\" )\n" );
readIndent := SHALLOW_COPY_OBJ( READ_INDENT );
APPEND_LIST_INTR( READ_INDENT, " " );
Print( "#I", READ_INDENT, "Read( \"", name, "\" )\n" );
fi;
found := (IsReadableFile(name)=true) and READ(name);
READ_INDENT := readIndent;
if GAPInfo.CommandLineOptions.D and
found and READ_INDENT = "" then
Print( "#I Read( \"", name, "\" ) done\n" );
fi;
if not found then

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

if GAPInfo.CommandLineOptions.D then
READ_INDENT := readIndent;
if READ_INDENT = "" then
Print( "#I Read( \"", name, "\" ) done\n" );
fi;
fi;
end );


Expand Down

0 comments on commit 2805c50

Please sign in to comment.