summary refs log tree commit diff stats
path: root/compiler/vmdef.nim
diff options
context:
space:
mode:
authordata-man <datamanrb@gmail.com>2018-05-19 16:19:29 +0300
committerdata-man <datamanrb@gmail.com>2018-05-19 16:19:29 +0300
commit2a9843c68fc60be6bcb41771dce88df004868e42 (patch)
treeaf0396a389f0d35b9239827a7915139e72e6ad9b /compiler/vmdef.nim
parent606d8b2f6d0ed4c26d44d2b07b8fef39cabc0b3c (diff)
parent04ddd069a1b3315dc0e323d98fefd621d1430a4d (diff)
downloadNim-2a9843c68fc60be6bcb41771dce88df004868e42.tar.gz
Merge branch 'devel' of https://github.com/nim-lang/Nim into fix_2753
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r--compiler/vmdef.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim
index b0a559d2c..e10a62006 100644
--- a/compiler/vmdef.nim
+++ b/compiler/vmdef.nim
@@ -10,7 +10,7 @@
 ## This module contains the type definitions for the new evaluation engine.
 ## An instruction is 1-3 int32s in memory, it is a register based VM.
 
-import ast, passes, msgs, idents, intsets, options
+import ast, passes, msgs, idents, intsets, options, modulegraphs
 
 const
   byteExcess* = 128 # we use excess-K for immediates
@@ -207,18 +207,19 @@ type
     errorFlag*: string
     cache*: IdentCache
     config*: ConfigRef
+    graph*: ModuleGraph
+    oldErrorCount*: int
 
   TPosition* = distinct int
 
   PEvalContext* = PCtx
 
-proc newCtx*(module: PSym; cache: IdentCache; config: ConfigRef = nil): PCtx =
-  let conf = if config != nil: config else: newConfigRef()
+proc newCtx*(module: PSym; cache: IdentCache; g: ModuleGraph): PCtx =
   PCtx(code: @[], debug: @[],
     globals: newNode(nkStmtListExpr), constants: newNode(nkStmtList), types: @[],
     prc: PProc(blocks: @[]), module: module, loopIterations: MaxLoopIterations,
     comesFromHeuristic: unknownLineInfo(), callbacks: @[], errorFlag: "",
-    cache: cache, config: conf)
+    cache: cache, config: g.config, graph: g)
 
 proc refresh*(c: PCtx, module: PSym) =
   c.module = module