From 6f1fc1b5ba7f74fde21467f5f0bfd294ad9292f3 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 22 Aug 2013 08:38:47 +0200 Subject: fixed and documented computedGoto pragma --- compiler/ccgstmts.nim | 5 ++++- compiler/nimsets.nim | 27 ++++++--------------------- compiler/vm.nim | 1 - compiler/vmgen.nim | 42 +++++++++++++++++++++++++++++++++--------- 4 files changed, 43 insertions(+), 32 deletions(-) (limited to 'compiler') diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 4d52e3aab..01c734524 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -322,6 +322,7 @@ proc genComputedGoto(p: BProc; n: PNode) = gotoArray.appf("&&TMP$#};$n", (id+arraySize).toRope) line(p, cpsLocals, gotoArray) + for j in 0 .. casePos-1: genStmts(p, n.sons[j]) let caseStmt = n.sons[casePos] var a: TLoc initLocExpr(p, caseStmt.sons[0], a) @@ -329,6 +330,7 @@ proc genComputedGoto(p: BProc; n: PNode) = lineF(p, cpsStmts, "goto *$#[$#];$n", tmp, a.rdLoc) for i in 1 ..