EnableHiddenAccumulatorName uses an accumulator variable name that is not a normally accessible identifier in source for comprehension macros. Compatibility notes: with this option enabled, a parsed AST would be semantically the same as if disabled, but would have different internal identifiers in a
(enabled bool)
| 157 | // have different internal identifiers in any of the built-in comprehension sub-expressions. When |
| 158 | // disabled, it is possible but almost certainly a logic error to access the accumulator variable. |
| 159 | func EnableHiddenAccumulatorName(enabled bool) Option { |
| 160 | return func(opts *options) error { |
| 161 | opts.enableHiddenAccumulatorName = enabled |
| 162 | return nil |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // EnableVariadicOperatorASTs enables a compact representation of chained like-kind commutative |
| 167 | // operators. e.g. `a || b || c || d` -> `call(op='||', args=[a, b, c, d])` |
no outgoing calls
no test coverage detected