diff options
author | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2018-05-15 19:54:52 +0300 |
---|---|---|
committer | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2018-05-15 19:54:52 +0300 |
commit | cfe40a3e6e920ed0c105af0012af739794c10b55 (patch) | |
tree | e823d767192acd7a3988f963633eaaa7a39cb4b3 /compiler/vmdeps.nim | |
parent | 5d166fcc0ae1ab203f965f0650fd4834542a46f6 (diff) | |
parent | 02f01470ab46067c18535605179b95b143b1e25f (diff) | |
download | Nim-cfe40a3e6e920ed0c105af0012af739794c10b55.tar.gz |
Merge branch 'devel' into yield-in-try
Diffstat (limited to 'compiler/vmdeps.nim')
-rw-r--r-- | compiler/vmdeps.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim index ba37237e8..2c92348a6 100644 --- a/compiler/vmdeps.nim +++ b/compiler/vmdeps.nim @@ -9,18 +9,18 @@ import ast, types, msgs, os, streams, options, idents -proc opSlurp*(file: string, info: TLineInfo, module: PSym): string = +proc opSlurp*(file: string, info: TLineInfo, module: PSym; conf: ConfigRef): string = try: var filename = parentDir(info.toFullPath) / file if not fileExists(filename): - filename = file.findFile + filename = findFile(conf, file) result = readFile(filename) # we produce a fake include statement for every slurped filename, so that # the module dependencies are accurate: appendToModule(module, newNode(nkIncludeStmt, info, @[ newStrNode(nkStrLit, filename)])) except IOError: - localError(info, errCannotOpenFile, file) + localError(conf, info, "cannot open file: " & file) result = "" proc atomicTypeX(name: string; m: TMagic; t: PType; info: TLineInfo): PNode = @@ -271,7 +271,7 @@ proc mapTypeToAstX(t: PType; info: TLineInfo; of tyOr: result = mapTypeToBracket("or", mOr, t, info) of tyNot: result = mapTypeToBracket("not", mNot, t, info) of tyAnything: result = atomicType("anything", mNone) - of tyInferred: internalAssert false + of tyInferred: assert false of tyStatic, tyFromExpr: if inst: if t.n != nil: result = t.n.copyTree @@ -281,7 +281,7 @@ proc mapTypeToAstX(t: PType; info: TLineInfo; result.add atomicType("static", mNone) if t.n != nil: result.add t.n.copyTree - of tyUnused, tyOptAsRef: internalError("mapTypeToAstX") + of tyUnused, tyOptAsRef: assert(false, "mapTypeToAstX") proc opMapTypeToAst*(t: PType; info: TLineInfo): PNode = result = mapTypeToAstX(t, info, false, true) |