(&mut self, token: &str)
| 122 | } |
| 123 | |
| 124 | pub fn eat_token(&mut self, token: &str) -> Result<()> { |
| 125 | if self.input.starts_with(token) { |
| 126 | self.input = self.input[token.len()..].trim(); |
| 127 | return Ok(()); |
| 128 | } |
| 129 | eyre::bail!("input `{}` should start with {token}.", self.input) |
| 130 | } |
| 131 | |
| 132 | pub fn is_next_token(&self, token: &str) -> bool { |
| 133 | self.input.starts_with(token) |
no outgoing calls
no test coverage detected