summary refs log tree commit diff stats
path: root/compiler/idgen.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-05-10 10:49:51 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-10 10:49:51 +0200
commit61e57cfa137544ebbb915ce2ed5da9afae4375ef (patch)
tree4066dd082d1c306b2dd6e71ef7ddde1b97395760 /compiler/idgen.nim
parent79ec95a9b57a857b511fb049678778b6945a544b (diff)
downloadNim-61e57cfa137544ebbb915ce2ed5da9afae4375ef.tar.gz
big refactoring: parser compiles again
Diffstat (limited to 'compiler/idgen.nim')
-rw-r--r--compiler/idgen.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/idgen.nim b/compiler/idgen.nim
index c6b1a4d07..7d103ffd7 100644
--- a/compiler/idgen.nim
+++ b/compiler/idgen.nim
@@ -36,20 +36,20 @@ proc setId*(id: int) {.inline.} =
 proc idSynchronizationPoint*(idRange: int) =
   gFrontEndId = (gFrontEndId div idRange + 1) * idRange + 1
 
-proc toGid(f: string): string =
+proc toGid(conf: ConfigRef; f: string): 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("nim.gid")
+  result = options.completeGeneratedFilePath(conf, "nim.gid")
 
-proc saveMaxIds*(project: string) =
-  var f = open(project.toGid, fmWrite)
+proc saveMaxIds*(conf: ConfigRef; project: string) =
+  var f = open(toGid(conf, project), fmWrite)
   f.writeLine($gFrontEndId)
   f.close()
 
-proc loadMaxIds*(project: string) =
+proc loadMaxIds*(conf: ConfigRef; project: string) =
   var f: File
-  if open(f, project.toGid, fmRead):
+  if open(f, toGid(conf, project), fmRead):
     var line = newStringOfCap(20)
     if f.readLine(line):
       var frontEndId = parseInt(line)