Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
jinja2
/
__pycache__
/
File Content:
optimizer.cpython-37.pyc
B �:�`r � @ s` d Z ddlZddlmZ ddlmZ ejr6ddlm Z ej dej d�d d �ZG dd� de�ZdS ) 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)�Environmentr )�node�environment�returnc C s t |�}t�tj|�| ��S )z^The context hint can be used to perform an static optimization based on the context given.)� Optimizer�t�castr �NodeZvisit)r r Z optimizer� r �A/opt/alt/python37/lib/python3.7/site-packages/jinja2/optimizer.py�optimize s r c s@ e Zd Zddd�dd�Zejejejejd�� fdd�Z� Z S ) r zt.Optional[Environment]N)r r c C s || _ d S )N)r )�selfr r r r �__init__ s zOptimizer.__init__)r �args�kwargsr c sd t � j|f|�|�}t|tj�r`y(tjj|�|r8|d nd �|j| j d�S tj k r^ Y nX |S )Nr )�linenor )�super� generic_visit� isinstancer ZExprZConstZfrom_untrustedZas_constr r Z Impossible)r r r r )� __class__r r r s zOptimizer.generic_visit) �__name__� __module__�__qualname__r r r r ZAnyr � __classcell__r r )r r r s r ) �__doc__�typingr � r Zvisitorr Z TYPE_CHECKINGr r r r r r r r r �<module> s
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
__init__.cpython-37.opt-1.pyc
1884 bytes
0644
__init__.cpython-37.pyc
1884 bytes
0644
_identifier.cpython-37.opt-1.pyc
1869 bytes
0644
_identifier.cpython-37.pyc
1869 bytes
0644
async_utils.cpython-37.opt-1.pyc
2446 bytes
0644
async_utils.cpython-37.pyc
2446 bytes
0644
bccache.cpython-37.opt-1.pyc
13109 bytes
0644
bccache.cpython-37.pyc
13109 bytes
0644
compiler.cpython-37.opt-1.pyc
54306 bytes
0644
compiler.cpython-37.pyc
54363 bytes
0644
constants.cpython-37.opt-1.pyc
1515 bytes
0644
constants.cpython-37.pyc
1515 bytes
0644
debug.cpython-37.opt-1.pyc
5329 bytes
0644
debug.cpython-37.pyc
5329 bytes
0644
defaults.cpython-37.opt-1.pyc
1313 bytes
0644
defaults.cpython-37.pyc
1313 bytes
0644
environment.cpython-37.opt-1.pyc
52011 bytes
0644
environment.cpython-37.pyc
52458 bytes
0644
exceptions.cpython-37.opt-1.pyc
5552 bytes
0644
exceptions.cpython-37.pyc
5552 bytes
0644
ext.cpython-37.opt-1.pyc
26241 bytes
0644
ext.cpython-37.pyc
26241 bytes
0644
filters.cpython-37.opt-1.pyc
49626 bytes
0644
filters.cpython-37.pyc
49761 bytes
0644
idtracking.cpython-37.opt-1.pyc
11108 bytes
0644
idtracking.cpython-37.pyc
11150 bytes
0644
lexer.cpython-37.opt-1.pyc
19906 bytes
0644
lexer.cpython-37.pyc
20031 bytes
0644
loaders.cpython-37.opt-1.pyc
20081 bytes
0644
loaders.cpython-37.pyc
20227 bytes
0644
meta.cpython-37.opt-1.pyc
3767 bytes
0644
meta.cpython-37.pyc
3767 bytes
0644
nativetypes.cpython-37.opt-1.pyc
4820 bytes
0644
nativetypes.cpython-37.pyc
4820 bytes
0644
nodes.cpython-37.opt-1.pyc
41258 bytes
0644
nodes.cpython-37.pyc
41392 bytes
0644
optimizer.cpython-37.opt-1.pyc
1880 bytes
0644
optimizer.cpython-37.pyc
1880 bytes
0644
parser.cpython-37.opt-1.pyc
27509 bytes
0644
parser.cpython-37.pyc
27509 bytes
0644
runtime.cpython-37.opt-1.pyc
32924 bytes
0644
runtime.cpython-37.pyc
32951 bytes
0644
sandbox.cpython-37.opt-1.pyc
11793 bytes
0644
sandbox.cpython-37.pyc
11793 bytes
0644
tests.cpython-37.opt-1.pyc
6501 bytes
0644
tests.cpython-37.pyc
6501 bytes
0644
utils.cpython-37.opt-1.pyc
27173 bytes
0644
utils.cpython-37.pyc
27173 bytes
0644
visitor.cpython-37.opt-1.pyc
3858 bytes
0644
visitor.cpython-37.pyc
3858 bytes
0644
N4ST4R_ID | Naxtarrr