diff options
author | Joe Tsai <thebrokentoaster@gmail.com> | 2017-12-01 00:59:45 +0000 |
---|---|---|
committer | Joe Tsai <joetsai@google.com> | 2017-12-01 01:12:26 +0000 |
commit | b53088a63436ac49d2344a733a50d529b5f7244e (patch) | |
tree | 9aeacef6839fd1e6c8ad28be2b3cb45756f6a19f /src/regexp/syntax/parse.go | |
parent | 206568566473e9a91c05b8b0153d27ecbee466b7 (diff) | |
download | go-b53088a63436ac49d2344a733a50d529b5f7244e.tar.gz go-b53088a63436ac49d2344a733a50d529b5f7244e.zip |
Revert "go/printer: forbid empty line before first comment in block"
This reverts commit 08f19bbde1b01227fdc2fa2d326e4029bb74dd96.
Reason for revert:
The changed transformation takes effect on a larger set
of code snippets than expected.
For example, this:
func foo() {
// Comment
bar()
}
becomes:
func foo() {
// Comment
bar()
}
This is an unintended consequence.
Change-Id: Ifca88d6267dab8a8170791f7205124712bf8ace8
Reviewed-on: https://go-review.googlesource.com/81335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Joe Tsai <joetsai@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/regexp/syntax/parse.go')
-rw-r--r-- | src/regexp/syntax/parse.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/regexp/syntax/parse.go b/src/regexp/syntax/parse.go index 8b5b32a786..8c6d43a706 100644 --- a/src/regexp/syntax/parse.go +++ b/src/regexp/syntax/parse.go @@ -1626,6 +1626,7 @@ func (p *parser) parseClass(s string) (rest string, err error) { // cleanClass sorts the ranges (pairs of elements of r), // merges them, and eliminates duplicates. func cleanClass(rp *[]rune) []rune { + // Sort by lo increasing, hi decreasing to break ties. sort.Sort(ranges{rp}) |