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