Your IP : 3.145.35.234


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/jinja2/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/jinja2/__pycache__/visitor.cpython-311.pyc

�

S�Dg���N�dZddlmZGd�de��ZGd�de��ZdS)zVAPI for traversing the AST nodes. Implemented by the compiler and
meta introspection.
�)�Nodec�$�eZdZdZd�Zd�Zd�ZdS)�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.
    c�B�d|jjz}t||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)�	__class__�__name__�getattr)�self�node�methods   �n/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/jinja2/visitor.py�get_visitorzNodeVisitor.get_visitors%��
�D�N�3�3���t�V�T�*�*�*�c�j�|�|��}|�||g|�Ri|��S|j|g|�Ri|��S)z
Visit a node.)r�
generic_visit)rr�args�kwargs�fs     r�visitzNodeVisitor.visits]�����T�"�"���=��1�T�+�D�+�+�+�F�+�+�+�!�t�!�$�8��8�8�8��8�8�8rc�V�|���D]}|j|g|�Ri|���dS)z9Called if no explicit visitor function exists for a node.N)�iter_child_nodesr)rrrrs    rrzNodeVisitor.generic_visit#sL���)�)�+�+�	.�	.�D��D�J�t�-�d�-�-�-�f�-�-�-�-�	.�	.rN)r	�
__module__�__qualname__�__doc__rrr�rrrrsK������	�	�+�+�+�9�9�9�.�.�.�.�.rrc��eZdZdZd�Zd�ZdS)�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.
    c���|���D]�\}}t|t��rxg}|D]k}t|t��r?|j|g|�Ri|��}|��+t|t��s|�|���V|�|���l||dd�<��t|t��r5|j|g|�Ri|��}|�t||����t|||����|S)N)	�iter_fields�
isinstance�listrr�extend�append�delattr�setattr)	rrrr�field�	old_value�
new_values�value�new_nodes	         rrzNodeTransformer.generic_visit4s6�� $� 0� 0� 2� 2�	3�	3��E�9��)�T�*�*�
3��
�&�-�-�E�!�%��.�.�%� *��
�5� B�4� B� B� B�6� B� B�� �=�$�!+�E�4�!8�!8�%�&�-�-�e�4�4�4�$��%�%�e�,�,�,�,�)�	�!�!�!����I�t�,�,�
3�%�4�:�i�A�$�A�A�A�&�A�A���#��D�%�(�(�(�(��D�%��2�2�2���rc�X�|j|g|�Ri|��}t|t��s|g}|S)z{As transformers may return lists in some places this method
        can be used to enforce a list as return value.
        )rr!r")rrrr�rvs     r�
visit_listzNodeTransformer.visit_listJsC���T�Z��
.�t�
.�
.�
.�v�
.�
.���"�d�#�#�	���B��	rN)r	rrrrr.rrrrr)s<�����������,����rrN)r�nodesr�objectrrrrr�<module>r1s�����������.�.�.�.�.�&�.�.�.�B(�(�(�(�(�k�(�(�(�(�(r

?>