preparations of making compiler/msgs.nim free of global variables

This commit is contained in:
Andreas Rumpf
2018-05-17 15:21:22 +02:00
parent 2a7fc84c86
commit bf6c2c5ccf
38 changed files with 179 additions and 183 deletions

View File

@@ -1940,7 +1940,7 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
of mRunnableExamples:
if c.config.cmd == cmdDoc and n.len >= 2 and n.lastSon.kind == nkStmtList:
if sfMainModule in c.module.flags:
let inp = toFullPath(c.module.info)
let inp = toFullPath(c.config, c.module.info)
if c.runnableExamples == nil:
c.runnableExamples = newTree(nkStmtList,
newTree(nkImportStmt, newStrNode(nkStrLit, expandFilename(inp))))