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
…im-lang#12265)

(cherry picked from commit 657e09e)
  • Loading branch information
Endeg authored and narimiran committed Sep 30, 2019
1 parent 52ea15c commit c8314b7
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 c8314b7

Please sign in to comment.