code: def expect_optional_token(lexer: Lexer, kind: TokenKind) -> Optional[Token]:
      
      token = lexer.token
      if token.kind == kind:
          lexer.advance()
          return token
  
      return None
docs: Expect the next token optionally to be of the given kind.
  
      If the next token is of the given kind, return that token after advancing the lexer.
      Otherwise, do not change the parser state and return None.