From c30b570468973021b5d20f0baa28216ecf6be94c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 9 Sep 2010 22:40:25 -0700 Subject: [PATCH] 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 https://golang.org/cl/2175041 --- test/syntax/topexpr.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/syntax/topexpr.go b/test/syntax/topexpr.go index 83de49075d9..93d86fbe959 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"