Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/jinja2/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/jinja2/__pycache__/optimizer.cpython-311.pyc

�

�܋fr���dZddlZddlmZddlmZejrddlm	Z	dej
dd	d
ej
fd�ZGd�d
e��ZdS)a�The optimizer tries to constant fold expressions and modify the AST
in place so that it should be faster to evaluate.

Because the AST does not contain all the scoping information and the
compiler has to find that out, we cannot do all the optimizations we
want. For example, loop unrolling doesn't work because unrolled loops
would have a different scope. The solution would be a second syntax tree
that stored the scoping rules.
�N�)�nodes)�NodeTransformer)�Environment�node�environmentr�returnc��t|��}tjtj|�|����S)z^The context hint can be used to perform an static optimization
    based on the context given.)�	Optimizer�t�castr�Node�visit)rr�	optimizers   �G/opt/cloudlinux/venv/lib64/python3.11/site-packages/jinja2/optimizer.py�optimizers1���+�&�&�I��6�%�*�i�o�o�d�3�3�4�4�4�c�`��eZdZd
d�Zdejdejdejdejf�fd	�Z�xZ	S)rr�t.Optional[Environment]r	Nc��||_dS)N)r)�selfrs  r�__init__zOptimizer.__init__s��&����rr�args�kwargsc�4��t��j|g|�Ri|��}t|tj��r_	tj�|�|r|dnd��|j|j	���S#tj
$rYnwxYw|S)Nr)�linenor)�super�
generic_visit�
isinstancer�Expr�Const�from_untrusted�as_constrr�
Impossible)rrrr�	__class__s    �rrzOptimizer.generic_visits����%�u�w�w�$�T�;�D�;�;�;�F�;�;���d�E�J�'�'�	�
��{�1�1��M�M�T�";�$�q�'�'�t�<�<��;� $� 0�2�����
�#�
�
�
���
�����s�AB�B�B)rrr	N)
�__name__�
__module__�__qualname__rrrr�Anyr�
__classcell__)r%s@rrrsy�������'�'�'�'���J��'(�u��89���	�����������rr)
�__doc__�typingr�r�visitorr�
TYPE_CHECKINGrrrrr�rr�<module>r1s���������������$�$�$�$�$�$��?�)�(�(�(�(�(�(�5�5�:�5�M�5�e�j�5�5�5�5�����������r

Hacked By AnonymousFox1.0, Coded By AnonymousFox