Commits

hammerandtongs  committed b175831

Updating for Go 1

  • Participants
  • Parent commits a8ba31d

Comments (0)

Files changed (1)

 
 package main
 
-
 import (
-	"container/vector"
 	"fmt"
 	"go/ast"
 	"go/parser"
 	"sort"
 )
 
-var (
-	tags vector.StringVector
-)
+var tags []string
 
 func output_tag(fset *token.FileSet, name *ast.Ident, kind byte) {
-	position := fset.Position( name.NamePos )
-	tags.Push(fmt.Sprintf("%s\t%s\t%d;\"\t%c",
+	position := fset.Position(name.NamePos)
+	tags = append(tags, fmt.Sprintf("%s\t%s\t%d;\"\t%c",
 		name.Name, position.Filename, position.Line, kind))
 }
 
 const FUNC, TYPE, VAR = 'f', 't', 'v'
 
 func parse_files() {
-	for _,f := range os.Args[1:] {
+	for _, f := range os.Args[1:] {
 		fileset := token.NewFileSet()
-		fi, _ := os.Lstat( f )
-		fileset.AddFile( f, fileset.Base(), int(fi.Size) )
+		fi, _ := os.Lstat(f)
+		fileset.AddFile(f, fileset.Base(), int(fi.Size()))
 		tree, ok := parser.ParseFile(fileset, f, nil, 0)
 		if ok != nil {
-			println("error parsing file", f, ok.String())
+			println("error parsing file", f, ok.Error())
 			panic(nil)
 		}