
    }c                        d Z ddlZddlZddlZddlmZmZmZ ddlm	Z	 ddl
mZ  ej        e	j        d                   Zdedeeeeef         f         fd	Zdedeeef         fd
Zddededee         fdZdedee         fdZdS )z#Utilities for docstring processing.    N)DictListTuple)Body)RemovedInSphinx60Warningfield_markersreturnc                    d}i }g }| s| |fS t          |           D ]}|                                dk    rd}|                    |           3t                              |          }|r|s|                                dd                             dd          d         }|                    d          rN|dd                                         }||                                d                                         ||<   |                    |           d	}|                    |           d
	                    |          |fS )z,Separate docstring into metadata and others.F    N:r   zmeta    T
)
prepare_docstringstripappendfield_list_item_rematchgroupsplit
startswithendjoin)r	   in_other_elementmetadatalineslinematched
field_namenames           6lib/python3.11/site-packages/sphinx/util/docstrings.pyseparate_metadatar#      sW   !HE ({!!$$ # #::<<2 	#$LL(..t44G 	#/ 	#$]]__QRR066sA>>qA
((11 '%abb>//11D%)'++--..%9%?%?%A%AHTNNLL&&&&#' T""""99UX%%    c                 b    t          j        dt          d           t          |           \  }}|S )Nz!extract_metadata() is deprecated.   )
stacklevel)warningswarnr   r#   )r	   	docstringr   s      r"   extract_metadatar+   ,   s<    M5*q: : : : ,A..IxOr$      tabsizec                 ~   |                      |                                          }t          j        }|dd         D ]G}t	          |                                          }|r"t	          |          |z
  }t          ||          }Ht	          |          r|d                                         |d<   |t          j        k     r3t          dt	          |                    D ]}||         |d         ||<   |r'|d         s|                    d           |r|d         |r|d         r|	                    d           |S )aw  Convert a docstring into lines of parseable reST.  Remove common leading
    indentation, where the indentation of the first line is ignored.

    Return the docstring as a list of lines usable for inserting into a docutils
    ViewList (used as argument of nested_parse().)  An empty line is added to
    act as a separator between this docstring and following content.
    r   Nr   r   )

expandtabs
splitlinessysmaxsizelenlstripminrangepopr   )r	   r-   r   marginr   contentindentis           r"   r   r   4   sJ    LL!!,,..E[Fabb	 ) )dkkmm$$ 	)YY(F((F
5zz %8??$$a )q#e**%% 	) 	)AQx(E!HH
 a 		!  a   r RLr$   c                 J   g }d |                                                                  D             }|D ]N}|                    d          r7|dd         }|r|d         dk    r
|dd         }|                    |           O|r|d         r|                    d	           |S )
zExtract documentation comment lines (starting with #:) and return them
    as a list of lines.  Returns an empty list if there is no documentation.
    c                 6    g | ]}|                                 S  )r   ).0r   s     r"   
<listcomp>z&prepare_commentdoc.<locals>.<listcomp>X   s     BBBdTZZ\\BBBr$   z#:r&   Nr    r   r/   r   )r0   r1   r   r   )r	   resultr   r   s       r"   prepare_commentdocrD   S   s     FBBallnn&?&?&A&ABBBE    ??4   	 8D  Q3  ABBxMM$ &* bMr$   )r,   )__doc__rer2   r(   typingr   r   r   docutils.parsers.rst.statesr   sphinx.deprecationr   compilepatternsr   strr#   r+   intr   rD   r?   r$   r"   <module>rN      sA   ) ) 				 



  $ $ $ $ $ $ $ $ $ $ , , , , , , 7 7 7 7 7 7RZn =>> & &sDcN':!; & & & &: S#X      s 49    ># $s)      r$   