diff options
author | Araq <rumpf_a@web.de> | 2018-10-02 15:49:30 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-10-02 16:18:16 +0200 |
commit | f98352a49800b5b8536af49af3bcee0ca6b54a44 (patch) | |
tree | b90b3e6204ae2d35c2a0fb080a02270a878a5937 /compiler/pragmas.nim | |
parent | 76aab9baf1c795a812d00bd4c0f2832b5ac2d379 (diff) | |
download | Nim-f98352a49800b5b8536af49af3bcee0ca6b54a44.tar.gz |
compiler: fixes path generation for .line pragma
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r-- | compiler/pragmas.nim | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 94790440f..31c24effe 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -601,11 +601,15 @@ proc pragmaLine(c: PContext, n: PNode) = if c.config.projectPath.isEmpty: n.info.fileIndex = fileInfoIdx(c.config, AbsoluteFile(x.strVal)) else: - # XXX this is still suspicous: - let dir = toFullPath(c.config, n.info).splitFile.dir - let rel = if isAbsolute(x.strVal): relativeTo(AbsoluteFile(x.strVal), c.config.projectPath) - else: RelativeFile(x.strVal) - n.info.fileIndex = fileInfoIdx(c.config, AbsoluteDir(dir) / rel) + when false: + # XXX this is still suspicous: + let dir = toFullPath(c.config, n.info).splitFile.dir + let rel = if isAbsolute(x.strVal): relativeTo(AbsoluteFile(x.strVal), c.config.projectPath) + else: RelativeFile(x.strVal) + n.info.fileIndex = fileInfoIdx(c.config, AbsoluteDir(dir) / rel) + else: + n.info.fileIndex = fileInfoIdx(c.config, AbsoluteFile toFullPath(c.config, n.info)) + n.info.line = uint16(y.intVal) else: localError(c.config, n.info, "tuple expected") |