summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-08-18 14:01:40 +0200
committerAraq <rumpf_a@web.de>2015-08-18 14:01:40 +0200
commit9659540b18b9bd76ea027c83a10077103fcc6318 (patch)
treeca63ea63432a64c589855eacc0a270dd1d1548a0 /compiler
parent10a7830ba2b5e26f8a37c160f7425a3130d67ae0 (diff)
downloadNim-9659540b18b9bd76ea027c83a10077103fcc6318.tar.gz
preparations for Nimble NimScript integrations; minor cleanups
Diffstat (limited to 'compiler')
-rw-r--r--compiler/modules.nim1
-rw-r--r--compiler/nim.cfg1
-rw-r--r--compiler/scriptconfig.nim3
-rw-r--r--compiler/vm.nim4
4 files changed, 6 insertions, 3 deletions
diff --git a/compiler/modules.nim b/compiler/modules.nim
index ad68e6315..85c99c4ec 100644
--- a/compiler/modules.nim
+++ b/compiler/modules.nim
@@ -92,7 +92,6 @@ proc resetAllModulesHard* =
   magicsys.resetSysTypes()
   # XXX
   #gOwners = @[]
-  #rangeDestructorProc = nil
 
 proc checkDepMem(fileIdx: int32): TNeedRecompile =
   template markDirty =
diff --git a/compiler/nim.cfg b/compiler/nim.cfg
index 64631a437..4f9962ea8 100644
--- a/compiler/nim.cfg
+++ b/compiler/nim.cfg
@@ -17,5 +17,4 @@ define:useStdoutAsStdmsg
 
 cs:partial
 #define:useNodeIds
-symbol:nimfix
 #gc:markAndSweep
diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim
index 1e4fc25af..148a382c2 100644
--- a/compiler/scriptconfig.nim
+++ b/compiler/scriptconfig.nim
@@ -25,7 +25,8 @@ proc listDirs(a: VmArgs, filter: set[PathComponent]) =
     if kind in filter: result.add path
   setResult(a, result)
 
-proc setupVM(module: PSym; scriptName: string): PEvalContext =
+proc setupVM*(module: PSym; scriptName: string): PEvalContext =
+  # For Nimble we need to export 'setupVM'.
   result = newCtx(module)
   result.mode = emRepl
   registerAdditionalOps(result)
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