Skip to content

Commit

Permalink
Remove printTree debugging flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jstemmer committed Oct 4, 2014
1 parent 448fb82 commit ca92d7c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
7 changes: 0 additions & 7 deletions main.go
Expand Up @@ -25,7 +25,6 @@ var (
recurse bool
sortOutput bool
silent bool
printTree bool // for debugging
)

// Initialize flags.
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions parser.go
Expand Up @@ -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{
Expand Down

0 comments on commit ca92d7c

Please sign in to comment.