ErrorRecoveryLimit limits the number of attempts the parser will perform to recover from an error.
(limit int)
| 63 | |
| 64 | // ErrorRecoveryLimit limits the number of attempts the parser will perform to recover from an error. |
| 65 | func ErrorRecoveryLimit(limit int) Option { |
| 66 | return func(opts *options) error { |
| 67 | if limit < -1 { |
| 68 | return fmt.Errorf("error recovery limit must be greater than or equal to -1: %d", limit) |
| 69 | } |
| 70 | opts.errorRecoveryLimit = limit |
| 71 | return nil |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // ErrorReportingLimit limits the number of syntax error reports before terminating parsing. |
| 76 | // |
no outgoing calls