summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2019-09-06 11:26:48 -0700
committerTimothee Cour <timothee.cour2@gmail.com>2019-09-06 11:26:48 -0700
commit4129993689fa86826a2bf320356f372165fc1803 (patch)
treee14f5e4184286565e54e4f1028baf3757f54a82e
parente0f3e8432af6a64d01be089a2247565e1f754b3a (diff)
downloadNim-4129993689fa86826a2bf320356f372165fc1803.tar.gz
fix #12130 ; improve naming scheme in fakePackageName
-rw-r--r--compiler/packagehandling.nim8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/packagehandling.nim b/compiler/packagehandling.nim
index b9db61b4d..54fbe23a4 100644
--- a/compiler/packagehandling.nim
+++ b/compiler/packagehandling.nim
@@ -39,13 +39,11 @@ proc getPackageName*(conf: ConfigRef; path: string): string =
     if parents <= 0: break
 
 proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
-  # foo/../bar becomes foo7_7bar
-  result = relativeTo(path, conf.projectPath, '/').string.multiReplace(
-    {"/": "7", "..": "_", "7": "77", "_": "__", ":": "8", "8": "88"})
+  # foo/../bar becomes foo@..@bar
+  result = relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@", "@": "@@"})
 
 proc demanglePackageName*(path: string): string =
-  result = path.multiReplace(
-    {"88": "8", "8": ":", "77": "7", "__": "_", "_7": "../", "7": "/"})
+  result = path.multiReplace({"@@": "@", "@": "/"})
 
 proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
   let x = getPackageName(conf, path.string)
iler/plugins.nim?h=devel&id=5de900b45694cf52c1b00fd2ac7fd743308e814c'>5de900b45 ^
4be0d1652 ^













1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47