diff options
author | cooldome <ariabushenko@bk.ru> | 2018-06-12 21:19:30 +0100 |
---|---|---|
committer | cooldome <ariabushenko@bk.ru> | 2018-06-12 21:19:30 +0100 |
commit | 37aa488f99033fe9d7debfd6b8129a4a3f26c6e4 (patch) | |
tree | 7eee9f92283abbf266d549d8a538c5271fce1f36 /compiler/modulepaths.nim | |
parent | a877a58f32790d9ef574bcd466b327989cdd6acf (diff) | |
parent | f555338ce8b4053bec48ee2ba8299a757db1ee67 (diff) | |
download | Nim-37aa488f99033fe9d7debfd6b8129a4a3f26c6e4.tar.gz |
merge devel
Diffstat (limited to 'compiler/modulepaths.nim')
-rw-r--r-- | compiler/modulepaths.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/modulepaths.nim b/compiler/modulepaths.nim index daa55c2ba..87c7f3541 100644 --- a/compiler/modulepaths.nim +++ b/compiler/modulepaths.nim @@ -7,7 +7,7 @@ # distribution, for details about the copyright. # -import ast, renderer, strutils, msgs, options, idents, os +import ast, renderer, strutils, msgs, options, idents, os, lineinfos import nimblecmd @@ -120,7 +120,7 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string = case n.kind of nkStrLit, nkRStrLit, nkTripleStrLit: try: - result = pathSubs(conf, n.strVal, n.info.toFullPath().splitFile().dir) + result = pathSubs(conf, n.strVal, toFullPath(conf, n.info).splitFile().dir) except ValueError: localError(conf, n.info, "invalid path: " & n.strVal) result = n.strVal @@ -131,7 +131,7 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string = of nkInfix: let n0 = n[0] let n1 = n[1] - if n0.kind == nkIdent and n0.ident.id == getIdent("as").id: + if n0.kind == nkIdent and n0.ident.s == "as": # XXX hack ahead: n.kind = nkImportAs n.sons[0] = n.sons[1] @@ -177,7 +177,7 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string = proc checkModuleName*(conf: ConfigRef; n: PNode; doLocalError=true): FileIndex = # This returns the full canonical path for a given module import let modulename = getModuleName(conf, n) - let fullPath = findModule(conf, modulename, n.info.toFullPath) + let fullPath = findModule(conf, modulename, toFullPath(conf, n.info)) if fullPath.len == 0: if doLocalError: let m = if modulename.len > 0: modulename else: $n |