parser: minor simplification (#5645)

pull/5646/head
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
1 changed files with 1 additions and 6 deletions

View File

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