]> Cypherpunks repositories - gostls13.git/commit
go/scanner: clean up error interface
authorRobert Griesemer <gri@golang.org>
Wed, 8 Feb 2012 19:41:32 +0000 (11:41 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 8 Feb 2012 19:41:32 +0000 (11:41 -0800)
commitd08dd8bec1e976ccd278403addac6ecfa349f2bf
tree29d3fac8c3cf349b836965d94bd0aa56d13a189f
parentd37a8b73c504c232084666b292f20debb397bd27
go/scanner: clean up error interface

Issue 2856 asks for a rename of a few methods to a
more idiomatic Go style. This is a very early API
that evolved organically throughout the years.
Together with the fact that ErrorVectors were embedded
in other data structures (e.g. Parser), just renaming
methods (e.g. GetError -> Error) would lead to undesired
behavior (e.g., Parser would act like an Error). Instead,
cleaned up API a bit more:

- removed ErrorVector in favor of ErrorList (already
present)
- simplified Scanner.Init by making the error handler a
function instead of requiring an ErrorHandler implementation
- adjusted helper functions accordingly
- updated Go 1 doc

Fixes #2856.

R=rsc
CC=golang-dev
https://golang.org/cl/5624047
doc/go1.html
doc/go1.tmpl
src/pkg/exp/types/check.go
src/pkg/go/ast/resolve.go
src/pkg/go/parser/interface.go
src/pkg/go/parser/parser.go
src/pkg/go/scanner/errors.go
src/pkg/go/scanner/scanner.go
src/pkg/go/scanner/scanner_test.go