diff options
author | Daniil Yarancev <21169548+Yardanico@users.noreply.github.com> | 2018-06-05 21:25:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 21:25:45 +0300 |
commit | 642641359821b6a63c6cf7edaaa45873b7ea59c7 (patch) | |
tree | 627af3020528cb916b3174bd94304307ca875c77 /compiler/depends.nim | |
parent | fb44c522e6173528efa8035ecc459c84887d0167 (diff) | |
parent | 3cbc07ac7877b03c605498760fe198e3200cc197 (diff) | |
download | Nim-642641359821b6a63c6cf7edaaa45873b7ea59c7.tar.gz |
Merge pull request #2 from nim-lang/devel
Update
Diffstat (limited to 'compiler/depends.nim')
-rw-r--r-- | compiler/depends.nim | 6 |
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) |