introduce ir nop to fix loop bugs

This commit is contained in:
Alex Zenla
2025-07-24 22:30:18 -07:00
parent 837e0c1b38
commit 69230deefc
11 changed files with 65 additions and 12 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.NativeFunction) {
if (op.code == Opcode.Constant || op.code == Opcode.NativeFunction || op.code == Opcode.NativeType) {
val constant = compiledWorld.constantPool.constants[op.args[0].toInt()]
val constantString = when (constant.tag) {
ConstantTag.String -> "string = \"" + constant.readAsString() + "\""