ExpressionSizeCodePointLimit is an option which limits the maximum code point count of an expression.
(expressionSizeCodePointLimit int)
| 88 | // ExpressionSizeCodePointLimit is an option which limits the maximum code point count of an |
| 89 | // expression. |
| 90 | func ExpressionSizeCodePointLimit(expressionSizeCodePointLimit int) Option { |
| 91 | return func(opts *options) error { |
| 92 | if expressionSizeCodePointLimit < -1 { |
| 93 | return fmt.Errorf("expression size code point limit must be greater than or equal to -1: %d", expressionSizeCodePointLimit) |
| 94 | } |
| 95 | opts.expressionSizeCodePointLimit = expressionSizeCodePointLimit |
| 96 | return nil |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | // Macros adds the given macros to the parser. |
| 101 | func Macros(macros ...Macro) Option { |
no outgoing calls