mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: remove an extra \n in for loops (#5618)
This commit is contained in:
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
Block a user