EnableVariadicOperatorASTs enables a compact representation of chained like-kind commutative operators. e.g. `a || b || c || d` -> `call(op='||', args=[a, b, c, d])` The benefit of enabling variadic operators ASTs is a more compact representation deeply nested logic graphs.
(varArgASTs bool)
| 171 | // The benefit of enabling variadic operators ASTs is a more compact representation deeply nested |
| 172 | // logic graphs. |
| 173 | func EnableVariadicOperatorASTs(varArgASTs bool) Option { |
| 174 | return func(opts *options) error { |
| 175 | opts.enableVariadicOperatorASTs = varArgASTs |
| 176 | return nil |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // EnablePrattParser enables the Pratt parser implementation instead of the ANTLR parser. |
| 181 | func EnablePrattParser(enablePrattParser bool) Option { |
no outgoing calls