summary refs log tree commit diff stats
path: root/compiler/modules.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-05-17 15:21:22 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-17 15:21:22 +0200
commitbf6c2c5ccfd33cc8aab53b98dbce0619f8633d84 (patch)
treebafa67febeed93ac44278d593ca26b1cb22ea32d /compiler/modules.nim
parent2a7fc84c86c48c6ca6354c8c2f9232c3f1a0b049 (diff)
downloadNim-bf6c2c5ccfd33cc8aab53b98dbce0619f8633d84.tar.gz
preparations of making compiler/msgs.nim free of global variables
Diffstat (limited to 'compiler/modules.nim')
-rw-r--r--compiler/modules.nim8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/modules.nim b/compiler/modules.nim
index 5d1eba1f2..09d5d60b5 100644
--- a/compiler/modules.nim
+++ b/compiler/modules.nim
@@ -23,7 +23,7 @@ proc newModule(graph: ModuleGraph; fileIdx: FileIndex): PSym =
   new(result)
   result.id = -1             # for better error checking
   result.kind = skModule
-  let filename = fileIdx.toFullPath
+  let filename = toFullPath(graph.config, fileIdx)
   result.name = getIdent(splitFile(filename).name)
   if not isNimIdentifier(result.name.s):
     rawMessage(graph.config, errGenerated, "invalid module name: " & result.name.s)
@@ -50,7 +50,9 @@ proc newModule(graph: ModuleGraph; fileIdx: FileIndex): PSym =
   strTableAdd(result.tab, result) # a module knows itself
   let existing = strTableGet(packSym.tab, result.name)
   if existing != nil and existing.info.fileIndex != result.info.fileIndex:
-    localError(graph.config, result.info, "module names need to be unique per Nimble package; module clashes with " & existing.info.fileIndex.toFullPath)
+    localError(graph.config, result.info,
+      "module names need to be unique per Nimble package; module clashes with " &
+        toFullPath(graph.config, existing.info.fileIndex))
   # strTableIncl() for error corrections:
   discard strTableIncl(packSym.tab, result)
 
@@ -73,7 +75,7 @@ proc compileModule*(graph: ModuleGraph; fileIdx: FileIndex; cache: IdentCache, f
           return
       else:
         discard
-    result.id = getModuleId(fileIdx, toFullPath(fileIdx))
+    result.id = getModuleId(fileIdx, toFullPath(graph.config, fileIdx))
     discard processModule(graph, result,
       if sfMainModule in flags and graph.config.projectIsStdin: stdin.llStreamOpen else: nil,
       rd, cache)