From 9659540b18b9bd76ea027c83a10077103fcc6318 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 18 Aug 2015 14:01:40 +0200 Subject: preparations for Nimble NimScript integrations; minor cleanups --- compiler/vm.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/vm.nim') 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 -- cgit 1.4.1-2-gfad0