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 @@ -165,6 +165,7 @@ proc putNL(g: var TSrcGen) =
165165proc optNL (g: var TSrcGen , indent: int ) =
166166 g.pendingNL = indent
167167 g.lineLen = indent
168+ g.col = g.indent
168169 when defined (nimpretty): g.pendingNewlineCount = 0
169170
170171proc optNL (g: var TSrcGen ) =
@@ -173,6 +174,7 @@ proc optNL(g: var TSrcGen) =
173174proc optNL (g: var TSrcGen ; a, b: PNode ) =
174175 g.pendingNL = g.indent
175176 g.lineLen = g.indent
177+ g.col = g.indent
176178 when defined (nimpretty): g.pendingNewlineCount = lineDiff (a, b)
177179
178180proc 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