make tcompilerapi green, don't assue projectPath exists
This commit is contained in:
parent
0cb72185ae
commit
ed5d2b5505
1 changed files with 8 additions and 5 deletions
|
|
@ -583,7 +583,10 @@ proc pragmaLine(c: PContext, n: PNode) =
|
||||||
elif y.kind != nkIntLit:
|
elif y.kind != nkIntLit:
|
||||||
localError(c.config, n.info, errIntLiteralExpected)
|
localError(c.config, n.info, errIntLiteralExpected)
|
||||||
else:
|
else:
|
||||||
# XXX check if paths are properly resolved this way:
|
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 dir = toFullPath(c.config, n.info).splitFile.dir
|
||||||
let rel = if isAbsolute(x.strVal): relativeTo(AbsoluteFile(x.strVal), c.config.projectPath)
|
let rel = if isAbsolute(x.strVal): relativeTo(AbsoluteFile(x.strVal), c.config.projectPath)
|
||||||
else: RelativeFile(x.strVal)
|
else: RelativeFile(x.strVal)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue