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

vfmt: line comments fixes

This commit is contained in:
Alexander Medvednikov
2019-11-18 13:10:31 +03:00
parent 439bb0c5de
commit 1ccd1979a4
11 changed files with 87 additions and 42 deletions

View File

@@ -41,6 +41,7 @@ fn (p mut Parser) match_statement(is_expr bool) string {
// unwrap match if there is only else
if i == 0 {
p.fspace()
if is_expr {
// statements are dissallowed (if match is expression) so user cant declare variables there and so on
@@ -80,6 +81,7 @@ fn (p mut Parser) match_statement(is_expr bool) string {
// allow braces is else
got_brace := p.tok == .lcbr
if got_brace {
p.fspace()
p.check(.lcbr)
}
@@ -97,6 +99,7 @@ fn (p mut Parser) match_statement(is_expr bool) string {
p.returns = false
p.genln('else // default:')
p.fspace()
p.check(.lcbr)
p.genln('{ ')
@@ -190,6 +193,7 @@ fn (p mut Parser) match_statement(is_expr bool) string {
}
else {
p.returns = false
p.fspace()
p.check(.lcbr)
p.genln('{ ')
@@ -199,7 +203,7 @@ fn (p mut Parser) match_statement(is_expr bool) string {
// p.gen(')')
}
i++
p.fgenln('')
p.fgen_nl()
}
if is_expr {