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) =
165
165
proc optNL(g: var TSrcGen, indent: int ) =
166
166
g.pendingNL = indent
167
167
g.lineLen = indent
168
+ g.col = g.indent
168
169
when defined(nimpretty): g.pendingNewlineCount = 0
169
170
170
171
proc optNL(g: var TSrcGen) =
@@ -173,6 +174,7 @@ proc optNL(g: var TSrcGen) =
173
174
proc optNL(g: var TSrcGen; a, b: PNode) =
174
175
g.pendingNL = g.indent
175
176
g.lineLen = g.indent
177
+ g.col = g.indent
176
178
when defined(nimpretty): g.pendingNewlineCount = lineDiff(a, b)
177
179
178
180
proc indentNL(g: var TSrcGen) =
Original file line number Diff line number Diff line change @@ -60,3 +60,22 @@ macro foo(t: static Tuple): untyped =
60
60
doAssert t.b == 12345
61
61
62
62
foo((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