]> Cypherpunks repositories - gostls13.git/commit
go/printer: refine handling of one-line functions
authorRobert Griesemer <gri@golang.org>
Wed, 26 Feb 2014 21:39:49 +0000 (13:39 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 26 Feb 2014 21:39:49 +0000 (13:39 -0800)
commit3d4c12d9d091fcbe3941534af5057d453758650e
tree2dedefe8128c3e90e6bdee368e053e8d2154d877
parent3081261b588b1c93da8bf4292e99a535bdb86a3f
go/printer: refine handling of one-line functions

Functions that "fit" on one line and were on one
line in the original source are not broken up into
two lines anymore simply because they contain a comment.

- Fine-tuned use of separating blanks after /*-style comments, so:

( /* extra blank after this comment */ )
(a int /* no extra blank after this comment*/)

- Factored out comment state (from printer state) into commentInfo.
- No impact on $GOROOT/src, misc formatting.

Fixes #5543.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/68630043
src/pkg/go/printer/nodes.go
src/pkg/go/printer/printer.go
src/pkg/go/printer/testdata/comments.golden
src/pkg/go/printer/testdata/comments.input
src/pkg/go/printer/testdata/declarations.golden
src/pkg/go/printer/testdata/declarations.input