...
This commit is contained in:
@@ -30,6 +30,7 @@ internal static class Program
|
||||
|
||||
private static int Compile(string srcDir)
|
||||
{
|
||||
var error = false;
|
||||
var lexer = new Lexer();
|
||||
var parser = new Parser();
|
||||
var typeChecker = new TypeChecker();
|
||||
@@ -41,9 +42,11 @@ internal static class Program
|
||||
|
||||
var tokenizeResult = lexer.Tokenize(new SourceText(file, content));
|
||||
tokenizeResult.PrintAllDiagnostics();
|
||||
error = error || tokenizeResult.HasErrors;
|
||||
|
||||
var parseResult = parser.ParseModule(tokenizeResult.Value);
|
||||
parseResult.PrintAllDiagnostics();
|
||||
error = error || parseResult.HasErrors;
|
||||
|
||||
if (parseResult.Value != null)
|
||||
{
|
||||
@@ -53,12 +56,13 @@ internal static class Program
|
||||
|
||||
var typeCheckResult = typeChecker.TypeCheck(files);
|
||||
typeCheckResult.PrintAllDiagnostics();
|
||||
error = error || typeCheckResult.HasErrors;
|
||||
|
||||
var generator = new Generator(typeCheckResult.Value);
|
||||
var result = generator.Generate();
|
||||
|
||||
Console.Out.Write(result);
|
||||
|
||||
return 0;
|
||||
return error ? 1 : 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user