mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
https://golang.org/cl/189080
This commit is contained in:
parent
67237c0f11
commit
01b4f2dd23
23 changed files with 250 additions and 252 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue