better file handling for .line directives
This commit is contained in:
parent
5709736e82
commit
313282d805
1 changed files with 3 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue