We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c6c6f5 commit 8fb9cc3Copy full SHA for 8fb9cc3
printer/expr.go
@@ -49,6 +49,8 @@ func (p *printer) binaryExpr(x *ast.BinaryExpr, prec1 int) {
49
prec := opprec(x)
50
if prec < prec1 {
51
// parenthesis needed
52
+ // Note: The parser inserts an ast.ParenExpr node; thus this case
53
+ // can only occur if the AST is created in a different way.
54
p.token(token.POPEN)
55
p.expr(x)
56
p.token(token.PCLOSE)
@@ -66,6 +68,8 @@ func (p *printer) unaryExpr(x *ast.UnaryExpr, prec1 int) {
66
68
67
69
70
71
+ // Note: this case can only occcur if the AST is created manually and
72
+ // the code should invalid code.
73
74
75
0 commit comments