This commit is contained in:
nub31
2026-02-10 23:03:27 +01:00
parent 9d8d8f255a
commit c65fbeba13
8 changed files with 266 additions and 199 deletions

View File

@@ -2,13 +2,23 @@
namespace Compiler;
public sealed class Generator(List<TypedNodeDefinitionFunc> functions, ModuleGraph moduleGraph, bool compileLib)
public class Generator
{
public static string Emit(List<TypedNodeDefinitionFunc> functions, ModuleGraph moduleGraph, bool compileLib)
{
return new Generator(functions, moduleGraph, compileLib).Emit();
}
private Generator(List<TypedNodeDefinitionFunc> functions, ModuleGraph moduleGraph, bool compileLib)
{
this.functions = functions;
this.moduleGraph = moduleGraph;
this.compileLib = compileLib;
}
private readonly List<TypedNodeDefinitionFunc> functions;
private readonly ModuleGraph moduleGraph;
private readonly bool compileLib;
private readonly IndentedTextWriter writer = new();
private readonly Dictionary<NubTypeStruct, string> structTypeNames = new();