
    iZ                        S SK Jr  S SKJr  S SKJr  S SKJr  \(       a  S SKJ	r	  SS jr
SS jrSS jrSS	 jrSS
 jrSS jrSS jrSS jrSS jrg)    )annotations)AST)TYPE_CHECKING)LastNodeError)Iteratorc                J    U R                   R                  R                  5       $ )zbReturn the kind of an AST node.

Parameters:
    node: The AST node.

Returns:
    The node kind.
)	__class____name__lowernodes    [/home/james-whalen/.local/lib/python3.13/site-packages/griffe/_internal/agents/nodes/ast.pyast_kindr      s     >>""((**    c              #  0  #    U R                    Hq  n [        X5      n[        U[        5      (       a  Xl        Uv   M0  [        U[        5      (       d  MG  U H$  n[        U[        5      (       d  M  Xl        Uv   M&     Ms     g! [         a     M  f = f7f)ziReturn the children of an AST node.

Parameters:
    node: The AST node.

Yields:
    The node children.
N)_fieldsgetattrAttributeError
isinstancer   parentlist)r   
field_namefieldchilds       r   ast_childrenr      s~      ll
	D-E eS!!LKt$$eS))#'LK  #  		s3   BB4BB2B
BBBBc              #  X   #    [        U R                  5       H  nXLa  Uv   M    g   g7f)zReturn the previous siblings of this node, starting from the closest.

Parameters:
    node: The AST node.

Yields:
    The previous siblings.
Nr   r   )r   siblings     r   ast_previous_siblingsr   2   s(       ,M	 -s   (*c              #  l   #    [        U R                  5      nU H	  nX L d  M	    O   U Sh  vN   g N7f)zReturn the next siblings of this node, starting from the closest.

Parameters:
    node: The AST node.

Yields:
    The next siblings.
Nr   r   siblingsr   s      r   ast_next_siblingsr#   B   s2      DKK(H?  s   4	424c              #  t   #    [        U R                  5      nU H  nX La  Uv   M    O   U Sh  vN   g N7f)zbReturn the siblings of this node.

Parameters:
    node: The AST node.

Yields:
    The siblings.
Nr   r!   s      r   ast_siblingsr%   R   s8      DKK(HM	 
 s   .868c                V     [        U 5      Gt pU$ ! [         a    [        S5      Sef = f)zReturn the previous sibling of this node.

Parameters:
    node: The AST node.

Raises:
    LastNodeError: When the node does not have previous siblings.

Returns:
    The sibling.
zthere is no previous nodeN)r   
ValueErrorr   )r   _lasts      r   ast_previousr*   d   s<    C(. K  C78dBCs    (c                `     [        [        U 5      5      $ ! [         a    [        S5      Sef = f)zReturn the next sibling of this node.

Parameters:
    node: The AST node.

Raises:
    LastNodeError: When the node does not have next siblings.

Returns:
    The sibling.
zthere is no next nodeN)nextr#   StopIterationr   r   s    r   ast_nextr.   w   s5    ?%d+,, ?34$>?s    -c                h     [        [        U 5      5      $ ! [         a  n[        S5      UeSnAff = f)zReturn the first child of this node.

Parameters:
    node: The AST node.

Raises:
    LastNodeError: When the node does not have children.

Returns:
    The child.
there are no children nodeN)r,   r   r-   r   )r   errors     r   ast_first_childr2      s8    EL&'' E89uDEs    
1,1c                ^     [        U 5      Gt pU$ ! [         a  n[        S5      UeSnAff = f)zReturn the lasts child of this node.

Parameters:
    node: The AST node.

Raises:
    LastNodeError: When the node does not have children.

Returns:
    The child.
r0   N)r   r'   r   )r   r(   r)   r1   s       r   ast_last_childr4      s=    E% K  E89uDEs    
,',N)r   r   returnstr)r   r   r5   zIterator[AST])r   r   r5   r   )
__future__r   astr   typingr   griffe._internal.exceptionsr   collections.abcr   r   r   r   r#   r%   r*   r.   r2   r4    r   r   <module>r=      sG    #    5(	+ 0  $&?$E$r   