go.tools: clear DeclarationErrors flag; it's redundant w.r.t go/types checking.

R=gri
CC=golang-dev
https://golang.org/cl/14147043
This commit is contained in:
Alan Donovan 2013-10-08 10:34:36 -04:00
parent da6f00a60b
commit 8ae5d36d2a
8 changed files with 9 additions and 11 deletions

View File

@ -42,7 +42,7 @@ func pathToString(path []ast.Node) string {
// an error has already been reported in that case.
//
func findInterval(t *testing.T, fset *token.FileSet, input, substr string) (f *ast.File, start, end token.Pos) {
f, err := parser.ParseFile(fset, "<input>", input, parser.DeclarationErrors)
f, err := parser.ParseFile(fset, "<input>", input, 0)
if err != nil {
t.Errorf("parse error: %s", err)
return

View File

@ -84,7 +84,7 @@ func ParseFiles(fset *token.FileSet, dir string, files ...string) ([]*ast.File,
}
wg.Add(1)
go func(i int, file string) {
parsed[i], errors[i] = parser.ParseFile(fset, file, nil, parser.DeclarationErrors)
parsed[i], errors[i] = parser.ParseFile(fset, file, nil, 0)
wg.Done()
}(i, file)
}

View File

@ -75,8 +75,7 @@ func parseQueries(t *testing.T, filename string) []*query {
// Parse the file once to discover the test queries.
var fset token.FileSet
f, err := parser.ParseFile(&fset, filename, filedata,
parser.DeclarationErrors|parser.ParseComments)
f, err := parser.ParseFile(&fset, filename, filedata, parser.ParseComments)
if err != nil {
t.Fatal(err)
}

View File

@ -45,7 +45,7 @@ func main() {
imp := importer.New(&importer.Config{Build: &build.Default})
// Parse the input file.
file, err := parser.ParseFile(imp.Fset, "myprog.go", myprog, parser.DeclarationErrors)
file, err := parser.ParseFile(imp.Fset, "myprog.go", myprog, 0)
if err != nil {
fmt.Print(err) // parse error
return

View File

@ -169,7 +169,7 @@ func doOneInput(input, filename string) bool {
imp := importer.New(impctx)
// Parsing.
f, err := parser.ParseFile(imp.Fset, filename, input, parser.DeclarationErrors)
f, err := parser.ParseFile(imp.Fset, filename, input, 0)
if err != nil {
// TODO(adonovan): err is a scanner error list;
// display all errors not just first?

View File

@ -40,7 +40,7 @@ func main() {
`
imp := importer.New(new(importer.Config)) // no go/build.Context; uses GC importer
f, err := parser.ParseFile(imp.Fset, "<input>", test, parser.DeclarationErrors)
f, err := parser.ParseFile(imp.Fset, "<input>", test, 0)
if err != nil {
t.Error(err)
return

View File

@ -45,7 +45,7 @@ func main() {
imp := importer.New(&importer.Config{Build: &build.Default})
// Parse the input file.
file, err := parser.ParseFile(imp.Fset, "hello.go", hello, parser.DeclarationErrors)
file, err := parser.ParseFile(imp.Fset, "hello.go", hello, 0)
if err != nil {
fmt.Print(err) // parse error
return

View File

@ -24,7 +24,7 @@ import (
func TestObjValueLookup(t *testing.T) {
imp := importer.New(new(importer.Config)) // (uses GCImporter)
f, err := parser.ParseFile(imp.Fset, "testdata/objlookup.go", nil, parser.DeclarationErrors|parser.ParseComments)
f, err := parser.ParseFile(imp.Fset, "testdata/objlookup.go", nil, parser.ParseComments)
if err != nil {
t.Error(err)
return
@ -178,8 +178,7 @@ func checkVarValue(t *testing.T, prog *ssa.Program, pkg *ssa.Package, ref []ast.
// corresponding to every ast.Expr.
func TestValueForExpr(t *testing.T) {
imp := importer.New(new(importer.Config)) // (uses GCImporter)
f, err := parser.ParseFile(imp.Fset, "testdata/valueforexpr.go", nil,
parser.DeclarationErrors|parser.ParseComments)
f, err := parser.ParseFile(imp.Fset, "testdata/valueforexpr.go", nil, parser.ParseComments)
if err != nil {
t.Error(err)
return