mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
711bb6def7
commit
63578e63c6
|
@ -1062,11 +1062,16 @@ pub fn (mut f Fmt) for_stmt(node ast.ForStmt) {
|
||||||
if node.label.len > 0 {
|
if node.label.len > 0 {
|
||||||
f.write('$node.label: ')
|
f.write('$node.label: ')
|
||||||
}
|
}
|
||||||
|
if node.cond is ast.Comment {
|
||||||
|
f.comments([node.cond])
|
||||||
|
}
|
||||||
f.write('for ')
|
f.write('for ')
|
||||||
|
if node.cond !is ast.Comment {
|
||||||
f.expr(node.cond)
|
f.expr(node.cond)
|
||||||
if !node.is_inf {
|
if !node.is_inf {
|
||||||
f.write(' ')
|
f.write(' ')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
f.write('{')
|
f.write('{')
|
||||||
if node.stmts.len > 0 || node.pos.line_nr < node.pos.last_line {
|
if node.stmts.len > 0 || node.pos.line_nr < node.pos.last_line {
|
||||||
f.writeln('')
|
f.writeln('')
|
||||||
|
|
|
@ -103,3 +103,8 @@ fn between_if_branches() {
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// comments
|
||||||
|
for {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
|
@ -87,3 +87,8 @@ fn between_if_branches() {
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for // comments
|
||||||
|
{
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user