Commit 3eb9adee authored by Robert Griesemer's avatar Robert Griesemer

go/parser: don't report name errors if DeclarationErrors is not set

R=adonovan
CC=golang-dev
https://golang.org/cl/12072043
parent fdb69cb0
......@@ -2385,7 +2385,7 @@ func (p *parser) parseFile() *ast.File {
// Go spec: The package clause is not a declaration;
// the package name does not appear in any scope.
ident := p.parseIdent()
if ident.Name == "_" {
if ident.Name == "_" && p.mode&DeclarationErrors != 0 {
p.error(p.pos, "invalid package name _")
}
p.expectSemi()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment