compiler: fixes path generation for .line pragma
This commit is contained in:
parent
76aab9baf1
commit
f98352a498
1 changed files with 9 additions and 5 deletions
|
|
@ -601,11 +601,15 @@ proc pragmaLine(c: PContext, n: PNode) =
|
||||||
if c.config.projectPath.isEmpty:
|
if c.config.projectPath.isEmpty:
|
||||||
n.info.fileIndex = fileInfoIdx(c.config, AbsoluteFile(x.strVal))
|
n.info.fileIndex = fileInfoIdx(c.config, AbsoluteFile(x.strVal))
|
||||||
else:
|
else:
|
||||||
# XXX this is still suspicous:
|
when false:
|
||||||
let dir = toFullPath(c.config, n.info).splitFile.dir
|
# XXX this is still suspicous:
|
||||||
let rel = if isAbsolute(x.strVal): relativeTo(AbsoluteFile(x.strVal), c.config.projectPath)
|
let dir = toFullPath(c.config, n.info).splitFile.dir
|
||||||
else: RelativeFile(x.strVal)
|
let rel = if isAbsolute(x.strVal): relativeTo(AbsoluteFile(x.strVal), c.config.projectPath)
|
||||||
n.info.fileIndex = fileInfoIdx(c.config, AbsoluteDir(dir) / rel)
|
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)
|
n.info.line = uint16(y.intVal)
|
||||||
else:
|
else:
|
||||||
localError(c.config, n.info, "tuple expected")
|
localError(c.config, n.info, "tuple expected")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue