1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: print or { } on a single line

This commit is contained in:
Delyan Angelov 2020-07-04 14:11:34 +03:00
parent 73771b741c
commit 4403c76406

View File

@ -1073,9 +1073,13 @@ pub fn (mut f Fmt) or_expr(or_block ast.OrExpr) {
match or_block.kind { match or_block.kind {
.absent {} .absent {}
.block { .block {
f.writeln(' or {') if or_block.stmts.len == 0 {
f.stmts(or_block.stmts) f.write(' or { }')
f.write('}') } else {
f.writeln(' or {')
f.stmts(or_block.stmts)
f.write('}')
}
} }
.propagate { .propagate {
f.write('?') f.write('?')