parser: fix -5.str() precedence
parent
cd07429cc1
commit
b8c028c727
|
@ -7,7 +7,6 @@ import v.pref
|
|||
const (
|
||||
skip_test_files = [
|
||||
'vlib/v/tests/enum_bitfield_test.v',
|
||||
'vlib/v/tests/num_lit_call_method_test.v',
|
||||
'vlib/v/tests/pointers_test.v',
|
||||
'vlib/v/tests/pointers_str_test.v',
|
||||
'vlib/net/http/http_httpbin_test.v',
|
||||
|
|
|
@ -220,7 +220,12 @@ fn (mut p Parser) prefix_expr() ast.PrefixExpr {
|
|||
// p.warn('unsafe')
|
||||
// }
|
||||
p.next()
|
||||
right := p.expr(token.Precedence.prefix)
|
||||
mut right := ast.Expr{}
|
||||
if op == .minus {
|
||||
right = p.expr(token.Precedence.call)
|
||||
} else {
|
||||
right = p.expr(token.Precedence.prefix)
|
||||
}
|
||||
p.is_amp = false
|
||||
return ast.PrefixExpr{
|
||||
op: op
|
||||
|
|
Loading…
Reference in New Issue