tools: fix `v vet file.v` for `return if x { y // comment } else { z }`
parent
cf1fc6f090
commit
0e4198f23b
|
@ -0,0 +1,7 @@
|
||||||
|
fn abc() int {
|
||||||
|
return if true {
|
||||||
|
0x4000 // 16KB
|
||||||
|
} else {
|
||||||
|
0x1000 // 4KB
|
||||||
|
}
|
||||||
|
}
|
|
@ -1977,7 +1977,7 @@ fn (mut p Parser) parse_multi_expr(is_top_level bool) ast.Stmt {
|
||||||
// TODO remove translated
|
// TODO remove translated
|
||||||
if p.tok.kind in [.assign, .decl_assign] || p.tok.kind.is_assign() {
|
if p.tok.kind in [.assign, .decl_assign] || p.tok.kind.is_assign() {
|
||||||
return p.partial_assign_stmt(left, left_comments)
|
return p.partial_assign_stmt(left, left_comments)
|
||||||
} else if !p.pref.translated && !p.is_translated && !p.pref.is_fmt
|
} else if !p.pref.translated && !p.is_translated && !p.pref.is_fmt && !p.pref.is_vet
|
||||||
&& tok.kind !in [.key_if, .key_match, .key_lock, .key_rlock, .key_select] {
|
&& tok.kind !in [.key_if, .key_match, .key_lock, .key_rlock, .key_select] {
|
||||||
for node in left {
|
for node in left {
|
||||||
if (is_top_level || p.tok.kind != .rcbr) && node !is ast.CallExpr
|
if (is_top_level || p.tok.kind != .rcbr) && node !is ast.CallExpr
|
||||||
|
|
Loading…
Reference in New Issue