add other flowcontrol ops. Update tests

This commit is contained in:
d98762625 2018-05-21 10:58:35 +01:00
parent 046e1ebad9
commit 8ff6596657
15 changed files with 735 additions and 402 deletions

View file

@ -50,13 +50,11 @@ class Jump extends Operation {
const jmpIndex = getLabelIndex(label, state);
if (state.numJumps >= maxJumps || jmpIndex === -1) {
log.debug("Maximum jumps reached or label cannot be found");
return state;
}
state.progress = jmpIndex;
state.numJumps++;
log.debug(`Jumping to label '${label}' at position ${jmpIndex} (jumps = ${state.numJumps})`);
return state;
}