Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
9 changed files
with
128 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.