// process provided filenames, if any
if flag.NArg() > 0 {
for _, filename := range flag.Args() {
- fmt.Println("generating", filename)
generate(filename, filemap[filename])
}
+ fmt.Printf("generated %d files\n", flag.NArg())
return
}
for filename, action := range filemap {
generate(filename, action)
}
+ fmt.Printf("generated %d files\n", len(filemap))
}
func generate(filename string, action action) {
"under.go": nil,
"unify.go": fixSprintf,
"universe.go": fixGlobalTypVarDecl,
+ "util_test.go": fixTokenPos,
"validtype.go": nil,
}
})
}
-// fixTokenPos changes imports of "cmd/compile/internal/syntax" to "go/token"
-// and uses of syntax.Pos to token.Pos.
+// fixTokenPos changes imports of "cmd/compile/internal/syntax" to "go/token",
+// uses of syntax.Pos to token.Pos, and calls to x.IsKnown() to x.IsValid().
func fixTokenPos(f *ast.File) {
ast.Inspect(f, func(n ast.Node) bool {
switch n := n.(type) {
+// Code generated by "go run generator.go"; DO NOT EDIT.
+
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.