summaryrefslogtreecommitdiff
path: root/test/syntax
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2010-09-09 22:40:25 -0700
committerIan Lance Taylor <iant@golang.org>2010-09-09 22:40:25 -0700
commit36b7823b174fd5b47af8c9cca771dadca679c884 (patch)
treefce75d6021e84ef0a5301bd311e46b4a71e11211 /test/syntax
parent4b93062761835e9008110d924569d7d9b6aacbee (diff)
downloadgo-36b7823b174fd5b47af8c9cca771dadca679c884.tar.gz
test: Match gccgo error messages.
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 http://codereview.appspot.com/2175041
Diffstat (limited to 'test/syntax')
-rw-r--r--test/syntax/topexpr.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/syntax/topexpr.go b/test/syntax/topexpr.go
index 83de49075..93d86fbe9 100644
--- a/test/syntax/topexpr.go
+++ b/test/syntax/topexpr.go
@@ -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"