func (c *compiler) compVar(v *ir.Var) string { switch t := v.Scope().Lookup(v.Name()).(type) { case *ir.Define: return c.compDefine(t) case *ir.Param: return fmt.Sprintf("%s%d", t.Name(), t.ID()) } panic("unreachable") }
func (c *compiler) compIdent(i *ir.Var) string { return fmt.Sprintf("%s%d", i.Name(), i.Scope().Lookup(i.Name()).ID()) }