Skip to content

Commit

Permalink
MduleManager
Browse files Browse the repository at this point in the history
- Added `readModuleData_throwable(ModuleEntry ent)` method
  • Loading branch information
deavmi committed Oct 29, 2023
1 parent 80a3a4c commit 8790474
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/tlang/compiler/modman/modman.d
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,21 @@ public final class ModuleManager
}
}


public string readModuleData_throwable(ModuleEntry ent)
{
string source;

if(readModuleData(ent, source))
{
return source;
}
else
{
throw new ModuleManagerError(this, "Could not open module '"~ent.moduleName~"' at '"~ent.filename~"' for reading");
}
}

import std.stdio;
import std.exception : ErrnoException;
public static bool readModuleData(ModuleEntry ent, ref string source)
Expand Down

0 comments on commit 8790474

Please sign in to comment.