diff options
author | Araq <rumpf_a@web.de> | 2015-08-18 14:01:40 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-18 14:01:40 +0200 |
commit | 9659540b18b9bd76ea027c83a10077103fcc6318 (patch) | |
tree | ca63ea63432a64c589855eacc0a270dd1d1548a0 /compiler/vm.nim | |
parent | 10a7830ba2b5e26f8a37c160f7425a3130d67ae0 (diff) | |
download | Nim-9659540b18b9bd76ea027c83a10077103fcc6318.tar.gz |
preparations for Nimble NimScript integrations; minor cleanups
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index 57ed8397c..b15c55565 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1401,6 +1401,10 @@ proc evalExpr*(c: PCtx, n: PNode): PNode = assert c.code[start].opcode != opcEof result = execute(c, start) +proc getGlobalValue*(c: PCtx; s: PSym): PNode = + internalAssert s.kind in {skLet, skVar} and sfGlobal in s.flags + result = c.globals.sons[s.position-1] + include vmops # for now we share the 'globals' environment. XXX Coming soon: An API for |