...
This commit is contained in:
@@ -13,7 +13,7 @@ foreach (var fileName in args)
|
||||
foreach (var diagnostic in tokenizerDiagnostics)
|
||||
DiagnosticFormatter.Print(diagnostic, Console.Error);
|
||||
|
||||
if (tokenizerDiagnostics.Any(x => x.Severity == DiagnosticSeverity.Error))
|
||||
if (tokens == null)
|
||||
return 1;
|
||||
|
||||
var ast = Parser.Parse(fileName, tokens, out var parserDiagnostics);
|
||||
@@ -21,7 +21,7 @@ foreach (var fileName in args)
|
||||
foreach (var diagnostic in parserDiagnostics)
|
||||
DiagnosticFormatter.Print(diagnostic, Console.Error);
|
||||
|
||||
if (parserDiagnostics.Any(x => x.Severity == DiagnosticSeverity.Error))
|
||||
if (ast == null)
|
||||
return 1;
|
||||
|
||||
moduleGraphBuilder.AddAst(ast);
|
||||
@@ -33,7 +33,7 @@ var moduleGraph = moduleGraphBuilder.Build(out var moduleGraphDiagnostics);
|
||||
foreach (var diagnostic in moduleGraphDiagnostics)
|
||||
DiagnosticFormatter.Print(diagnostic, Console.Error);
|
||||
|
||||
if (moduleGraphDiagnostics.Any(x => x.Severity == DiagnosticSeverity.Error))
|
||||
if (moduleGraph == null)
|
||||
return 1;
|
||||
|
||||
var functions = new List<TypedNodeDefinitionFunc>();
|
||||
@@ -42,7 +42,7 @@ foreach (var ast in asts)
|
||||
{
|
||||
foreach (var func in ast.Definitions.OfType<NodeDefinitionFunc>())
|
||||
{
|
||||
var typedFunction = TypeChecker.CheckFunction(ast.FileName, func, moduleGraph, out var typeCheckerDiagnostics);
|
||||
var typedFunction = TypeChecker.CheckFunction(ast.FileName, ast.ModuleName.Ident, func, moduleGraph, out var typeCheckerDiagnostics);
|
||||
|
||||
foreach (var diagnostic in typeCheckerDiagnostics)
|
||||
DiagnosticFormatter.Print(diagnostic, Console.Error);
|
||||
@@ -61,6 +61,6 @@ Directory.CreateDirectory(".build");
|
||||
|
||||
File.WriteAllText(".build/out.c", output);
|
||||
|
||||
Process.Start("gcc", ["-Og", "-g", "-o", ".build/out", ".build/out.c"]);
|
||||
Process.Start("gcc", ["-Og", "-g", "-o", ".build/out", ".build/out.c", "-fvisibility=hidden","-fno-builtin"]);
|
||||
|
||||
return 0;
|
||||
Reference in New Issue
Block a user