From: Robert Griesemer Date: Thu, 16 Jun 2022 18:10:54 +0000 (-0700) Subject: go/parser: remove unused method checkBinaryExpr X-Git-Tag: go1.19rc1~108 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=32510eea74;p=gostls13.git go/parser: remove unused method checkBinaryExpr Change-Id: Ica981657e50e30cbfa1757e8457819a479f11c7d Reviewed-on: https://go-review.googlesource.com/c/go/+/412775 Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Auto-Submit: Robert Griesemer Run-TryBot: Robert Griesemer Reviewed-by: Robert Griesemer --- diff --git a/src/go/parser/parser.go b/src/go/parser/parser.go index 18041ff808..ca2f24c8b8 100644 --- a/src/go/parser/parser.go +++ b/src/go/parser/parser.go @@ -1821,23 +1821,6 @@ func (p *parser) parseBinaryExpr(x ast.Expr, prec1 int, check bool) ast.Expr { } } -// checkBinaryExpr checks binary expressions that were not already checked by -// parseBinaryExpr, because the latter was called with check=false. -func (p *parser) checkBinaryExpr(x ast.Expr) { - bx, ok := x.(*ast.BinaryExpr) - if !ok { - return - } - - bx.X = p.checkExpr(bx.X) - bx.Y = p.checkExpr(bx.Y) - - // parseBinaryExpr checks x and y for each binary expr in a tree, so we - // traverse the tree of binary exprs starting from x. - p.checkBinaryExpr(bx.X) - p.checkBinaryExpr(bx.Y) -} - // The result may be a type or even a raw type ([...]int). Callers must // check the result (using checkExpr or checkExprOrType), depending on // context.