File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ proc putNL(g: var TSrcGen) =
150150proc optNL (g: var TSrcGen , indent: int ) =
151151 g.pendingNL = indent
152152 g.lineLen = indent
153+ g.col = g.indent
153154 when defined (nimpretty): g.pendingNewlineCount = 0
154155
155156proc optNL (g: var TSrcGen ) =
@@ -158,6 +159,7 @@ proc optNL(g: var TSrcGen) =
158159proc optNL (g: var TSrcGen ; a, b: PNode ) =
159160 g.pendingNL = g.indent
160161 g.lineLen = g.indent
162+ g.col = g.indent
161163 when defined (nimpretty): g.pendingNewlineCount = lineDiff (a, b)
162164
163165proc indentNL (g: var TSrcGen ) =
Original file line number Diff line number Diff line change @@ -60,3 +60,22 @@ macro foo(t: static Tuple): untyped =
6060 doAssert t.b == 12345
6161
6262foo ((a: " foo" , b: 12345 ))
63+
64+
65+ # bug #16307
66+
67+ macro bug (x: untyped ): string =
68+ newLit repr (x)
69+
70+ let res = bug:
71+ block :
72+ # # one
73+ # # two
74+ # # three
75+
76+ doAssert res == """
77+
78+ block:
79+ ## one
80+ ## two
81+ ## three """
You can’t perform that action at this time.
0 commit comments