addrs: ModuleInstance.Module

This returns the address of the module that the module instance is an
instance of.
This commit is contained in:
Martin Atkins 2019-11-21 18:41:38 -08:00
parent 9f727b5799
commit 657f9502e4
1 changed files with 13 additions and 0 deletions

View File

@ -410,6 +410,19 @@ func (m ModuleInstance) TargetContains(other Targetable) bool {
}
}
// Module returns the address of the module that this instance is an instance
// of.
func (m ModuleInstance) Module() Module {
if len(m) == 0 {
return nil
}
ret := make(Module, len(m))
for i, step := range m {
ret[i] = step.Name
}
return ret
}
func (m ModuleInstance) targetableSigil() {
// ModuleInstance is targetable
}