(&mut self, kws: &[Keyword])
| 1892 | /// Look for one of the given keywords and return the one that matches. |
| 1893 | #[must_use] |
| 1894 | fn parse_one_of_keywords(&mut self, kws: &[Keyword]) -> Option<Keyword> { |
| 1895 | match self.peek_token() { |
| 1896 | Some(Token::Keyword(k)) if kws.contains(&k) => { |
| 1897 | self.next_token(); |
| 1898 | Some(k) |
| 1899 | } |
| 1900 | _ => None, |
| 1901 | } |
| 1902 | } |
| 1903 | |
| 1904 | /// Bail out if the current token is not one of the expected keywords, or consume it if it is |
| 1905 | fn expect_one_of_keywords(&mut self, keywords: &[Keyword]) -> Result<Keyword, ParserError> { |
no test coverage detected