diff options
author | Araq <rumpf_a@web.de> | 2015-08-16 11:25:30 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-16 13:41:27 +0200 |
commit | cc934a1a1bdbe896d1d9d2f2f1a6acccb249ed33 (patch) | |
tree | 1ad69e186379bc98a13b84ce0ad967fae89d9eb3 /compiler | |
parent | cd2fbb5f86809c36e4ef1e72259446f0aefaf2b7 (diff) | |
download | Nim-cc934a1a1bdbe896d1d9d2f2f1a6acccb249ed33.tar.gz |
VM: repl supports global variables properly"
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/vmgen.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 858ec203e..919c38e08 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1183,7 +1183,7 @@ proc checkCanEval(c: PCtx; n: PNode) = let s = n.sym if {sfCompileTime, sfGlobal} <= s.flags: return if s.kind in {skVar, skTemp, skLet, skParam, skResult} and - not s.isOwnedBy(c.prc.sym) and s.owner != c.module: + not s.isOwnedBy(c.prc.sym) and s.owner != c.module and c.mode != emRepl: cannotEval(n) elif s.kind in {skProc, skConverter, skMethod, skIterator, skClosureIterator} and sfForward in s.flags: @@ -1850,13 +1850,13 @@ proc genProc(c: PCtx; s: PSym): int = c.prc = p # iterate over the parameters and allocate space for them: genParams(c, s.typ.n) - + # allocate additional space for any generically bound parameters if s.kind == skMacro and sfImmediate notin s.flags and s.ast[genericParamsPos].kind != nkEmpty: genGenericParams(c, s.ast[genericParamsPos]) - + if tfCapturesEnv in s.typ.flags: #let env = s.ast.sons[paramsPos].lastSon.sym #assert env.position == 2 |