fixed and documented computedGoto pragma

This commit is contained in:
Araq 2013-08-22 08:38:47 +02:00
commit 6f1fc1b5ba
8 changed files with 94 additions and 35 deletions

View file

@ -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()