...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using NubLang.Ast;
|
||||
using NubLang.Diagnostics;
|
||||
using NubLang.Generation;
|
||||
using NubLang.Modules;
|
||||
using NubLang.Syntax;
|
||||
|
||||
var diagnostics = new List<Diagnostic>();
|
||||
@@ -19,13 +20,24 @@ foreach (var file in args)
|
||||
syntaxTrees.Add(syntaxTree);
|
||||
}
|
||||
|
||||
var modules = Module.Collect(syntaxTrees);
|
||||
ModuleRepository moduleRepository;
|
||||
|
||||
try
|
||||
{
|
||||
moduleRepository = ModuleRepository.Create(syntaxTrees);
|
||||
}
|
||||
catch (CompileException e)
|
||||
{
|
||||
Console.Error.WriteLine(e.Diagnostic.FormatANSI());
|
||||
return 1;
|
||||
}
|
||||
|
||||
var compilationUnits = new List<List<TopLevelNode>>();
|
||||
|
||||
for (var i = 0; i < args.Length; i++)
|
||||
{
|
||||
var typeChecker = new TypeChecker(syntaxTrees[i], modules);
|
||||
var compilationUnit = typeChecker.Check();
|
||||
var typeChecker = new TypeChecker();
|
||||
var compilationUnit = typeChecker.Check(syntaxTrees[i], moduleRepository);
|
||||
|
||||
compilationUnits.Add(compilationUnit);
|
||||
diagnostics.AddRange(typeChecker.Diagnostics);
|
||||
|
||||
Reference in New Issue
Block a user