Skip to content

Commit

Permalink
Compiler
Browse files Browse the repository at this point in the history
- Made `gibFileData(string sourceFile)` public
- Added `getTypeChecker()` to the `Compiler` class
  • Loading branch information
deavmi committed Nov 5, 2023
1 parent b29be46 commit ade7f1b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion source/tlang/compiler/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,25 @@ public class Compiler
this.typeChecker.beginCheck();
}

/**
* Returns the type checker instance of
* this compiler
*
* Returns: the type checker
* Throws:
* CompilerException if you have not
* called `doTypeCheck()` yet
*/
public TypeChecker getTypeChecker()
{
if(typeChecker is null)
{
throw new CompilerException(CompilerError.TYPECHECK_NOT_YET_PERFORMED);
}

return this.typeChecker;
}

/* Perform code emitting */
public void doEmit()
{
Expand Down Expand Up @@ -255,7 +274,7 @@ public class Compiler
* sourceFile = the path to the file to open
* Returns: the source data
*/
private string gibFileData(string sourceFile)
public string gibFileData(string sourceFile)
{
File sourceFileFile;
sourceFileFile.open(sourceFile); /* TODO: Error handling with ANY file I/O */
Expand Down

0 comments on commit ade7f1b

Please sign in to comment.