addIdentRef adds a identifier reference for the token ref.
(ref *Token)
| 707 | |
| 708 | // addIdentRef adds a identifier reference for the token ref. |
| 709 | func (p *parser) addIdentRef(ref *Token) { |
| 710 | id := ref.Text(p.lines) |
| 711 | i, existing := p.idents[id] |
| 712 | if !existing { |
| 713 | i = &Identifier{} |
| 714 | p.idents[id] = i |
| 715 | } |
| 716 | i.References = append(i.References, ref) |
| 717 | } |
| 718 | |
| 719 | // err appends an fmt.Printf style error into l.diags for the given token. |
| 720 | func (p *parser) err(tok *Token, msg string, args ...interface{}) { |