]> Cypherpunks repositories - gostls13.git/commit
go/parser: unify parsing of const and var declarations
authorRobert Griesemer <gri@golang.org>
Fri, 5 Oct 2012 03:53:43 +0000 (20:53 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 5 Oct 2012 03:53:43 +0000 (20:53 -0700)
commit6c740e769f11ab4a7e4300a2011fe86109bd32ae
tree016b60e374fbf68af555b932f6427008258211b5
parent9f807fcc4ae1bdd38ee637a88128a1c72d984a30
go/parser: unify parsing of const and var declarations

The AST representation is already identical. Making the
code (nearly) identical in the parser reduces code size
and ensures that the ast.ValueSpec nodes have the same
values (specifically, iota). This in turn permits the
sharing of much of the respective code in the typechecker.

While at it: type functions work now, so use them.

R=r
CC=golang-dev
https://golang.org/cl/6624047
src/pkg/go/parser/parser.go