summary refs log tree commit diff stats
path: root/compiler/idgen.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-09-07 01:53:09 +0200
committerAraq <rumpf_a@web.de>2018-09-07 19:21:16 +0200
commit86556ebfdbbd4b8e9edc9d3085ea21d6c0bae2e2 (patch)
tree9f8b4b752ed728ceff82dceef2f5605cb2a846a0 /compiler/idgen.nim
parentb5730ec01f02e542eb06161430aa5a7c2ede775f (diff)
downloadNim-86556ebfdbbd4b8e9edc9d3085ea21d6c0bae2e2.tar.gz
compiler refactoring; use typesafe path handing; docgen: render symbols between modules
Diffstat (limited to 'compiler/idgen.nim')
-rw-r--r--compiler/idgen.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/idgen.nim b/compiler/idgen.nim
index 7d103ffd7..239df0c57 100644
--- a/compiler/idgen.nim
+++ b/compiler/idgen.nim
@@ -9,7 +9,7 @@
 
 ## This module contains a simple persistent id generator.
 
-import idents, strutils, os, options
+import idents, strutils, os, options, pathutils
 
 var gFrontEndId*: int
 
@@ -36,18 +36,18 @@ proc setId*(id: int) {.inline.} =
 proc idSynchronizationPoint*(idRange: int) =
   gFrontEndId = (gFrontEndId div idRange + 1) * idRange + 1
 
-proc toGid(conf: ConfigRef; f: string): string =
+proc toGid(conf: ConfigRef; f: AbsoluteFile): string =
   # we used to use ``f.addFileExt("gid")`` (aka ``$project.gid``), but this
   # will cause strange bugs if multiple projects are in the same folder, so
   # we simply use a project independent name:
-  result = options.completeGeneratedFilePath(conf, "nim.gid")
+  result = options.completeGeneratedFilePath(conf, AbsoluteFile"nim.gid").string
 
-proc saveMaxIds*(conf: ConfigRef; project: string) =
+proc saveMaxIds*(conf: ConfigRef; project: AbsoluteFile) =
   var f = open(toGid(conf, project), fmWrite)
   f.writeLine($gFrontEndId)
   f.close()
 
-proc loadMaxIds*(conf: ConfigRef; project: string) =
+proc loadMaxIds*(conf: ConfigRef; project: AbsoluteFile) =
   var f: File
   if open(f, toGid(conf, project), fmRead):
     var line = newStringOfCap(20)