diff options
author | Robert Griesemer <gri@golang.org> | 2010-02-16 11:20:25 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2010-02-16 11:20:25 -0800 |
commit | f96c03e483aca8036176d436669ea99d25386e4a (patch) | |
tree | cbda34f8ea42e33056fef6dd843120092cf501fe /src/pkg/go/doc/doc.go | |
parent | 4d5e60f1878767d9f8df494365c034f901a694e3 (diff) | |
download | golang-f96c03e483aca8036176d436669ea99d25386e4a.tar.gz |
remove assumption that all files belonging to a package are in the same directory:
- adjust ast.Package node and doc.PackageDoc correspondingly
- introduce parser.ParseFiles
R=rsc
CC=golang-dev
http://codereview.appspot.com/207087
Diffstat (limited to 'src/pkg/go/doc/doc.go')
-rw-r--r-- | src/pkg/go/doc/doc.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pkg/go/doc/doc.go b/src/pkg/go/doc/doc.go index d97548715..9bd1158de 100644 --- a/src/pkg/go/doc/doc.go +++ b/src/pkg/go/doc/doc.go @@ -293,7 +293,7 @@ func NewFileDoc(file *ast.File) *PackageDoc { var r docReader r.init(file.Name.Name()) r.addFile(file) - return r.newDoc("", "", nil) + return r.newDoc("", nil) } @@ -307,7 +307,7 @@ func NewPackageDoc(pkg *ast.Package, importpath string) *PackageDoc { filenames[i] = filename i++ } - return r.newDoc(importpath, pkg.Path, filenames) + return r.newDoc(importpath, filenames) } @@ -511,7 +511,6 @@ func makeBugDocs(v *vector.Vector) []string { type PackageDoc struct { PackageName string ImportPath string - FilePath string Filenames []string Doc string Consts []*ValueDoc @@ -524,11 +523,10 @@ type PackageDoc struct { // newDoc returns the accumulated documentation for the package. // -func (doc *docReader) newDoc(importpath, filepath string, filenames []string) *PackageDoc { +func (doc *docReader) newDoc(importpath string, filenames []string) *PackageDoc { p := new(PackageDoc) p.PackageName = doc.pkgName p.ImportPath = importpath - p.FilePath = filepath sort.SortStrings(filenames) p.Filenames = filenames p.Doc = CommentText(doc.doc) |