ok

Mini Shell

Direktori : /proc/self/root/lib/python2.7/site-packages/jinja2/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/jinja2/optimizer.pyo

�
,��Qc@sIdZddlmZddlmZd�Zdefd��YZdS(s[
    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.
i����(tnodes(tNodeTransformercCst|�}|j|�S(s^The context hint can be used to perform an static optimization
    based on the context given.(t	Optimizertvisit(tnodetenvironmentt	optimizer((s4/usr/lib/python2.7/site-packages/jinja2/optimizer.pytoptimizesRcBsteZd�Zd�Zd�ZeZZZZZ	Z
ZZZ
ZZZZZZZZZZ[RS(cCs
||_dS(N(R(tselfR((s4/usr/lib/python2.7/site-packages/jinja2/optimizer.pyt__init__ scCs�|jtj�dk	r%|j|�Sy|j|j�j�}Wntjk
ra|j|�SX|rt|j	}n	|j
}g}x$|D]}|j|j|��q�W|S(sEliminate dead code.N(
tfindRtBlocktNonet
generic_visitRttesttas_constt
Impossibletbodytelse_textendt
visit_list(RRtvalRtresult((s4/usr/lib/python2.7/site-packages/jinja2/optimizer.pytvisit_If#s
	
cCsW|j|�}y,tjj|j�d|jd|j�SWntjk
rR|SXdS(sDo constant folding.tlinenoRN(R
RtConsttfrom_untrustedRRRR(RR((s4/usr/lib/python2.7/site-packages/jinja2/optimizer.pytfold6s	(t__name__t
__module__R	RRt	visit_Addt	visit_Subt	visit_Mult	visit_Divtvisit_FloorDivt	visit_Powt	visit_Modt	visit_Andtvisit_Ort	visit_Post	visit_Negt	visit_Nott
visit_Comparet
visit_Getitemt
visit_Getattrt
visit_Calltvisit_Filtert
visit_Testtvisit_CondExpr(((s4/usr/lib/python2.7/site-packages/jinja2/optimizer.pyRs
			
NN(t__doc__tjinja2Rtjinja2.visitorRRR(((s4/usr/lib/python2.7/site-packages/jinja2/optimizer.pyt<module>s	

Zerion Mini Shell 1.0