diff options
author | Robert Griesemer <gri@golang.org> | 2021-01-20 17:03:36 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-01-21 06:55:47 +0000 |
commit | 18bd7aa62581f313c86164d763b1e246307888a9 (patch) | |
tree | 635a5e70ed41388129ac991812c06985e032fa00 /src/cmd/compile/internal/syntax/printer.go | |
parent | 2427f6e6c07de20a00dd8b9ab464f0abe5ccd13a (diff) | |
download | go-18bd7aa62581f313c86164d763b1e246307888a9.tar.gz go-18bd7aa62581f313c86164d763b1e246307888a9.zip |
[dev.typeparams] cmd/compile: use nil instead of syntax.ImplicitOne
Represent x++/-- as x +=/-= with the RHS of the assignment being nil
rather than syntax.ImplicitOne.
Dependent code already had to check for syntax.ImplicitOne, but
then shared some existing code for regular assignment operations.
Now always handle this case fully explicit, which simplifies the
code.
Change-Id: I28c7918153c27cbbf97b041d0c85ff027c58687c
Reviewed-on: https://go-review.googlesource.com/c/go/+/285172
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/printer.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/printer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/printer.go b/src/cmd/compile/internal/syntax/printer.go index 161eb0d092..9109ce2363 100644 --- a/src/cmd/compile/internal/syntax/printer.go +++ b/src/cmd/compile/internal/syntax/printer.go @@ -549,7 +549,7 @@ func (p *printer) printRawNode(n Node) { case *AssignStmt: p.print(n.Lhs) - if n.Rhs == ImplicitOne { + if n.Rhs == nil { // TODO(gri) This is going to break the mayCombine // check once we enable that again. p.print(n.Op, n.Op) // ++ or -- |