Returns the next two non-trivia tokens without consuming it. Use [`peek`] to only get the next token. [`peek`]: TokenSource::peek
(&mut self)
| 149 | /// |
| 150 | /// [`peek`]: TokenSource::peek |
| 151 | pub(crate) fn peek2(&mut self) -> (TokenKind, TokenKind) { |
| 152 | let checkpoint = self.lexer.checkpoint(); |
| 153 | let first = self.next_non_trivia_token(); |
| 154 | let second = self.next_non_trivia_token(); |
| 155 | self.lexer.rewind(checkpoint); |
| 156 | (first, second) |
| 157 | } |
| 158 | |
| 159 | /// Bumps the token source to the next non-trivia token. |
| 160 | /// |
nothing calls this directly
no test coverage detected