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