(&mut self, mut f: F)
| 2018 | |
| 2019 | #[must_use] |
| 2020 | fn maybe_parse<T, F>(&mut self, mut f: F) -> Option<T> |
| 2021 | where |
| 2022 | F: FnMut(&mut Self) -> Result<T, ParserError>, |
| 2023 | { |
| 2024 | if self.speculative_failures >= SPECULATIVE_FAILURES_PER_TOKEN * self.tokens.len() { |
| 2025 | return None; |
| 2026 | } |
| 2027 | let index = self.index; |
| 2028 | if let Ok(t) = f(self) { |
| 2029 | Some(t) |
| 2030 | } else { |
| 2031 | self.index = index; |
| 2032 | self.speculative_failures += 1; |
| 2033 | None |
| 2034 | } |
| 2035 | } |
| 2036 | |
| 2037 | /// Parse a SQL CREATE statement |
| 2038 | fn parse_create(&mut self) -> Result<Statement<Raw>, ParserStatementError> { |
no test coverage detected