Skip to content

Commit

Permalink
Fix nim-lang#12242, replacing ":" with "@c" in packages [backport] (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
Endeg authored and Araq committed Sep 25, 2019
1 parent 920f9be commit 657e09e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/packagehandling.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ proc getPackageName*(conf: ConfigRef; path: string): string =

proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
# foo-#head/../bar becomes @foo-@hhead@s..@sbar
result = "@m" & relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@s", "#": "@h", "@": "@@"})
result = "@m" & relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@s", "#": "@h", "@": "@@", ":": "@c"})

proc demanglePackageName*(path: string): string =
result = path.multiReplace({"@@": "@", "@h": "#", "@s": "/", "@m": ""})
result = path.multiReplace({"@@": "@", "@h": "#", "@s": "/", "@m": "", "@c": ":"})

proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
let x = getPackageName(conf, path.string)
Expand Down

0 comments on commit 657e09e

Please sign in to comment.