Report unexpected token
(
&self,
pos: usize,
expected: D,
found: Option<Token>,
)
| 1820 | |
| 1821 | /// Report unexpected token |
| 1822 | fn expected<D, T>( |
| 1823 | &self, |
| 1824 | pos: usize, |
| 1825 | expected: D, |
| 1826 | found: Option<Token>, |
| 1827 | ) -> Result<T, ParserError> |
| 1828 | where |
| 1829 | D: fmt::Display, |
| 1830 | { |
| 1831 | parser_err!( |
| 1832 | self, |
| 1833 | pos, |
| 1834 | "Expected {}, found {}", |
| 1835 | expected, |
| 1836 | found.display_or("EOF"), |
| 1837 | ) |
| 1838 | } |
| 1839 | |
| 1840 | /// Look for an expected keyword and consume it if it exists |
| 1841 | #[must_use] |
no outgoing calls
no test coverage detected