
    hz                     |   S r SSKrSSKrSSKJrJrJrJr  SSK	J
r
  SSKJrJrJrJr  \R                   \\R"                  \\R$                  \\R&                  \0r\R*                  4S\S\S\4S	 jjr\R*                  4S
\R0                  S\S\4S jjr\R*                  \R4                  S4S\S\S\S\S\4
S jjrg)zThe main parsing routine.    N)epydocgooglenumpydocrest)add_attribute_docstrings)	DocstringDocstringStyle
ParseErrorRenderingStyletextstylereturnc                 B   U[         R                  :w  a  [        U   R                  U 5      $ Sn/ n[        R	                  5        H&  n UR                  U 5      nUR                  U5        M(     U(       d  Ue[        US SS9S   $ ! [         a  nUn SnAMT  SnAff = f)zParse the docstring into its components.

:param text: docstring text to parse
:param style: docstring style
:returns: parsed docstring representation
Nc                 ,    [        U R                  5      $ )N)lenmeta)ds    Q/home/james-whalen/.local/lib/python3.13/site-packages/docstring_parser/parser.py<lambda>parse.<locals>.<lambda>.   s    c!&&k    T)keyreverser   )r	   AUTO
_STYLE_MAPparsevaluesappendr
   sorted)r   r   excretsmoduleretexs          r   r   r      s     ###% &&t,,!%CD##%	,,t$C KK & 	$14@CC  	C	s   	B
BBBobjc                     [        U R                  US9n[        R                  " U 5      (       d  [        R                  " U 5      (       a  [        X5        U$ )a  Parse the object's docstring(s) into its components.

The object can be anything that has a ``__doc__`` attribute. In contrast to
the ``parse`` function, ``parse_from_object`` is able to parse attribute
docstrings which are defined in the source code instead of ``__doc__``.

Currently only attribute docstrings defined at class and module levels are
supported. Attribute docstrings defined in ``__init__`` methods are not
supported.

When given a class, only the attribute docstrings of that class are parsed,
not its inherited classes. This is a design decision. Separate calls to
this function should be performed to get attribute docstrings of parent
classes.

:param obj: object from which to parse the docstring(s)
:param style: docstring style
:returns: parsed docstring representation
)r   )r   __doc__inspectisclassismoduler   )r%   r   	docstrings      r   parse_from_objectr,   1   sA    . ckk/Isw//44 0r   z    r+   rendering_styleindentc                 t    [         U[        R                  :X  a  U R                  OU   nUR	                  XUS9$ )zRender a parsed docstring into docstring text.

:param docstring: parsed docstring representation
:param style: docstring style to render
:param indent: the characters used as indentation in the docstring string
:returns: docstring text
)r-   r.   )r   r	   r   r   compose)r+   r   r-   r.   r"   s        r   r0   r0   P   sA      N$7$77	UF >>6   r   )r'   r(   typingTdocstring_parserr   r   r   r   docstring_parser.attrdocr   docstring_parser.commonr   r	   r
   r   RESTGOOGLENUMPYDOCEPYDOCr   r   strr   Anyr,   COMPACTr0    r   r   <module>r>      s       ; ; =  6X6	
 .<-@-@ D DN DY D8 +//	
 B +//&4&<&<	 $ 	
 	r   