]> Cypherpunks repositories - gostls13.git/commit
go/ast: implemented NewPackage
authorRobert Griesemer <gri@golang.org>
Mon, 28 Mar 2011 17:46:26 +0000 (10:46 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 28 Mar 2011 17:46:26 +0000 (10:46 -0700)
commit5be77a204bee72c81a8f0182d0a23bfd32b36ab9
tree461fcb84447cfc3e81c7a5da18e244b9cbedcfec
parenta7a854b82f99c4fb08e44b3c942a3361894cf4b5
go/ast: implemented NewPackage

NewPackage creates an ast.Package node from
a set of package files and resolves unresolved
identifiers.

Also:
- Changed semantics of Scope.Insert: If an
  object is inserted w/o errors, the result
  is nil (before it was obj).
- Fixed an identifier resolution bug in the
  parser: map keys must not be resolved.

gotype runs through several go/* packages
and successfully resolves all (non-field/method)
identifiers.

R=rog, rsc
CC=golang-dev
https://golang.org/cl/4298044
12 files changed:
src/cmd/gotype/gotype.go
src/cmd/gotype/gotype_test.go
src/pkg/go/ast/Makefile
src/pkg/go/ast/ast.go
src/pkg/go/ast/filter.go
src/pkg/go/ast/resolve.go [new file with mode: 0644]
src/pkg/go/ast/scope.go
src/pkg/go/parser/interface.go
src/pkg/go/parser/parser.go
src/pkg/go/typechecker/scope.go
src/pkg/go/typechecker/typechecker.go
src/pkg/go/typechecker/universe.go