Push pushes the given activation onto the activation stack and returns the new frame. This operation is internal to the interpreter and is used to handle comprehension scoping. The child frame inherits the shared evalContext from the parent.
(activation Activation)
| 136 | // This operation is internal to the interpreter and is used to handle comprehension |
| 137 | // scoping. The child frame inherits the shared evalContext from the parent. |
| 138 | func (f *ExecutionFrame) Push(activation Activation) *ExecutionFrame { |
| 139 | child := frameStack.Get().(*ExecutionFrame) |
| 140 | child.parent = f |
| 141 | child.ctx = f.ctx |
| 142 | child.Activation = activationStack.create(f.Activation, activation) |
| 143 | return child |
| 144 | } |
| 145 | |
| 146 | // Pop returns the parent frame, releasing the current frame back to the pool. |
| 147 | func (f *ExecutionFrame) Pop() *ExecutionFrame { |