Skip to content

Commit

Permalink
fixes nim-lang#23148; restricts infix path concatenation to what star…
Browse files Browse the repository at this point in the history
…ts with `/` (nim-lang#23150)

fixes nim-lang#23148

(cherry picked from commit c7d742e)
  • Loading branch information
ringabout authored and narimiran committed Jan 3, 2024
1 parent fe1d4a6 commit 0acdce5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions compiler/modulepaths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ proc getModuleName*(conf: ConfigRef; n: PNode): string =
localError(n.info, "only '/' supported with $package notation")
result = ""
else:
let modname = getModuleName(conf, n[2])
# hacky way to implement 'x / y /../ z':
result = getModuleName(conf, n1)
result.add renderTree(n0, {renderNoComments}).replace(" ")
result.add modname
if n0.kind == nkIdent and n0.ident.s[0] == '/':
let modname = getModuleName(conf, n[2])
# hacky way to implement 'x / y /../ z':
result = getModuleName(conf, n1)
result.add renderTree(n0, {renderNoComments}).replace(" ")
result.add modname
else:
result = ""
of nkPrefix:
when false:
if n[0].kind == nkIdent and n[0].ident.s == "$":
Expand Down

0 comments on commit 0acdce5

Please sign in to comment.