diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-10 10:49:51 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-10 10:49:51 +0200 |
commit | 61e57cfa137544ebbb915ce2ed5da9afae4375ef (patch) | |
tree | 4066dd082d1c306b2dd6e71ef7ddde1b97395760 /compiler/idgen.nim | |
parent | 79ec95a9b57a857b511fb049678778b6945a544b (diff) | |
download | Nim-61e57cfa137544ebbb915ce2ed5da9afae4375ef.tar.gz |
big refactoring: parser compiles again
Diffstat (limited to 'compiler/idgen.nim')
-rw-r--r-- | compiler/idgen.nim | 12 |
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) |