Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
LGTM On Mar 24, 2010, at 7:52 PM, rsc@golang.org wrote: > Reviewers: r, > > Message: > Hello r (cc: golang-dev@googlegroups.com), > > I'd like you to review this change. > > > Description: > gc: more syntax errors > > Please review this at http://codereview.appspot.com/731041/show > > Affected files: > M src/cmd/gc/go.errors > A test/syntax/vareq.go > A test/syntax/vareq1.go > > > Index: src/cmd/gc/go.errors > =================================================================== > --- a/src/cmd/gc/go.errors > +++ b/src/cmd/gc/go.errors > @@ -13,34 +13,40 @@ > // Each line of the form % token list > // is converted by bisonerrors into the yystate and yychar caused > // by that token list. > - > + > % loadsys package LIMPORT '(' LLITERAL import_package import_there ',' > "unexpected comma during import block", > - > + > % loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';' > "unexpected semicolon or newline before {", > - > + > % loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';' > "unexpected semicolon or newline before {", > - > + > % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';' > "unexpected semicolon or newline before {", > - > + > % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY > "unexpected semicolon or newline before {", > - > + > % loadsys package imports LFUNC LNAME '(' ')' ';' '{' > "unexpected semicolon or newline before {", > - > + > % loadsys package imports LTYPE LNAME ';' > "unexpected semicolon or newline in type declaration", > - > + > % loadsys package imports LFUNC LNAME '(' ')' '{' if_stmt ';' LELSE > "unexpected semicolon or newline before else", > - > + > % loadsys package imports LTYPE LNAME LINTERFACE '{' LNAME ',' LNAME > "name list not allowed in interface type", > - > + > % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME > "var declaration not allowed in for initializer", > + > + % loadsys package imports LVAR LNAME '[' ']' LNAME '{' > + "var declaration missing = before initial value", > + > + % loadsys package imports LFUNC LNAME '(' ')' '{' LVAR LNAME '[' ']' LNAME '{' > + "var declaration missing = before initial value", > }; > Index: test/syntax/vareq.go > =================================================================== > new file mode 100644 > --- /dev/null > +++ b/test/syntax/vareq.go > @@ -0,0 +1,10 @@ > +// errchk $G -e $D/$F.go > + > +// Copyright 2010 The Go Authors. All rights reserved. > +// Use of this source code is governed by a BSD-style > +// license that can be found in the LICENSE file. > + > +package main > + > +func main() { > + var x map[string]string{"a":"b"} // ERROR "var declaration missing =" > Index: test/syntax/vareq1.go > =================================================================== > new file mode 100644 > --- /dev/null > +++ b/test/syntax/vareq1.go > @@ -0,0 +1,10 @@ > +// errchk $G -e $D/$F.go > + > +// Copyright 2010 The Go Authors. All rights reserved. > +// Use of this source code is governed by a BSD-style > +// license that can be found in the LICENSE file. > + > +package main > + > +var x map[string]string{"a":"b"} // ERROR "var declaration missing =" > + > >
*** Submitted as http://code.google.com/p/go/source/detail?r=a06ac84c4cb2 *** gc: more syntax errors R=r CC=golang-dev http://codereview.appspot.com/731041