folder tracks the state associated with folding a list or map with a comprehension v2 style macro. The folder embeds an interpreter.Activation and Interpretable evalFold value as well as implements the traits.Folder interface methods. Instances of a folder are intended to be pooled to minimize all
| 1537 | // in preserving evaluation order semantics which might otherwise be disrupted through the use of |
| 1538 | // cel.bind or cel.@block. |
| 1539 | type folder struct { |
| 1540 | *evalFold |
| 1541 | frame *ExecutionFrame |
| 1542 | |
| 1543 | // fold state objects. |
| 1544 | accuVal ref.Val |
| 1545 | iterVar1Val any |
| 1546 | iterVar2Val any |
| 1547 | |
| 1548 | // bookkeeping flags to modify Activation and fold behaviors. |
| 1549 | initialized bool |
| 1550 | mutableValue bool |
| 1551 | interrupted bool |
| 1552 | computeResult bool |
| 1553 | } |
| 1554 | |
| 1555 | func (f *folder) foldIterable(iterable traits.Iterable) ref.Val { |
| 1556 | it := iterable.Iterator() |
nothing calls this directly
no outgoing calls
no test coverage detected