diff options
author | Araq <rumpf_a@web.de> | 2013-10-07 21:36:31 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-10-07 21:36:31 +0200 |
commit | 9bf32ff72d0d61c2ec42eda594a95312f6e57a3c (patch) | |
tree | 19f29779b825537e6906b5ffd34b67d09edadac6 /compiler/vm.nim | |
parent | 90d25919f3ee1a84b72da84ff963e6853b650bd5 (diff) | |
download | Nim-9bf32ff72d0d61c2ec42eda594a95312f6e57a3c.tar.gz |
bugfix: package names should not contain '.'
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index d5a816e53..42303b321 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -231,11 +231,11 @@ proc compile(c: PCtx, s: PSym): int = result = vmgen.genProc(c, s) #c.echoCode -proc execute(c: PCtx, start: int) = +proc rawExecute(c: PCtx, start: int, tos: PStackFrame) = var pc = start + var tos = tos var regs: TNodeSeq # alias to tos.slots for performance - var tos: PStackFrame - newSeq(regs, c.prc.maxSlots) + move(regs, tos.slots) while true: {.computedGoto.} let instr = c.code[pc] @@ -841,6 +841,13 @@ proc execute(c: PCtx, start: int) = regs[ra].strVal = typ.typeToString(preferExported) inc pc +proc execute(c: PCtx, start: int) = + var pc = start + var regs: TNodeSeq # alias to tos.slots for performance + var tos: PStackFrame + newSeq(tos.slots, c.prc.maxSlots) + rawExecute(c, start, tos) + proc evalStmt*(c: PCtx, n: PNode) = let start = genStmt(c, n) # execute new instructions; this redundant opcEof check saves us lots @@ -892,6 +899,9 @@ proc setupMacroParam(x: PNode): PNode = result = x if result.kind in {nkHiddenSubConv, nkHiddenStdConv}: result = result.sons[1] +type + PEvalContext* = PCtx + proc evalMacroCall(c: PEvalContext, n, nOrig: PNode, sym: PSym): PNode = # XXX GlobalError() is ugly here, but I don't know a better solution for now inc(evalTemplateCounter) |