
    cp	                         d dl Z d dlZd dl T d dlmZ 	 d dl mZ n<# e$ r4 ej        dk     sJ ed ed          de	de
dededed	 ed
          diZY nw xY wddZd Z G d de j                  Zd Zd ZdS )    N)*)
fscommands)_const_node_type_names      NameConstantNumStrBytes.Ellipsis<string>c                    t          | t                    rt          j        |           } d| v r*|                     dd                              dd          } |                     d          s| dz  } 	 t          j        | g|R d|i|S # t          t          f$ r7}t                      }d|_        ||_        t          |          |_        |d }~ww xY w)N   s   
   
filename   )
isinstancestrr   unicode_to_file_datareplaceendswithastparse	TypeError
ValueErrorSyntaxErrorlinenor   msg)sourcer   argskwargseerrors         -lib/python3.11/site-packages/rope/base/ast.pyr   r      s    &# 9088 F//77uEE??5!! %yDTDDD(DVDDDz"   !FF	s   3B
 
C2CCc                 r     ||           }|s't          j        |           D ]}t          ||           dS dS )a  
    Pre-order depth-first traversal of AST nodes, calling `callback(node)` for
    each node visited.

    When each node is visited, `callback(node)` will be called with the visited
    `node`, then its children node will be visited.

    If `callback(node)` returns `True` for a node, then the descendants of that
    node will not be visited.

    See _ResultChecker._find_node for an example.
    N)r   iter_child_nodescall_for_nodes)nodecallbackresultchilds       r%   r(   r(   )   sZ     Xd^^F ,)$// 	, 	,E5(++++, ,	, 	,    c                       e Zd Zd ZdS )RopeNodeVisitorc                 b    d|j         j        z   }t          | || j                  } ||          S )zMModified from ast.NodeVisitor to match rope's existing Visitor implementation_)	__class____name__getattrgeneric_visit)selfr)   methodvisitors       r%   visitzRopeNodeVisitor.visit=   s3    t~..$(:;;wt}}r-   N)r3   
__module____qualname__r9    r-   r%   r/   r/   <   s#            r-   r/   c                     t           j        dk    s
J d            t          | t          j                  sJ t
          t          | j                           S )zGet pre-3.8 ast node namer   z2This should only be called in Python 3.8 and above)sysversion_infor   r   Constantr   typevaluer)   s    r%   get_const_subtype_namerD   D   sN     v%[['[[[[dCL)))))!$tz"2"233r-   c                 l    t          | t          j                  rt          |           n| j        j        S )N)r   r   r@   rD   r2   r3   rC   s    r%   get_node_type_namerF   M   s3     dCL))	%t$$$^$r-   )r   )r   r>   	rope.baser   r   ImportErrorr?   boolrA   intfloatcomplexr   bytesr   r(   NodeVisitorr/   rD   rF   r<   r-   r%   <module>rO      s;   



 



                *******   f$$$$nT

NUuUwS		:	   ", , ,&    co   4 4 4    s    6AA