cgen: remove an extra \n in for loops (#5618)
parent
6c022db786
commit
e904732554
|
@ -709,6 +709,12 @@ fn (mut g Gen) stmt(node ast.Stmt) {
|
||||||
g.write('; ')
|
g.write('; ')
|
||||||
} else {
|
} else {
|
||||||
g.stmt(node.init)
|
g.stmt(node.init)
|
||||||
|
// Remove excess return and add space
|
||||||
|
if g.out.last_n(1) == '\n' {
|
||||||
|
g.out.go_back(1)
|
||||||
|
g.empty_line = false
|
||||||
|
g.write(' ')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if node.has_cond {
|
if node.has_cond {
|
||||||
g.expr(node.cond)
|
g.expr(node.cond)
|
||||||
|
|
Loading…
Reference in New Issue