compiler: first attempt at restructuring

This commit is contained in:
2023-11-15 01:20:49 -08:00
parent 041848c14e
commit 4c50d48e1e
10 changed files with 192 additions and 164 deletions

View File

@ -17,7 +17,7 @@ class CompileCommand : CliktCommand(help = "Compile Pork to Bytecode", name = "c
val compiler = Compiler()
val slab = world.load(tool.rootImportLocator)
val compiledSlab = compiler.compilableSlabs.of(slab)
val compiledMain = compiledSlab.compilableSymbolOf(Symbol("main"))
val compiledMain = compiledSlab.resolve(Symbol("main"))
?: throw RuntimeException("'main' function not found.")
val compiledWorld = compiler.compile(compiledMain)
for (symbol in compiledWorld.symbolTable.symbols) {