]> Cypherpunks repositories - gostls13.git/commit
go/printer: idempotent comment formatting
authorRobert Griesemer <gri@golang.org>
Wed, 10 Oct 2012 00:08:09 +0000 (17:08 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 10 Oct 2012 00:08:09 +0000 (17:08 -0700)
commit241b23606c4c1d37071669c6e07c1918501835ff
tree689a40d338bb2cd65045db1c06a61d1ffeca81f0
parentaf79568fde745795491a6c9f6c918de91a5580eb
go/printer: idempotent comment formatting

Also:

- Refactored testing framework to permit easier
idempotency testing.

- Applied gofmt -w src misc

This CL depends on CL 6639044 being applied first.

Formatting is not idempotent for all files: In those
files the comment position has changed (due to missing
precise location information) and/or the comment formatting
cannot/is not aware of independent code re-formatting.
In general it is very hard to make format idempotent when
running it in one pass only. Leaving that aside for now.

Fixes #1835.

R=r, rsc
CC=golang-dev
https://golang.org/cl/6624051
src/pkg/go/printer/printer.go
src/pkg/go/printer/printer_test.go
src/pkg/go/printer/testdata/comments2.golden [new file with mode: 0644]
src/pkg/go/printer/testdata/comments2.input [new file with mode: 0644]