Peeks the upcoming token. It is OK to call this function several times on the same token before extracting it from the lexer.
(&mut self)
| 759 | /// It is OK to call this function several times on the same token before extracting it from |
| 760 | /// the lexer. |
| 761 | pub fn peek(&mut self) -> Result<&TokenSpan> { |
| 762 | if self.peeked.is_none() { |
| 763 | let span = self.read()?; |
| 764 | self.peeked.replace(span); |
| 765 | } |
| 766 | Ok(self.peeked.as_ref().unwrap()) |
| 767 | } |
| 768 | |
| 769 | /// Reads the next token. |
| 770 | /// |
no test coverage detected