%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/jinja2/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/jinja2/__pycache__/visitor.cpython-312.pyc

�

V�fb�
���dZddlZddlmZej
rddlZGd�dej�Z	Gd�d�Z
Gd	�d
e
�Zy)zVAPI for traversing the AST nodes. Implemented by the compiler and
meta introspection.
�N�)�Nodec�`�eZdZdedej
dej
dej
fd�Zy)�
VisitCallable�node�args�kwargs�returnc��y�N�)�selfrrr	s    �0/usr/lib/python3/dist-packages/jinja2/visitor.py�__call__zVisitCallable.__call__s���N)�__name__�
__module__�__qualname__r�t�Anyrr
rrrrs/��	��	�a�e�e�	�q�u�u�	����	rrc���eZdZdZdeddfd�Zdedejdejdejfd�Zdedejdejdejfd	�Z	y
)�NodeVisitoraWalks the abstract syntax tree and call visitor functions for every
    node found.  The visitor functions may return values which will be
    forwarded by the `visit` method.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `get_visitor` function.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.
    rr
zt.Optional[VisitCallable]c�H�t|dt|�j��d�S)z�Return the visitor function for this node or `None` if no visitor
        exists for this node.  In that case the generic visit function is
        used instead.
        �visit_N)�getattr�typer)rrs  r�get_visitorzNodeVisitor.get_visitors%��
�t�v�d�4�j�&9�&9�%:�;�T�B�Brrr	c�l�|j|�}|�||g|��i|��S|j|g|��i|��S)z
Visit a node.)r�
generic_visit)rrrr	�fs     r�visitzNodeVisitor.visit#sI�����T�"���=��T�+�D�+�F�+�+�!�t�!�!�$�8��8��8�8rc�Z�|j�D]}|j|g|��i|���y)z9Called if no explicit visitor function exists for a node.N)�iter_child_nodesr!)rrrr	�
child_nodes     rrzNodeVisitor.generic_visit,s2���/�/�1�	4�J��D�J�J�z�3�D�3�F�3�	4rN)
rrr�__doc__rrrrr!rr
rrrrsx��	�C��C�)D�C�9�$�9�q�u�u�9����9�!�%�%�9�4�$�4�q�u�u�4����4�!�%�%�4rrc	��eZdZdZdedejdejdefd�Zdedejdejdejefd�Z	y)	�NodeTransformera�Walks the abstract syntax tree and allows modifications of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor functions to replace or remove the old node.  If the return
    value of the visitor function is `None` the node will be removed
    from the previous location otherwise it's replaced with the return
    value.  The return value may be the original node in which case no
    replacement takes place.
    rrr	r
c��|j�D]�\}}t|t�rkg}|D]^}t|t�r;|j|g|��i|��}|��,t|t�s|j|��N|j
|��`||dd��t|t�s��|j|g|��i|��}|�
t||���t|||���|Sr)	�iter_fields�
isinstance�listrr!�extend�append�delattr�setattr)	rrrr	�field�	old_value�
new_values�value�new_nodes	         rrzNodeTransformer.generic_visit=s��� $� 0� 0� 2�	3��E�9��)�T�*��
�&�-�E�!�%��.� *��
�
�5� B�4� B�6� B�� �=�$�!+�E�4�!8�&�-�-�e�4�$��%�%�e�,�-� *�	�!���I�t�,�%�4�:�:�i�A�$�A�&�A���#��D�%�(��D�%��2�%	3�&�rc�X�|j|g|��i|��}t|t�s|gS|S)z{As transformers may return lists in some places this method
        can be used to enforce a list as return value.
        )r!r*r+)rrrr	�rvs     r�
visit_listzNodeTransformer.visit_listSs4���T�Z�Z��
.�t�
.�v�
.���"�d�#��4�K��	rN)
rrrr%rrrr�Listr7r
rrr'r'2sa����$��q�u�u������$��,	�t�	�A�E�E�	�Q�U�U�	�q�v�v�d�|�	rr')r%�typingr�nodesr�
TYPE_CHECKING�typing_extensions�te�Protocolrrr'r
rr�<module>r?sC������?�?�"������
4�4�D*�k�*r

Zerion Mini Shell 1.0