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

parser: minor simplification (#5645)

This commit is contained in:
Ruofan XU 2020-07-04 05:22:43 +08:00 committed by GitHub
parent 3d3549d65a
commit 37f31da6c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,12 +257,7 @@ fn (mut p Parser) prefix_expr() ast.PrefixExpr {
// p.warn('unsafe') // p.warn('unsafe')
// } // }
p.next() p.next()
mut right := ast.Expr{} right := if op == .minus { p.expr(token.Precedence.call) } else { p.expr(token.Precedence.prefix) }
if op == .minus {
right = p.expr(token.Precedence.call)
} else {
right = p.expr(token.Precedence.prefix)
}
p.is_amp = false p.is_amp = false
return ast.PrefixExpr{ return ast.PrefixExpr{
op: op op: op