Пример #1
0
func (c *converter) convertScope(dst *types.Scope, src *gotypes.Scope) {
	for _, name := range src.Names() {
		obj := src.Lookup(name)
		dst.Insert(c.convertObject(obj))
	}
	for i := 0; i < src.NumChildren(); i++ {
		child := src.Child(i)
		newScope := types.NewScope(dst, token.Pos(child.Pos()), token.Pos(child.End()), "")
		c.convertScope(newScope, child)
	}
}