%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2599/lib/python3/dist-packages/jinja2/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2599/lib/python3/dist-packages/jinja2/__pycache__/optimizer.cpython-38.pyc

U

aG�\��@s8dZddlmZddlmZdd�ZGdd�de�ZdS)	a[
    jinja2.optimizer
    ~~~~~~~~~~~~~~~~

    The jinja optimizer is currently trying to constant fold a few expressions
    and modify the AST in place so that it should be easier to evaluate it.

    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 scoping.

    The solution would be a second syntax tree that has the scoping rules stored.

    :copyright: (c) 2017 by the Jinja Team.
    :license: BSD.
�)�nodes)�NodeTransformercCst|�}|�|�S)z^The context hint can be used to perform an static optimization
    based on the context given.)�	OptimizerZvisit)�node�environmentZ	optimizer�r�2/usr/lib/python3/dist-packages/jinja2/optimizer.py�optimizesr	c@sleZdZdd�Zddd�ZeZZZZZ	Z
ZZZ
ZZZZZZZZZZ[dS)rcCs
||_dS)N)r)�selfrrrr�__init__ szOptimizer.__init__NcCsH|�|�}ztjj|�|�|j|jd�WStjk
rB|YSXdS)zDo constant folding.)�linenorN)Z
generic_visitrZConstZfrom_untrustedZas_constrrZ
Impossible)r
rZeval_ctxrrr�fold#s
�zOptimizer.fold)N)�__name__�
__module__�__qualname__rr
Z	visit_AddZ	visit_SubZ	visit_MulZ	visit_DivZvisit_FloorDivZ	visit_PowZ	visit_ModZ	visit_AndZvisit_OrZ	visit_PosZ	visit_NegZ	visit_NotZ
visit_CompareZ
visit_GetitemZ
visit_GetattrZ
visit_CallZvisit_FilterZ
visit_TestZvisit_CondExprrrrrrs>

�������������rN)�__doc__Zjinja2rZjinja2.visitorrr	rrrrr�<module>s

Zerion Mini Shell 1.0