summary refs log tree commit diff stats
path: root/compiler/packagehandling.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/packagehandling.nim')
-rw-r--r--compiler/packagehandling.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/packagehandling.nim b/compiler/packagehandling.nim
index d7c6b25ae..548668824 100644
--- a/compiler/packagehandling.nim
+++ b/compiler/packagehandling.nim
@@ -41,7 +41,11 @@ proc getPackageName*(conf: ConfigRef; path: string): string =
 proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
   # foo/../bar becomes foo7_7bar
   result = relativeTo(path, conf.projectPath, '/').string.multiReplace(
-    {"/": "7", "..": "_", "7": "77", "_": "__"})
+    {"/": "7", "..": "_", "7": "77", "_": "__", ":": "8", "8": "88"})
+
+proc demaglePackageName*(path: string): string =
+  result = path.multiReplace(
+    {"88": "8", "8": ":", "77": "7", "__": "_", "_7": "../", "7": "/"})
 
 proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
   let x = getPackageName(conf, path.string)