diff options
author | Ganesh Viswanathan <dev@genotrance.com> | 2018-09-14 18:34:12 -0500 |
---|---|---|
committer | Ganesh Viswanathan <dev@genotrance.com> | 2018-09-14 18:34:12 -0500 |
commit | 9340885251e7791ee5a03f2b75e168f341e231e5 (patch) | |
tree | 86b4a189f01a1c114f5bb9e48d33e09a731953b0 /compiler/idgen.nim | |
parent | 4e305c304014c5ef90413d6cab562f5e2b34e573 (diff) | |
parent | b9dc486db15bb1b4b6f3cef7626733b904d377f7 (diff) | |
download | Nim-9340885251e7791ee5a03f2b75e168f341e231e5.tar.gz |
Merge remote-tracking branch 'upstream/devel' into test-7010
Diffstat (limited to 'compiler/idgen.nim')
-rw-r--r-- | compiler/idgen.nim | 10 |
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) |