implement native type compilation

This commit is contained in:
Alex Zenla
2025-07-20 19:57:09 -07:00
parent f7ff896f81
commit 837e0c1b38
19 changed files with 133 additions and 20 deletions

View File

@ -69,7 +69,7 @@ class CompileCommand : CliktCommand("compile") {
annotation = " ; ${annotations.joinToString(", ") { it.text }}"
}
print(" ${symbol.offset + index.toUInt()} ${op}${annotation}")
if (op.code == Opcode.Constant || op.code == Opcode.Native) {
if (op.code == Opcode.Constant || op.code == Opcode.NativeFunction) {
val constant = compiledWorld.constantPool.constants[op.args[0].toInt()]
val constantString = when (constant.tag) {
ConstantTag.String -> "string = \"" + constant.readAsString() + "\""