fixed and documented computedGoto pragma
This commit is contained in:
parent
50403afb5c
commit
6f1fc1b5ba
8 changed files with 94 additions and 35 deletions
|
|
@ -31,7 +31,8 @@ proc vm() =
|
|||
var pc = 0
|
||||
while true:
|
||||
{.computedGoto.}
|
||||
case instructions[pc]
|
||||
let instr = instructions[pc]
|
||||
case instr
|
||||
of enumA:
|
||||
echo "yeah A"
|
||||
of enumC, enumD:
|
||||
|
|
@ -39,7 +40,7 @@ proc vm() =
|
|||
of enumB:
|
||||
echo "yeah B"
|
||||
of enumE:
|
||||
return
|
||||
break
|
||||
inc(pc)
|
||||
|
||||
vm()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue