]> Cypherpunks repositories - gostls13.git/commit
go/printer: don't lose relevant parentheses when rewriting selector expressions
authorRobert Griesemer <gri@golang.org>
Wed, 15 Feb 2012 20:25:37 +0000 (12:25 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 15 Feb 2012 20:25:37 +0000 (12:25 -0800)
commit47afa4dba53c0528b7a9b06a44dd14529ad955d6
treebc2e6bcbdde160ffd69d7da752c82a0351f1e9d6
parent1064f3a97bf44b2737f48545f7955efaa7ff4f6b
go/printer: don't lose relevant parentheses when rewriting selector expressions

Also: Simplified handling of selector expressions. As a result, complicated
multi-line expressions containing selectors and calls/indices with arguments
broken accross lines don't get indented the same way as before, but the change
is minimal (see tests) and there's no such code in the std library. It seems
a worthwhile compromise given the much simpler code.

Applied gofmt -w $GOROOT/src $GOROOT/misc .

Fixes #1847.

R=rsc
CC=golang-dev
https://golang.org/cl/5675062
misc/dashboard/builder/main.go
src/cmd/gofmt/gofmt_test.go
src/cmd/gofmt/testdata/rewrite4.golden [new file with mode: 0644]
src/cmd/gofmt/testdata/rewrite4.input [new file with mode: 0644]
src/pkg/go/printer/nodes.go
src/pkg/go/printer/testdata/expressions.golden
src/pkg/go/printer/testdata/expressions.raw