Skip to content

Commit 39eceb3

Browse files
committed
add MethodExpr and HeredocExpr to opprec
1 parent adf1314 commit 39eceb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

printer/opprec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ func opprec(op ast.Expr) int {
6161
default:
6262
panic(fmt.Errorf("unexpected token of UnaryExpr: %v", n.Op))
6363
}
64-
case *ast.SubscriptExpr, *ast.SliceExpr, *ast.CallExpr, *ast.DotExpr:
64+
case *ast.SubscriptExpr, *ast.SliceExpr, *ast.CallExpr, *ast.DotExpr, *ast.MethodExpr:
6565
return 8
66-
case *ast.BasicLit, *ast.Ident, *ast.List, *ast.Dict, *ast.CurlyName:
66+
case *ast.BasicLit, *ast.Ident, *ast.List, *ast.Dict, *ast.CurlyName, *ast.HeredocExpr:
6767
return 9
6868
case *ast.CurlyNameExpr, *ast.CurlyNameLit, *ast.LambdaExpr:
6969
panic(fmt.Errorf("precedence is undefined for expr: %T", n))

0 commit comments

Comments
 (0)