Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13)

Issue 5675062: code review 5675062: go/printer: don't lose relevant parentheses when rewrit... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 8 months ago by gri
Modified:
13 years, 8 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

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 issue 1847.

Patch Set 1 #

Patch Set 2 : diff -r 9e18e81292fb https://code.google.com/p/go #

Patch Set 3 : diff -r ff8ea1d92d51 https://code.google.com/p/go #

Patch Set 4 : diff -r ff8ea1d92d51 https://code.google.com/p/go #

Patch Set 5 : diff -r ff8ea1d92d51 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -72 lines) Patch
M misc/dashboard/builder/main.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gofmt/gofmt_test.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A src/cmd/gofmt/testdata/rewrite4.golden View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
A src/cmd/gofmt/testdata/rewrite4.input View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
M src/pkg/go/printer/nodes.go View 1 2 4 chunks +10 lines, -65 lines 0 comments Download
M src/pkg/go/printer/testdata/expressions.golden View 1 2 chunks +3 lines, -3 lines 0 comments Download
M src/pkg/go/printer/testdata/expressions.raw View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 3
gri
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
13 years, 8 months ago (2012-02-15 20:02:22 UTC) #1
rsc
LGTM I agree that the change is a very rare case. If it comes up ...
13 years, 8 months ago (2012-02-15 20:14:04 UTC) #2
gri
13 years, 8 months ago (2012-02-15 20:25:39 UTC) #3
*** Submitted as f76d6627f6b1 ***

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 issue 1847.

R=rsc
CC=golang-dev
http://codereview.appspot.com/5675062
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b