Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 committed Nov 29, 2019
1 parent a114a40 commit 5ef0c35
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/renderer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
gsub(g, n[^1], c)
of nkVarTuple:
put(g, tkParLe, "(")
gcomma(g, n, 0, -3)
gcomma(g, n, 0, -2)
put(g, tkParRi, ")")
put(g, tkSpaces, Space)
putWithSpace(g, tkEquals, "=")
Expand Down
17 changes: 17 additions & 0 deletions tests/macros/tastrepr.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
discard """
output: '''
var data = @["one", "two"]
for (i, d) = in pairs(data):
echo [d]
'''
"""

import macros

macro foobar(arg: typed) =
result = newCall(ident"echo", newLit(arg.repr))

foobar:
var data = @["one", "two"]
for (i, d) in data.pairs:
echo d

0 comments on commit 5ef0c35

Please sign in to comment.