findFrame walks the activation hierarchy via Unwrap and Parent to locate an existing ExecutionFrame, if one exists.
(a Activation)
| 212 | // findFrame walks the activation hierarchy via Unwrap and Parent to locate an |
| 213 | // existing ExecutionFrame, if one exists. |
| 214 | func findFrame(a Activation) *ExecutionFrame { |
| 215 | if wrapper, ok := a.(activationWrapper); ok { |
| 216 | unwrapped := wrapper.Unwrap() |
| 217 | if f, ok := unwrapped.(*ExecutionFrame); ok { |
| 218 | return f |
| 219 | } |
| 220 | return findFrame(unwrapped) |
| 221 | } |
| 222 | if p := a.Parent(); p != nil { |
| 223 | if f, ok := p.(*ExecutionFrame); ok { |
| 224 | return f |
| 225 | } |
| 226 | return findFrame(p) |
| 227 | } |
| 228 | return nil |
| 229 | } |
| 230 | |
| 231 | // Core Interpretable implementations used during the program planning phase. |
| 232 |