summary refs log tree commit diff stats
path: root/compiler/depends.nim
diff options
context:
space:
mode:
authorYuriy Glukhov <yuriy.glukhov@gmail.com>2018-05-15 19:54:52 +0300
committerYuriy Glukhov <yuriy.glukhov@gmail.com>2018-05-15 19:54:52 +0300
commitcfe40a3e6e920ed0c105af0012af739794c10b55 (patch)
treee823d767192acd7a3988f963633eaaa7a39cb4b3 /compiler/depends.nim
parent5d166fcc0ae1ab203f965f0650fd4834542a46f6 (diff)
parent02f01470ab46067c18535605179b95b143b1e25f (diff)
downloadNim-cfe40a3e6e920ed0c105af0012af739794c10b55.tar.gz
Merge branch 'devel' into yield-in-try
Diffstat (limited to 'compiler/depends.nim')
-rw-r--r--compiler/depends.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/depends.nim b/compiler/depends.nim
index 2b600c1da..732404232 100644
--- a/compiler/depends.nim
+++ b/compiler/depends.nim
@@ -19,6 +19,7 @@ proc generateDot*(project: string)
 type
   TGen = object of TPassContext
     module*: PSym
+    config: ConfigRef
   PGen = ref TGen
 
 var gDotGraph: Rope # the generated DOT file; we need a global variable
@@ -33,10 +34,10 @@ proc addDotDependency(c: PPassContext, n: PNode): PNode =
   case n.kind
   of nkImportStmt:
     for i in countup(0, sonsLen(n) - 1):
-      var imported = getModuleName(n.sons[i])
+      var imported = getModuleName(g.config, n.sons[i])
       addDependencyAux(g.module.name.s, imported)
   of nkFromStmt, nkImportExceptStmt:
-    var imported = getModuleName(n.sons[0])
+    var imported = getModuleName(g.config, n.sons[0])
     addDependencyAux(g.module.name.s, imported)
   of nkStmtList, nkBlockStmt, nkStmtListExpr, nkBlockExpr:
     for i in countup(0, sonsLen(n) - 1): discard addDotDependency(c, n.sons[i])
@@ -52,6 +53,7 @@ proc myOpen(graph: ModuleGraph; module: PSym; cache: IdentCache): PPassContext =
   var g: PGen
   new(g)
   g.module = module
+  g.config = graph.config
   result = g
 
 const gendependPass* = makePass(open = myOpen, process = addDotDependency)