AsyncEmbeddedScript2.labelRunners

This commit is contained in:
Trent Nelson
2023-08-01 17:02:11 -06:00
parent 7728de0763
commit 63600c8d16

View File

@@ -223,12 +223,8 @@ class AsyncEmbeddedScript2 {
}
}
public function runFromLabel(name:String) {
var ip = labels[name];
if (lastInstructionPointer > ip) {
throw "Rewinding AsyncEmbeddedScript is not implemented";
}
runFromInstruction(ip);
public function labelRunners(withBreakpoints = true):Map<String,AsyncEmbeddedScript2->Void> {
return [for (label => ip in labels) label => (newScript:AsyncEmbeddedScript2) -> newScript.runFromInstruction(ip, withBreakpoints)];
}
public var printCurrentInstruction = true;