diff --git a/main.go b/main.go index d861ee6..fd26489 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,6 @@ var ( recurse bool sortOutput bool silent bool - printTree bool // for debugging ) // Initialize flags. @@ -35,7 +34,6 @@ func init() { flag.BoolVar(&recurse, "R", false, "recurse into directories in the file list") flag.BoolVar(&sortOutput, "sort", true, "sort tags") flag.BoolVar(&silent, "silent", false, "do not produce any output on error") - flag.BoolVar(&printTree, "tree", false, "print syntax tree (debugging)") flag.Usage = func() { fmt.Fprintf(os.Stderr, "gotags version %s\n\n", Version) @@ -142,11 +140,6 @@ func main() { os.Exit(1) } - if printTree { - PrintTree(flag.Arg(0)) - return - } - tags := []Tag{} for _, file := range files { ts, err := Parse(file) diff --git a/parser.go b/parser.go index eb92fb6..e9c2686 100644 --- a/parser.go +++ b/parser.go @@ -15,18 +15,6 @@ type tagParser struct { types []string // all types we encounter, used to determine the constructors } -// PrintTree prints the ast of the source in filename. -func PrintTree(filename string) error { - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, filename, nil, 0) - if err != nil { - return err - } - - ast.Print(fset, f) - return nil -} - // Parse parses the source in filename and returns a list of tags. func Parse(filename string) ([]Tag, error) { p := &tagParser{