]> Cypherpunks repositories - gostls13.git/commitdiff
test: Match gccgo error messages.
authorIan Lance Taylor <iant@golang.org>
Fri, 10 Sep 2010 05:40:25 +0000 (22:40 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 10 Sep 2010 05:40:25 +0000 (22:40 -0700)
With the recursive descent parser that gccgo uses, I think
that it doesn't make sense to try to match a statement where a
statement is not expected.  If the construct is not a
statement, you will just get bizarre error messages.

topexpr.go:9:1: error: expected declaration
topexpr.go:14:1: error: expected declaration
topexpr.go:19:1: error: expected declaration

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2175041

test/syntax/topexpr.go

index 83de49075d9d31ee4963c66b93b3f257467f2c6a..93d86fbe959ba520f219e6be2e5b342586515129 100644 (file)
@@ -6,15 +6,15 @@
 
 package main
 
-fmt.Printf("hello")    // ERROR "non-declaration statement outside function body"
+fmt.Printf("hello")    // ERROR "non-declaration statement outside function body|expected declaration"
 
 func main() {
 }
 
-x++    // ERROR "non-declaration statement outside function body"
+x++    // ERROR "non-declaration statement outside function body|expected declaration"
 
 func init() {
 }
 
-x,y := 1, 2    // ERROR "non-declaration statement outside function body"
+x,y := 1, 2    // ERROR "non-declaration statement outside function body|expected declaration"