MaxRecursionDepth limits the maximum depth the parser will attempt to parse the expression before giving up.
(limit int)
| 38 | |
| 39 | // MaxRecursionDepth limits the maximum depth the parser will attempt to parse the expression before giving up. |
| 40 | func MaxRecursionDepth(limit int) Option { |
| 41 | return func(opts *options) error { |
| 42 | if limit < -1 { |
| 43 | return fmt.Errorf("max recursion depth must be greater than or equal to -1: %d", limit) |
| 44 | } |
| 45 | opts.maxRecursionDepth = limit |
| 46 | return nil |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // ErrorRecoveryLookaheadTokenLimit limits the number of lexer tokens that may be considered during error recovery. |
| 51 | // |
no outgoing calls