feat: execute local assignments and while loops

This commit is contained in:
2026-10-10 00:17:12 +02:00
parent 021cbecac8
commit b35a68dff8
16 changed files with 1440 additions and 170 deletions
+12
View File
@@ -113,6 +113,18 @@ run proc(
}
continue
}
.assign_local: {
local :: &frames.items[frame_index].locals[usize(instruction.slot)]
if (!local.initialized) {
return try runtime_trap(diagnostic_store, .write_before_initialization, instruction.span)
}
local.value = frames.items[frame_index].values[usize(instruction.left)]
continue
}
.reset_local: {
frames.items[frame_index].locals[usize(instruction.slot)].initialized = false
continue
}
.load_global: {
global_index :: usize(instruction.slot)
match globals[global_index].status {