MaxExpressionNodeCount limits the maximum number of expression nodes that may be emitted by the parser, including nodes created by macro expansion.
(limit int)
| 101 | // MaxExpressionNodeCount limits the maximum number of expression nodes that may be emitted by the parser, |
| 102 | // including nodes created by macro expansion. |
| 103 | func MaxExpressionNodeCount(limit int) Option { |
| 104 | return func(opts *options) error { |
| 105 | if limit < -1 { |
| 106 | return fmt.Errorf("max expression node count must be greater than or equal to -1: %d", limit) |
| 107 | } |
| 108 | opts.maxExpressionNodeCount = limit |
| 109 | return nil |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | // Macros adds the given macros to the parser. |
| 114 | func Macros(macros ...Macro) Option { |
no outgoing calls