%PDF- %PDF-
| Direktori : /snap/core/17212/usr/lib/python3/dist-packages/jinja2/__pycache__/ |
| Current File : //snap/core/17212/usr/lib/python3/dist-packages/jinja2/__pycache__/optimizer.cpython-35.pyc |
���S� � @ sL d Z d d l m Z d d l m Z d d � Z Gd d � d e � Z d S) 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) 2010 by the Jinja Team.
:license: BSD.
� )�nodes)�NodeTransformerc C s t | � } | j | � S)z^The context hint can be used to perform an static optimization
based on the context given.)� Optimizer�visit)�node�environmentZ optimizer� r �2/usr/lib/python3/dist-packages/jinja2/optimizer.py�optimize s r
c @ s� e Z d Z d d � Z d d � Z d d � Z e Z Z Z Z Z
Z Z Z
Z Z Z Z Z Z Z Z Z Z Z [ d S)r c C s
| | _ d S)N)r )�selfr r r r �__init__ s zOptimizer.__init__c C s� | j t j � d k r% | j | � Sy | j | j � j � } Wn"