summary refs log tree commit diff stats
path: root/compiler/modulepaths.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/modulepaths.nim')
-rw-r--r--compiler/modulepaths.nim21
1 files changed, 5 insertions, 16 deletions
diff --git a/compiler/modulepaths.nim b/compiler/modulepaths.nim
index 87c7f3541..e5cbf3a2c 100644
--- a/compiler/modulepaths.nim
+++ b/compiler/modulepaths.nim
@@ -45,13 +45,6 @@ when false:
     if best.len > 0 and fileExists(res):
       result = res
 
-const stdlibDirs = [
-  "pure", "core", "arch",
-  "pure/collections",
-  "pure/concurrency", "impure",
-  "wrappers", "wrappers/linenoise",
-  "windows", "posix", "js"]
-
 when false:
   proc resolveDollar(project, source, pkg, subdir: string; info: TLineInfo): string =
     template attempt(a) =
@@ -120,7 +113,9 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string =
   case n.kind
   of nkStrLit, nkRStrLit, nkTripleStrLit:
     try:
-      result = pathSubs(conf, n.strVal, toFullPath(conf, n.info).splitFile().dir)
+      result =
+        pathSubs(conf, n.strVal, toFullPath(conf, n.info).splitFile().dir)
+          .replace(" ")
     except ValueError:
       localError(conf, n.info, "invalid path: " & n.strVal)
       result = n.strVal
@@ -147,16 +142,9 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string =
           result = ""
     else:
       let modname = getModuleName(conf, n[2])
-      if $n1 == "std":
-        template attempt(a) =
-          let x = addFileExt(a, "nim")
-          if fileExists(x): return x
-        for candidate in stdlibDirs:
-          attempt(conf.libpath / candidate / modname)
-
       # hacky way to implement 'x / y /../ z':
       result = getModuleName(conf, n1)
-      result.add renderTree(n0, {renderNoComments})
+      result.add renderTree(n0, {renderNoComments}).replace(" ")
       result.add modname
   of nkPrefix:
     when false:
@@ -167,6 +155,7 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string =
     # hacky way to implement 'x / y /../ z':
     result = renderTree(n, {renderNoComments}).replace(" ")
   of nkDotExpr:
+    localError(conf, n.info, warnDeprecated, "using '.' instead of '/' in import paths")
     result = renderTree(n, {renderNoComments}).replace(".", "/")
   of nkImportAs:
     result = getModuleName(conf, n.sons[0])