diff options
author | Robert Griesemer <gri@golang.org> | 2010-01-15 13:27:45 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2010-01-15 13:27:45 -0800 |
commit | 1dd0f7c2e78657111e265fbc76f281f7850c38c5 (patch) | |
tree | f7a2ae997c05b400635bc380102dd73102b05b0f /src/cmd/godoc/snippet.go | |
parent | 2442a6ddd956d1a902282d9bef429c16348fcf37 (diff) | |
download | golang-1dd0f7c2e78657111e265fbc76f281f7850c38c5.tar.gz |
Steps towards tracking scopes for identifiers.
- Identifiers refer now to the language entity (Object)
that they denote. At the moment this is at best an
approximation.
- Initial data structures for language entities (Objects)
and expression types (Type) independent of the actual
type notations.
- Initial support for declaring and looking up identifiers.
- Updated various dependent files and added support functions.
- Extensively tested to avoid breakage. This is an AST change.
R=rsc
CC=golang-dev, rog
http://codereview.appspot.com/189080
Diffstat (limited to 'src/cmd/godoc/snippet.go')
-rwxr-xr-x | src/cmd/godoc/snippet.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/godoc/snippet.go b/src/cmd/godoc/snippet.go index 98bc97285..102878dc5 100755 --- a/src/cmd/godoc/snippet.go +++ b/src/cmd/godoc/snippet.go @@ -36,7 +36,7 @@ func (s *snippetStyler) LineTag(line int) (text []uint8, tag printer.HTMLTag) { func (s *snippetStyler) Ident(id *ast.Ident) (text []byte, tag printer.HTMLTag) { - text = strings.Bytes(id.Value) + text = strings.Bytes(id.Name()) if s.highlight == id { tag = printer.HTMLTag{"<span class=highlight>", "</span>"} } @@ -115,7 +115,7 @@ func NewSnippet(decl ast.Decl, id *ast.Ident) (s *Snippet) { if s == nil { s = &Snippet{ id.Pos().Line, - fmt.Sprintf(`could not generate a snippet for <span class="highlight">%s</span>`, id.Value), + fmt.Sprintf(`could not generate a snippet for <span class="highlight">%s</span>`, id.Name()), } } return |