Bail out if the current token is not an expected keyword, or consume it if it is
(&mut self, expected: Keyword)
| 1916 | |
| 1917 | /// Bail out if the current token is not an expected keyword, or consume it if it is |
| 1918 | fn expect_keyword(&mut self, expected: Keyword) -> Result<(), ParserError> { |
| 1919 | if self.parse_keyword(expected) { |
| 1920 | Ok(()) |
| 1921 | } else { |
| 1922 | self.expected(self.peek_pos(), expected, self.peek_token()) |
| 1923 | } |
| 1924 | } |
| 1925 | |
| 1926 | /// Bail out if the following tokens are not the expected sequence of |
| 1927 | /// keywords, or consume them if they are. |
no test coverage detected