]> Cypherpunks repositories - gostls13.git/commitdiff
Allow func() func().
authorRobert Griesemer <gri@golang.org>
Tue, 26 Jan 2010 19:49:49 +0000 (11:49 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 26 Jan 2010 19:49:49 +0000 (11:49 -0800)
Update gofmt test script.

R=rsc
CC=golang-dev
https://golang.org/cl/195044

src/cmd/gofmt/test.sh
src/pkg/go/parser/parser.go
src/pkg/go/parser/parser_test.go

index 59d5117b24704c9cccff89e2063f52e523a8af14..f0b99c8adda087bce84caa5b7edc943261fd4856 100755 (executable)
@@ -41,7 +41,7 @@ apply1() {
        bug014.go | bug050.go |  bug068.go |  bug083.go | bug088.go | \
        bug106.go | bug121.go | bug125.go | bug133.go | bug160.go | \
        bug163.go | bug166.go | bug169.go | bug217.go | bug222.go | \
-       bug226.go | bug228.go ) ;;
+       bug226.go | bug228.go | bug248.go ) ;;
        * ) "$1" "$2"; count "$F";;
        esac
 }
index 45713327df5607fef4689cd1ad1a43e2f9384d5e..99c2370749299be35b830cf161fc78cc9651505a 100644 (file)
@@ -677,7 +677,7 @@ func (p *parser) parseResult(scope *ast.Scope) []*ast.Field {
        var results []*ast.Field
        if p.tok == token.LPAREN {
                results = p.parseParameters(scope, false)
-       } else if p.tok != token.FUNC {
+       } else {
                typ := p.tryType()
                if typ != nil {
                        results = make([]*ast.Field, 1)
index c177b2eb816aed43ec9a76ce79bf930efb001dec..39e13c5a5d0703ec18d31e42a65209a3df9731c7 100644 (file)
@@ -34,7 +34,7 @@ var validPrograms = []interface{}{
        `package main; func main() { if f(T{}) {} }` + "\n",
        `package main; func main() { _ = (<-chan int)(x) }` + "\n",
        `package main; func main() { _ = (<-chan <-chan int)(x) }` + "\n",
-       `package main; func f(func() (func() int))` + "\n",
+       `package main; func f(func() func() func())` + "\n",
 }