Finish up branch implementation

* while and unconditional loops are now supported fully
* break and continue keywords for loop control
* List::thunkify() has been broken into its own structure so it can be
  broken out further as necessary

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-11-13 20:00:31 -08:00
parent a9d59be472
commit 6e1a19f341
12 changed files with 407 additions and 237 deletions

View File

@@ -267,7 +267,12 @@ impl<'c> Vm<'c> {
next_pc = addr;
}
Inst::JumpTrue(addr) => {
if self.condition {
if !self.condition {
next_pc = addr;
}
}
Inst::JumpFalse(addr) => {
if !self.condition {
next_pc = addr;
}
}