⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.30
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
jinja2
/
__pycache__
/
View File Name :
optimizer.cpython-310.pyc
o :`r @ sd d Z ddlZddlmZ ddlmZ ejrddlm Z dej dd d ej fddZG d d deZdS )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)Environmentnodeenvironmentr returnc C s t |}ttj|| S )z^The context hint can be used to perform an static optimization based on the context given.) Optimizertcastr Nodevisit)r r optimizer r 2/usr/lib/python3/dist-packages/jinja2/optimizer.pyoptimize s r c s@ e Zd ZdddZdejdejd ejdejf fd dZ Z S ) r r t.Optional[Environment]r Nc C s || _ d S )N)r )selfr r r r __init__ s zOptimizer.__init__r argskwargsc sl t j|g|R i |}t|tjr4ztjj||r|d nd |j| j dW S tj y3 Y |S w |S )Nr )linenor )super generic_visit isinstancer ExprConstfrom_untrustedas_constr r Impossible)r r r r __class__r r r s zOptimizer.generic_visit)r r r N) __name__ __module____qualname__r r r r Anyr __classcell__r r r r r s r ) __doc__typingr r visitorr TYPE_CHECKINGr r r r r r r r r
s