diff options
author | Araq <rumpf_a@web.de> | 2018-09-14 15:55:29 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-09-14 15:55:29 +0200 |
commit | 313282d8056743c0254ec034eff61140c5d3bed4 (patch) | |
tree | 1b81e62ffa9778922735f5fbf2d65711fee42a01 /compiler/pragmas.nim | |
parent | 5709736e827ef844c98afa8fcad08d2f789f93b4 (diff) | |
download | Nim-313282d8056743c0254ec034eff61140c5d3bed4.tar.gz |
better file handling for .line directives
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r-- | compiler/pragmas.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index ad287178e..146c35fd9 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -585,7 +585,9 @@ proc pragmaLine(c: PContext, n: PNode) = else: # XXX check if paths are properly resolved this way: let dir = toFullPath(c.config, n.info).splitFile.dir - n.info.fileIndex = fileInfoIdx(c.config, AbsoluteDir(dir) / RelativeFile(x.strVal)) + 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) n.info.line = uint16(y.intVal) else: localError(c.config, n.info, "tuple expected") |