diff options
| author | Robert Griesemer <gri@golang.org> | 2010-01-27 09:44:28 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2010-01-27 09:44:28 -0800 |
| commit | fe6c651b4e980c92e277a13720bd84ff721603c9 (patch) | |
| tree | cf0615de31884064ae38c640a04ed24141241879 /src/cmd/godoc/godoc.go | |
| parent | 94d870b20fa9c13e96cc5d4894497c4d8df35b95 (diff) | |
| download | golang-fe6c651b4e980c92e277a13720bd84ff721603c9.tar.gz | |
More steps towards tracking of identifier scopes.
- provide scope to parse functions; if non-nil, parser uses the scope
to declare and lookup identifiers
- resolve forward references where possible
R=rsc
CC=golang-dev
http://codereview.appspot.com/194098
Diffstat (limited to 'src/cmd/godoc/godoc.go')
| -rw-r--r-- | src/cmd/godoc/godoc.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 627c4027d..812d23824 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -122,7 +122,7 @@ func isPkgDir(dir *os.Dir) bool { func pkgName(filename string) string { - file, err := parser.ParseFile(filename, nil, parser.PackageClauseOnly) + file, err := parser.ParseFile(filename, nil, nil, parser.PackageClauseOnly) if err != nil || file == nil { return "" } @@ -207,7 +207,7 @@ func newDirTree(path, name string, depth, maxDepth int) *Directory { nfiles++ if text == "" { // no package documentation yet; take the first found - file, err := parser.ParseFile(pathutil.Join(path, d.Name), nil, + file, err := parser.ParseFile(pathutil.Join(path, d.Name), nil, nil, parser.ParseComments|parser.PackageClauseOnly) if err == nil && // Also accept fakePkgName, so we get synopses for commmands. @@ -845,7 +845,7 @@ func serveGoSource(c *http.Conn, r *http.Request, path string) { Error string } - file, err := parser.ParseFile(path, nil, parser.ParseComments) + file, err := parser.ParseFile(path, nil, nil, parser.ParseComments) info.Source = StyledNode{file, &Styler{linetags: true, highlight: r.FormValue("h")}} if err != nil { info.Error = err.String() |
