WIP: Make the compiler more like a library
This commit is contained in:
parent
5c566644c3
commit
8028fc1d7b
|
@ -45,7 +45,21 @@ void beginCompilation(string[] sourceFiles)
|
|||
|
||||
gprintln("Parsing tokens...");
|
||||
Parser parser = new Parser(currentLexer.getTokens());
|
||||
Module modulle = parser.parse();
|
||||
Module modulle;
|
||||
|
||||
import misc.exceptions;
|
||||
|
||||
try
|
||||
{
|
||||
modulle = parser.parse();
|
||||
}
|
||||
catch(TError e)
|
||||
{
|
||||
gprintln(e.msg, DebugType.ERROR);
|
||||
exit(0); /* TODO: Exit code */ /* TODO: Version that returns or asserts for unit tests */
|
||||
}
|
||||
|
||||
|
||||
|
||||
gprintln("Type checking and symbol resolution...");
|
||||
try
|
||||
|
|
|
@ -55,11 +55,13 @@ public final class Parser
|
|||
|
||||
if(isUnitTest)
|
||||
{
|
||||
throw new TError(message);
|
||||
assert(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(0); /* TODO: Exit code */ /* TODO: Version that returns or asserts for unit tests */
|
||||
throw new TError(message);
|
||||
//exit(0); /* TODO: Exit code */ /* TODO: Version that returns or asserts for unit tests */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue