fn try_next(&mut self, kind: TokenKind) -> Result<Option<Token>, Error> {
      let next_token = self.lexer.peek_token()?;
      Ok(if next_token.kind == kind {
         Some(self.lexer.next_token()?)
      } else {
         None
      })
   }
/// If the next token's kind is equal to `kind`, advances to the next token and returns the
/// token. Otherwise returns `None`.
If the next token's kind is equal to `kind`, advances to the next token and returns the
token. Otherwise returns `None`.
If the next token ' s kind is equal to ` kind ` advances to the next token and returns the token . Otherwise returns ` None ` .
fn try_next(&mut self, kind: TokenKind) -> Result<Option<Token>, Error> {
      let next_token = self.lexer.peek_token()?;
      Ok(if next_token.kind == kind {
         Some(self.lexer.next_token()?)
      } else {
         None
      })
   }
fn try_next ( & mut self , kind : TokenKind ) -> Result < Option < Token > , Error > { let next_token = self . lexer . peek_token ( ) ? ; Ok ( if next_token . kind == kind { Some ( self . lexer . next_token ( ) ? ) } else { None } ) }
If the next token's kind is equal to `kind`, advances to the next token and returns the
token.
If the next token ' s kind is equal to ` kind ` advances to the next token and returns the token .
&mut self
kind
TokenKind