Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/jinja2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/jinja2/__pycache__/compiler.cpython-310.pyc
o

��gz�@s�dZddlZddlmZddlmZddlmZddl	m
Z
ddlmZ
ddlmZdd	lmZd
dlmZd
dlmZd
d
lmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlm Z d
dl!m"Z"ej#r�ddl$Z%d
dl&m'Z'ej(dej)dej*fd�Z+dddddd d!d"d#�Z,d$e+d%e+fd&d'�Z-d(e.d%ej)d)ej/d*gdffd+d,�Z0d(e.d%ej)d)ej1d*gdffd-d.�Z2		/	0dNd1ej3d2d3d4ej4e.d5ej4e.d6ej4ej5d7e6d8e6d%ej4e.fd9d:�Z7d;ej*d%e6fd<d=�Z8d>ej9ej:d?ej9e.d%ej;e.fd@dA�Z<GdBdC�dC�Z=GdDd*�d*�Z>GdEdF�dFe?�Z@GdGdH�dHe"�ZAGdIdJ�dJe"�ZBGdKdL�dLeC�ZDGdMd)�d)e"�ZEdS)Oz0Compiles nodes from the parser into Python code.�N)�contextmanager)�update_wrapper)�StringIO)�chain)�	iskeyword)�escape)�Markup�)�nodes)�TemplateAssertionError)�Symbols)�VAR_LOAD_ALIAS)�VAR_LOAD_PARAMETER)�VAR_LOAD_RESOLVE)�VAR_LOAD_UNDEFINED)�EvalContext)�	Optimizer)�_PassArg)�concat)�NodeVisitor)�Environment�F.)�boundz==z!=�>z>=�<z<=�inznot in)�eq�ne�gt�gteq�lt�lteqr�notin�f�returnc
s:dddtjdddtjdtjf
�fdd	�}tt�t|���S)
N�self�
CodeGenerator�node�frame�Frame�kwargsr$csJ|jdur|jjs|j�||j�}||kr|�||�S�|||fi|��S�N)�	optimizer�eval_ctx�volatile�visit)r%r'r(r*�new_node�r#��1/usr/lib/python3/dist-packages/jinja2/compiler.py�new_func,s
zoptimizeconst.<locals>.new_func)r
�Expr�t�Anyr�castr)r#r4r2r1r3�
optimizeconst+s�����r9�opr&r)c	�(tdddtjdtddf�fdd��}|S)Nr%r&r'r(r$cs�|jjr'�|jjvr'|�d��d��|�|j|�|�d�|�|j|�n|�d�|�|j|�|�d��d��|�|j|�|�d�dS)Nz environment.call_binop(context, �, �(� �))�environment�	sandboxed�intercepted_binops�writer/�left�right�r%r'r(�r:r2r3�visitor<s�

z_make_binop.<locals>.visitor)r9r
�BinExprr)�r:rHr2rGr3�_make_binop;s"rKc	r;)Nr%r&r'r(r$cs`|jjr�|jjvr|�d��d��|�|j|�n|�d��|�|j|�|�d�dS)Nzenvironment.call_unop(context, r<r=r?)r@rA�intercepted_unopsrCr/r'rFrGr2r3rHTs�z_make_unop.<locals>.visitor)r9r
�	UnaryExprr)rJr2rGr3�
_make_unopQs"
rNFTr'r@r�name�filename�stream�
defer_init�	optimizedcCsHt|tj�s
td��|�||||||�}|�|�|dur"|j��SdS)z+Generate the python source for a node tree.z Can't compile non template nodesN)�
isinstancer
�Template�	TypeError�code_generator_classr/rQ�getvalue)r'r@rOrPrQrRrS�	generatorr2r2r3�generatees
�

rZ�valuecCs�|dus|tus|turdSt|�ttttttt	hvrdSt|�t
ttt
hvr0tdd�|D��St|�turAtdd�|��D��SdS)z)Does the node have a safe representation?NTcss�|]}t|�VqdSr+��
has_safe_repr)�.0�vr2r2r3�	<genexpr>�s�z has_safe_repr.<locals>.<genexpr>css$�|]
\}}t|�o
t|�VqdSr+r\�r^�kr_r2r2r3r`�s�"F)�NotImplemented�Ellipsis�type�bool�int�float�complex�range�strr�tuple�list�set�	frozenset�all�dict�items�r[r2r2r3r]}sr]r
�namescCs<t|�}z|D]}|�|�qW|jStyY|jSw)z�Check if the names passed are accessed undeclared.  The return value
    is a set of all the undeclared names from the sequence of names found.
    )�UndeclaredNameVisitorr/�VisitorExit�
undeclared)r
rtrHr'r2r2r3�find_undeclared�s���rxc@s,eZdZdejejejfddfdd�ZdS)�MacroRefr'r$NcCs||_d|_d|_d|_dS�NF)r'�accesses_caller�accesses_kwargs�accesses_varargs�r%r'r2r2r3�__init__�s
zMacroRef.__init__)	�__name__�
__module__�__qualname__r6�Unionr
�Macro�	CallBlockrr2r2r2r3ry�s$ryc	@sheZdZdZ		ddedejddejeddfdd�Zdd	d
�Z	dde
ddfd
d�Zddd�Ze	Z
dS)r)z&Holds compile time information for us.Nr-�parent�levelr$cCs~||_||_|durt|d�|_d|_d|_d|_nt|j|d�|_|j|_|j|_|j|_d|_d|_d|_	d|_
d|_dS)N�r�F)r-r�r�symbols�require_output_check�buffer�block�toplevel�	rootlevel�
loop_frame�block_frame�
soft_frame)r%r-r�r�r2r2r3r�s 
zFrame.__init__cCs2t�tt�|j��}|j�|j�|j�	�|_|S)z!Create a copy of the current one.)
r6r8r)�object�__new__�	__class__�__dict__�updater��copy�r%�rvr2r2r3r��sz
Frame.copyF�isolatedcCs&|r
t|j|jjdd�St|j|�S)zReturn an inner frame.r	r�)r)r-r�r�)r%r�r2r2r3�inner�szFrame.innercCs|��}d|_d|_|S)a&Return a soft frame.  A soft frame may not be modified as
        standalone thing as it shares the resources with the frame it
        was created of, but it's not a rootlevel frame any longer.

        This is only used to implement if-statements and conditional
        expressions.
        FT)r�r�r�r�r2r2r3�soft�sz
Frame.soft)NN)r$r)�F)r�r�r��__doc__rr6�Optionalrgrr�rfr�r��__copy__r2r2r2r3r)�s"����
�
3

c@�eZdZdZdS)rvz?Exception used by the `UndeclaredNameVisitor` to signal a stop.N�r�r�r�r�r2r2r2r3rv��rvc@sVeZdZdZd
dd�Zdejddfdd�Zdejddfd	d
�Z	dej
ddfdd�ZdS)�DependencyFinderVisitorz.A visitor that collects filter and test calls.r$NcCst�|_t�|_dSr+)rn�filters�tests�r%r2r2r3r�sz DependencyFinderVisitor.__init__r'cC�|�|�|j�|j�dSr+)�
generic_visitr��addrOr~r2r2r3�visit_Filter�
z$DependencyFinderVisitor.visit_FiltercCr�r+)r�r�r�rOr~r2r2r3�
visit_Testr�z"DependencyFinderVisitor.visit_TestcC�dS)zStop visiting at blocks.Nr2r~r2r2r3�visit_Block�z#DependencyFinderVisitor.visit_Block�r$N)r�r�r�r�rr
�Filterr��Testr��Blockr�r2r2r2r3r��s
r�c@sPeZdZdZdejeddfdd�Zdej	ddfdd	�Z
dejddfd
d�ZdS)ruz�A visitor that checks if a name is accessed without being
    declared.  This is different from the frame visitor as it will
    not stop at closure frames.
    rtr$NcCst|�|_t�|_dSr+)rnrtrw)r%rtr2r2r3rs
zUndeclaredNameVisitor.__init__r'cCsL|jdkr|j|jvr|j�|j�|j|jkrt��dS|j�|j�dS)N�load)�ctxrOrtrwr�rv�discardr~r2r2r3�
visit_Names�z UndeclaredNameVisitor.visit_NamecCr�)zStop visiting a blocks.Nr2r~r2r2r3r�!r�z!UndeclaredNameVisitor.visit_Block)
r�r�r�r�r6�Iterablerkrr
�Namer�r�r�r2r2r2r3rus
ruc@r�)�CompilerExitz�Raised if the compiler encountered a situation where it just
    doesn't make sense to further process the code.  Any block that
    raises such an exception is not further processed.
    Nr�r2r2r2r3r�%r�r�c@s�	eZdZU			d�dddejedejedejejd	ed
eddfdd
�Ze	defdd��Z
dededdfdd�Zdefdd�Z
deddfdd�Z	d�dededdfdd�Zd�dd�Zd�d eddfd!d"�Zd�ded#ejejddfd$d%�Zdeddfd&d'�Z	d�d(eded#ejejddfd)d*�Zd+ejejdeddfd,d-�Zd.eddfd/d0�Z	1d�d.ed#ejejd2eddfd3d4�Zd�d#ejejd2eddfd5d6�Z	d�d#ejejejej fded7ejej!eej"fddfd8d9�Z#d+ejejddfd:d;�Z$deddfd<d=�Z%d�ded>eddfd?d@�Z&d�dCedDedefdEdF�Z'dedefdGdH�Z(d#ejej)ej*fdedej+ee,ffdIdJ�Z-dKe,deddfdLdM�Z.d#ejdefdNdO�Z/dedefdPdQ�Z0d�dRdS�Z1deddfdTdU�Z2d�dVdW�Z3dXeddfdYdZ�Z4dXeddfd[d\�Z5d�d]d^�Z6defd_d`�Z7defdadb�Z8dedefdcdd�Z9dXedefdedf�Z:d�dgdh�Z;deddfdidj�Z<	d�d#ej=dejeddfdkdl�Z>d#ej?deddfdmdn�Z@d#ejAdeddfdodp�ZBd#ejCdeddfdqdr�ZDd#ejejEejFfdeddfdsdt�ZGd#ejEdeddfdudv�ZHd#ejFdeddfdwdx�ZId#ejJdeddfdydz�ZKd#ejLdeddfd{d|�ZMd#ej)deddfd}d~�ZNd#ej*deddfdd��ZOd#ejPdeddfd�d��ZQd#ejRdeddfd�d��ZSd#ejTdeddfd�d��ZUGd�d��d�ejV�ZWeXd�ej"dej"fd�d���ZYdZZejeWe[d�<deWfd�d��Z\d�ejej"defd�d��Z]d#ej^ded�eWdefd�d��Z_d#ej^ded�eWddfd�d��Z`d#ej^ded�eWddfd�d��Zad#ejbdeddfd�d��Zcd#ejddeddfd�d��Zed#ejfdeddfd�d��Zgd#ejhdeddfd�d��Zid#ejjdeddfd�d��Zkd#ejldeddfd�d��Zmd#ejndeddfd�d��Zod#ej+deddfd�d��Zpd#ejqdeddfd�d��Zrd#ejsdeddfd�d��Zteud��Zveud��Zweud��Zxeud��Zyeud��Zzeud��Z{eud��Z|eud��Z}eud��Z~ed��Z�ed��Z�ed��Z�e�d#ej�deddfd�d���Z�e�d#ej�deddfd�d���Z�d#ej�deddfd�d��Z�e�d#ej�deddfd�d���Z�e�d#ej�deddfd�d���Z�d#ej�deddfd�d„Z�e�d#ejejej fded�edej�dfd�dń�Z�e�d#ejdeddfd�dDŽ�Z�e�d#ej deddfd�dɄ�Z�e�d#ej�deddfd�d˄�Z�e�	d�d#ejded�eddfd�d΄�Z�d#ej�deddfd�dЄZ�d#ej�deddfd�d҄Z�d#ej�deddfd�dԄZ�d#ej�deddfd�dքZ�d#ej�deddfd�d؄Z�d#ej�deddfd�dڄZ�d#ej�deddfd�d܄Z�d#ej�deddfd�dބZ�d#ej�deddfd�d�Z�d#ej�deddfd�d�Z�d#ej�deddfd�d�Z�d#ej�deddfd�d�Z�d#ej�deddfd�d�Z�d#ej�deddfd�d�Z�d#ej�deddfd�d�Z�dS)�r&NFTr@rrOrPrQrRrSr$cCs�|durt�}||_||_||_||_d|_||_d|_|r#t|�|_i|_	i|_
d|_d|_d|_
i|_i|_g|_d|_d|_d|_d|_d|_d|_g|_g|_dg|_dS)NFrr	T�context)rr@rOrPrQ�created_block_contextrRr,r�import_aliases�blocks�extends_so_far�has_known_extends�code_linenor�r��
debug_info�_write_debug_info�
_new_lines�
_last_line�_first_write�_last_identifier�_indentation�
_assign_stack�_param_def_block�_context_reference_stack)r%r@rOrPrQrRrSr2r2r3r-s8	
zCodeGenerator.__init__cCs
|jduSr+)r,r�r2r2r3rSvs
zCodeGenerator.optimized�msg�linenozte.NoReturncCst|||j|j��)z*Fail with a :exc:`TemplateAssertionError`.)rrOrP)r%r�r�r2r2r3�fail|�zCodeGenerator.failcCs|jd7_d|j��S)zGet a new unique identifier.r	�t_)r�r�r2r2r3�temporary_identifier�sz"CodeGenerator.temporary_identifierr(cCs |��|_|�|j�d��dS)z7Enable buffering for the frame from that point onwards.z = []N)r�r��	writeline�r%r(r2r2r3r��s
zCodeGenerator.buffer�force_unescapedcCs�|sF|jjr6|�d�|��|�d|j�d��|��|�d�|��|�d|j�d��|��dS|jjrF|�d|j�d��dS|�d|j�d��dS)z(Return the buffer contents of the frame.zif context.eval_ctx.autoescape:zreturn Markup(concat(�))�else:zreturn concat(r?N)r-r.r��indentr��outdent�
autoescape)r%r(r�r2r2r3�return_buffer_contents�s

z$CodeGenerator.return_buffer_contentscCs|jd7_dS)zIndent by one.r	N�r�r�r2r2r3r��r�zCodeGenerator.indentr	�stepcCs|j|8_dS)zOutdent by step.Nr�)r%r�r2r2r3r��r�zCodeGenerator.outdentr'cCs2|jdur
|�d|�dS|�|j�d�|�dS)z%Yield or write into the frame buffer.N�yield �.append()r�r�)r%r(r'r2r2r3�start_write�s
zCodeGenerator.start_writecCs|jdur|�d�dSdS)z1End the writing process started by `start_write`.Nr?)r�rCr�r2r2r3�	end_write�s
�zCodeGenerator.end_write�scCs$|�||�|�|�|�|�dS)z4Simple shortcut for start_write + write + end_write.N)r�rCr�)r%r�r(r'r2r2r3�simple_write�s
zCodeGenerator.simple_writer
cCs<z|�d�|D]}|�||�qWdStyYdSw)z�Visit a list of nodes as block in a frame.  If the current frame
        is no buffer a dummy ``if 0: yield None`` is written automatically.
        �passN)r�r/r�)r%r
r(r'r2r2r3�
blockvisit�s
��zCodeGenerator.blockvisit�xcCs�|jr8|js)|j�d|j�|j|j7_|jdur)|j�|j|jf�d|_d|_|j�d|j�d|_|j�|�dS)z&Write a string into the output stream.�
NFz    r)	r�r�rQrCr�r�r��appendr�)r%r�r2r2r3rC�s
zCodeGenerator.writer�extracCs|�||�|�|�dS)z!Combination of newline and write.N)�newlinerC)r%r�r'r�r2r2r3r��szCodeGenerator.writelinecCsBt|jd|�|_|dur|j|jkr|j|_|j|_dSdSdS)z/Add one or more newlines before the next write.r	N)�maxr�r�r�r�)r%r'r�r2r2r3r��s
�zCodeGenerator.newline�extra_kwargsc	Cs�tdd�tdd�|jD�|pd�D��}|jD]
}|�d�|�||�q|sP|jD]
}|�d�|�||�q*|durP|��D]\}}|�d|�d|���q@|jr_|�d�|�|j|�|r�|jdurl|�d	�n|�d
�|jD]}|�|j	�d��|�|j
|�|�d�qt|dur�|��D]\}}|�|�d|�d��q�|jdur�|�d�|�|j|�|�d
�dS|�d�dS|jdur�|�d�|�|j|�dSdS)a+Writes a function call to the stream for the current node.
        A leading comma is added automatically.  The extra keyword
        arguments may not include python keywords otherwise a syntax
        error could occur.  The extra keyword arguments should be given
        as python dict.
        css �|]}tt�t|��VqdSr+)�is_python_keywordr6r8rk)r^rbr2r2r3r`�s
��
�z*CodeGenerator.signature.<locals>.<genexpr>cs��|]}|jVqdSr+)�key�r^r�r2r2r3r`���r2r<N�=z, *z
, **dict({z, **{�: z}, **r?�}z, **)�anyrr*�argsrCr/rr�dyn_args�
dyn_kwargsr�r[)	r%r'r(r��kwarg_workaround�arg�kwargr�r[r2r2r3�	signature�sH�











�zCodeGenerator.signaturec
Cst�}|D]}|�|�q|j|jdf|j|jdffD]h\}}}t|�D]^}||vr0|��||<|�d�|��|�||�d|�d|�d��|��|�d�|��|�d�|�d	||�d
��|��|�d|dd
��d|�d��|��|��q$qdS)a�Find all filter and test names used in the template and
        assign them to variables in the compiled namespace. Checking
        that the names are registered with the environment is done when
        compiling the Filter and Test nodes. If the node is in an If or
        CondExpr node, the check is done at runtime instead.

        .. versionchanged:: 3.0
            Filters and tests in If and CondExpr nodes are checked at
            runtime instead of compile time.
        r�r��try:z = environment.�[�]zexcept KeyError:z
@internalcode�def z
(*unused):zraise TemplateRuntimeError("No N���� named z	 found."))	r�r/r�r��sortedr�r�r�r�)r%r
rHr'�id_maprt�
dependencyrOr2r2r3�pull_dependenciess:�
 

��
��zCodeGenerator.pull_dependenciesc	Cs�g}|jj��D]<\}\}}|tkrq|tkr(|�|�d|���d|�d��q|tkr7|�|�d|���q|tkrA|�	|�qt
d��|rT|�d�|��d��dSdS)N� = r=r?zunknown load instruction�
 = missing)r��loadsrrrrr��get_resolve_funcr
rr��NotImplementedError�join)r%r(�undefs�target�action�paramr2r2r3�enter_frameEs"�zCodeGenerator.enter_frame�with_python_scopecCsF|sg}|jjD]}|�|�q|r!|�d�|��d��dSdSdS)Nrr)r�r	r�r�r)r%r(rr
rr2r2r3�leave_frameUs�zCodeGenerator.leave_frame�async ��async_value�
sync_valuecCs|jjr|S|Sr+)r@�is_async)r%rrr2r2r3�choose_async]�zCodeGenerator.choose_asynccCs|���d|��S)Nr)r)r%rOr2r2r3�func`szCodeGenerator.funccCs�|��}|j�|�t|�}d}t�}g}t|j�D] \}}|jdkr%|}|jdvr0|�|j�|�	|j�
|j��qt|jd�}	d|	vrr|durfz|j
|t|j�Wntye|�d|j�Yn
w|�	|j�d��d|_d|	vr�d|vr�|�	|j�d��d|_d|	vr�d|vr�|�	|j�d��d|_d	|_|j�|�|�|�d
��dd�|��d
�|�|��|�|�|�|�|�|�t|j�D]V\}}|j�
|j�}
|�d|
�d��|��z|j
|t|j�}Wnt�y|�|
�d|j�d|j�d��Ynw|�|
�d��|�||�|�|
�|� �q�|�!�|�"|j|�|j#|dd�|j$|dd�|� �||fS)z/Dump the function def of a macro or call block.N�caller)r*�varargs)rr*rzhWhen defining macros or call blocks the special "caller" argument must be omitted or be given a default.Tr*rF�macror=r<�):�if � is missing:z = undefined("parameter z was not provided", name=r?r)r��r)%r�r��analyze_noderyrn�	enumerater�rOr�r��refrx�body�defaults�len�
IndexErrorr�r��declare_parameterr{r|r}r�r�rrr�r�r�push_parameter_definitionsr/�mark_parameter_storedr��pop_parameter_definitionsr�r�r)r%r'r(�	macro_ref�explicit_caller�skip_special_paramsr��idxr�rwr%�defaultr2r2r3�
macro_bodycsz

��$


���

zCodeGenerator.macro_bodyr.c
Csrd�dd�|jjD��}t|jdd�}t|jj�dkr|d7}|�d|�d	|�d
|j�d|j�d|j�d��dS)z<Dump the macro definition for the def created by macro_body.r<css�|]}t|j�VqdSr+)�reprrOr�r2r2r3r`�s�z*CodeGenerator.macro_def.<locals>.<genexpr>rONr	�,zMacro(environment, macro, z, (z), z, context.eval_ctx.autoescape))	rr'r��getattrr(rCr|r}r{)r%r.r(�	arg_tuplerOr2r2r3�	macro_def�s����zCodeGenerator.macro_defcCs*d|j��}|jdur|�d|j��}|S)z.Return a human readable position for the node.zline N� in )r�rO)r%r'r�r2r2r3�position�s
zCodeGenerator.positioncCs*d�dd�|j����D��}d|�d�S)Nr<css"�|]\}}|�d|��VqdS�r�Nr2)r^rOrr2r2r3r`�s
��
�z3CodeGenerator.dump_local_context.<locals>.<genexpr>�{r�)rr��dump_storesrr)r%r(�items_kvr2r2r3�dump_local_context�s
�z CodeGenerator.dump_local_contextcCs,|�d�|�d�|�d�|�d�dS)z�Writes a common preamble that is used by root and block functions.
        Primarily this sets up common local helpers and enforces a generator
        through a dead branch.
        z$resolve = context.resolve_or_missingz!undefined = environment.undefinedzcond_expr_undefined = Undefinedzif 0: yield NoneN�r�r�r2r2r3�
write_commons�s


zCodeGenerator.write_commonscCs|j�|j���dS)aQPushes all parameter targets from the given frame into a local
        stack that permits tracking of yet to be assigned parameters.  In
        particular this enables the optimization from `visit_Name` to skip
        undefined expressions for parameters in macros as macros can reference
        otherwise unbound parameters.
        N)r�r�r��dump_param_targetsr�r2r2r3r+�sz(CodeGenerator.push_parameter_definitionscCs|j��dS)z+Pops the current parameter definitions set.N)r��popr�r2r2r3r-�sz'CodeGenerator.pop_parameter_definitionsrcCs|jr
|jd�|�dSdS)z�Marks a parameter in the current parameter definitions as stored.
        This will skip the enforced undefined checks.
        rN)r�r��r%rr2r2r3r,�s�z#CodeGenerator.mark_parameter_storedcCs|j�|�dSr+)r�r�rDr2r2r3�push_context_reference�rz$CodeGenerator.push_context_referencecCs|j��dSr+)r�rCr�r2r2r3�pop_context_reference�sz#CodeGenerator.pop_context_referencecCs
|jdS)Nr�r�r�r2r2r3�get_context_ref�s
zCodeGenerator.get_context_refcCs |jd}|dkrdS|�d�S)Nrr��resolvez.resolverGrDr2r2r3r
�s

zCodeGenerator.get_resolve_funccCs|���d|�|��d�S)Nz	.derived(r?)rHr?r�r2r2r3�derive_context�szCodeGenerator.derive_contextcCs|jsdS||jdvS)z4Checks if a given target is an undeclared parameter.Fr)r�rDr2r2r3�parameter_is_undeclaredsz%CodeGenerator.parameter_is_undeclaredcCs|j�t��dS)z+Pushes a new layer for assignment tracking.N)r�r�rnr�r2r2r3�push_assign_trackingr�z"CodeGenerator.push_assign_trackingcCs�|j��}|js|js|jr|sdSdd�|D�}t|�dkrWtt|��}|j�	|�}|jr;|�
d|�d|���dS|jrK|�
d|�d|���dS|�
d|�d|���n<|jr`|�
d	�n|jri|�
d
�n|�
d�t|�D]\}}|r}|�d�|j�	|�}|�|�d
|���qr|�d�|js�|js�|r�t|�dkr�|�
d|d�d��dSd�
tt|��}|�
d|�d��dSdSdSdS)zoPops the topmost level for assignment tracking and updates the
        context variables if necessary.
        NcSs g|]}|dd�dkr|�qS)Nr	�_r2r�r2r2r3�
<listcomp>s z5CodeGenerator.pop_assign_tracking.<locals>.<listcomp>r	z_loop_vars[�] = z_block_vars[�
context.vars[z_loop_vars.update({z_block_vars.update({�context.vars.update({r<r��})�context.exported_vars.add(rr?zcontext.exported_vars.update((r�)r�rCr�r�r�r(�next�iterr�r%r�r$rCr�mapr4)r%r(�vars�public_namesrOr%r1�	names_strr2r2r3�pop_assign_trackingsL
����


�z!CodeGenerator.pop_assign_trackingc	Cs|dusJd��t|j|j�}ddlm}m}|jjr"t||�}nt|�}|�d�|�dd�	|��|j
r:dnd}|�tj
�du}|�tj�D]}	|	j|jvr^|�d	|	j�d
�|	j�|	|j|	j<qJ|�tj�D]:}
|
j|jvr�|
j}|��|j|<}d|vr�|�dd�\}
}|�d|
�d
|�d|���qk|�d|�d|���qk|�d|j���|j|�d��d|�d�dd�|��|��t|�}dt|jd�vr�|j�d�}|�|�d��|j� |�d|_!|_"|o�|j#|_$|r�|�d�|�%|�|�&|j�|�'|j|�|j(|dd�|�)�|�rR|j#�s(|��|�d�|��|jj�s7|�d�n|�d�|��|�d�|�)�|�)d|j#�|j�*�D]�\}}	|�|�d|��d|�d�|	d�|��|��t|�}d|_+t|	jd �}d|v�r�|j�d�}|�|�d��d!|v�r�|j�d!�}|�|�d"|�d#|�d$��|j� |	�||_,|�d%�|�%|�|�&|	j�|�'|	j|�|j(|dd�|�)��qWd�	d&d'�|jD��}|jd(|�d)�dd�d*�	d+d'�|j-D��}|�d,|���dS)-Nzno root frame allowedr	)�exported�async_exportedz%from __future__ import generator_stopzfrom jinja2.runtime import r<rz, environment=environmentzblock z defined twice�.zfrom z import z as zimport zname = �rootz(context, missing=missingr)r�r%r�z = TemplateReference(context)Tzparent_template = Noner"�if parent_template is not None:z4yield from parent_template.root_render_func(context)z=async for event in parent_template.root_render_func(context):zyield event�block_)r%�superraz = context.super(z, block_r?z_block_vars = {}css�|]
}|�d|��VqdS)z: block_Nr2r�r2r2r3r`�s�z/CodeGenerator.visit_Template.<locals>.<genexpr>z
blocks = {r��&css"�|]\}}|�d|��VqdS)r�Nr2rar2r2r3r`�s� z
debug_info = ).rr@rO�runtimer[r\rrr�rrR�findr
�Extends�find_allr�r�r�r��ImportedName�
importnamer�r��rsplitrr�rAr)rxr&r�r*r#r�r�r�r�rrr�rr�rrr�r�r�)r%r'r(r-r[r\�exported_names�envenv�have_extendsr��import_�imp�alias�module�objr%rOr�rw�
blocks_kv_str�debug_kv_strr2r2r3�visit_Template9s�
��



�
�



zCodeGenerator.visit_TemplatecCsd}|jr|jr
dS|jdkr|�d�|��|d7}|jr%|�|�}n|��}|jrJ|�d|j	�d�|�|��|�d|j	�d�|�|�
�|jjsb|j
durb|�d	|j	�d
|�d�|�n |�|���d|j	�d
|�d
�|�|��|�d|�|�
�|�
|�dS)z.Call a block and register it for the template.rN�if parent_template is None:r	zif len(context.blocks[z]) <= 1:z+raise TemplateRuntimeError("Required block z not found")zyield from context.blocks[z][0](r?zfor event in context.blocks[r�event)r�r�r�r�r��scopedrJrH�requiredrOr�r@rr�rr�)r%r'r(r�r�r2r2r3r��sF

��
���zCodeGenerator.visit_BlockcCs�|js
|�d|j�|jdkr*|js|�d�|��|�d�|jr&t��|��|�d|�|�	|j
|�|�d|j�d��|�d�|��|�d	�|��|j
rYd
|_|jd7_dS)
zCalls the extender.z,cannot use extend from a non top-level scoperr_z5raise TemplateRuntimeError("extended multiple times")z+parent_template = environment.get_template(r<r?z9for name, parent_block in parent_template.blocks.items():z8context.blocks.setdefault(name, []).append(parent_block)Tr	N)r�r�r�r�r�r�r�r�r�r/�templaterCrOr�rFr2r2r3�
visit_Extends�s(




zCodeGenerator.visit_ExtendscCsl|jr|�d�|��d}t|jtj�r+t|jjt�rd}nt|jjt	t
f�r*d}nt|jtjtjf�r7d}|�d|�d�|�|�
|j|�|�d|j�d��|jrt|��|�d	�|��|�d
�|��|�d�|��d}|jr�|�|���d
|�|��d��n|jjr�|�d�n|�d�d}|s�|��|�d|�|��|jr�|��dSdS)zHandles includes.r��get_or_select_template�get_template�select_templateztemplate = environment.r=r<r?zexcept TemplateNotFound:r�r�FzUfor event in template.root_render_func(template.new_context(context.get_all(), True, z)):zGfor event in (await template._get_default_module_async())._body_stream:z6yield from template._get_default_module()._body_streamTrvN)�ignore_missingr�r�rTryr
�Constr[rkrlrm�Tuple�Listr/rCrOr��with_contextrr?r@rr�)r%r'r(�	func_name�skip_event_yieldr2r2r3�
visit_IncludesV
�



���
�zCodeGenerator.visit_IncludecCs�|�|�d��d��|�|j|�|�d|j�d��|jr7d|�d���}|�|�d|�|��d��dS|�d	|�d��d
��dS)N�await zenvironment.get_template(r<z).�make_module�_asyncz(context.get_all(), True, r?�_get_default_modulez	(context))rCrr/ryrOr�r?)r%r'r(�f_namer2r2r3�_import_common9s�zCodeGenerator._import_commoncCst|�|j�|j��d�|�|jr|�d|j�d��|�||�|jr6|j�d�s8|�d|j�d��dSdSdS)zVisit regular imports.rrPrOrM�context.exported_vars.discard(r?N)r�r�r%rr�rCr��
startswithrFr2r2r3�visit_ImportHs�zCodeGenerator.visit_Importc	s�|�|�|�d�|�|��g}g}|jD]k}t|t�r#|\}}n|}|��j�|��d|�d��|�d�j�|��d��|�	�|�
|��dd��dd	�}d
|�d|��}|��j�|��d|�d
|�d��|���j
r�|�|�|�d�s�|�|�q|r�t|�dkr�|d}|�d|�d�j�|����nd��fdd�|D��}	|�d|	�d��|r�t|�dkr�|�d|d�d��dSd�tt|��}
|�d|
�d��dSdS)zVisit named imports.zincluded_template = z = getattr(included_template, z
, missing)r r!r<z{{r�z}}z9the template {included_template.__name__!r} (imported on z%) does not export the requested name z = undefined(fz, name=r?rMr	rrPrOr<c3s&�|]}|�d�j�|���VqdSr;)r�r%)r^rO�r(r2r3r`}s�
�z1CodeGenerator.visit_FromImport.<locals>.<genexpr>rQrRr�z)context.exported_vars.difference_update((r�N)r�rCr�rtrTrlr�r�r%r�r:�replacer�r�r�r�r(rrVr4)r%r'r(�	var_names�discarded_namesrOror:�message�names_kvrYr2r�r3�visit_FromImportSs`




������


� �
��zCodeGenerator.visit_FromImportcCs||��}d|_|��}|��}|jp)dt|jdd�d�vp)tdd�|�tj�D��}d}|r4|j	�
d�}|j	j|dd	�|jrG|j	j|d
d	�|j
r�|��}|j	j|dd	�|�|�|��d�|j
�|��|�|�|�|�d
d��|�|j|�|�d�|�|�dd��|�d�|��|�d|j
�|�|j
|�|�d�|��|�d�|�|j|�|�d�|j|dd�|jr�|�|�d��d�|�|��|�|�|j|_|r�|�|�d��|�tj�D]}	|	jdk�r|	jdk�r|�d|	j�q�|j�r|��}
|�|
�d��|�|�d
d�|�|�|j|�|�r8|�d|�d|�d��d��n|�d�|j
�rI|�|�d��|j�rS|�d �n!|jj �r`|�s`|�d!�|�|j!|�|jj �rt|�st|�d"�|j
�r}|�d"�|j�r�|�d#�n
|�|�r�d$nd�|��|�|�|�d%�|�"|j#|�|j�r�|�|
�d&��|��|j||j�o�|jd�|j�r�|�d|
�d��|��|�|�|�"|j|�|�|�|��|j�r,|�$|�|��|�%||�|�|�d'��d(��|jj �r|�d!�|�|j!|�|jj �r"|�d"�|�d)�|�&|�|j'�r<|j'd*�(|j	j)�dSdS)+NT�loop)r&)�only)r�csr�r+)rw)r^r�r2r2r3r`�r�z*CodeGenerator.visit_For.<locals>.<genexpr>r&)�
for_branch�else�testz(fiter):z
async for zfor r9zauto_aiter(fiter)�fiter�:r r��r"z%(reciter, loop_render_func, depth=0):r�storez8Can't assign to special loop variable in for-loop targetz = 1r<�AsynczLoopContext(r=�reciterzauto_aiter(r?z&, undefined, loop_render_func, depth):z
, undefined):z_loop_vars = {}z = 0r�zloop(z, loop)r)*r�r��	recursiverx�iter_child_nodesr�rfr
r�r�r*r#�else_r�r�r�rr�rrr/rrCr�rr�r�r�rOr�r�r@rrUr�r&r�r�r�r��difference_update�stores)r%r'r(r��
test_frame�
else_frame�
extended_loop�loop_ref�loop_filter_funcrO�iteration_indicatorr2r2r3�	visit_For�s����





�
�� 





�








�zCodeGenerator.visit_ForcCs�|��}|�d|�|�|j|�|�d�|��|�|j|�|��|j	D]#}|�d|�|�|j|�|�d�|��|�|j|�|��q(|j
re|�d�|��|�|j
|�|��dSdS)Nr r�zelif r�)r�r�r/r�rCr�r�r&r��elif_r�)r%r'r(�if_framer�r2r2r3�visit_Ifs(




�zCodeGenerator.visit_IfcCs||�||�\}}|��|jr)|j�d�s|�d|j�d��|�d|j�d��|�|j�|j��d��|�	||�dS)NrMrSr?rPrOr)
r3r�r�rOr�rCr�r�r%r8)r%r'r(�macro_framer.r2r2r3�visit_Macro*szCodeGenerator.visit_MacrocCsR|�||�\}}|�d�|�||�|�||�|j|j|dd�|�|�dS)Nz	caller = T)�forward_caller)r3r�r8r��
visit_Call�callr�)r%r'r(�
call_framer.r2r2r3�visit_CallBlock4s
zCodeGenerator.visit_CallBlockcCsh|��}|j�|�|�|�|�|�|�|j|�|�||�|�|j	|�|�
|�|�|�dSr+)r�r�r#rr�r�r&r�r��filterr�r)r%r'r(�filter_framer2r2r3�visit_FilterBlock<s


zCodeGenerator.visit_FilterBlockcCs||��}|j�|�|�|�t|j|j�D]\}}|��|�||�|�	d�|�||�q|�
|j|�|�|�dS�Nr)
r�r�r#r�zip�targets�valuesr�r/rCr�r&r)r%r'r(�
with_framer�exprr2r2r3�
visit_WithGs

zCodeGenerator.visit_WithcCs|�|�|�|j|�dSr+)r�r/r'rFr2r2r3�visit_ExprStmtSr�zCodeGenerator.visit_ExprStmtc@s4eZdZUejejdefed<ejeed<dS)zCodeGenerator._FinalizeInfo.�const�srcN)r�r�r�r6r��Callablerk�__annotations__r2r2r2r3�
_FinalizeInfoWs
r�r[cCst|�S)z�The default finalize function if the environment isn't
        configured with one. Or, if the environment has one, this is
        called on that function's output for constants.
        )rkrsr2r2r3�_default_finalize[szCodeGenerator._default_finalize�	_finalizecs��jdur�jS�j}�d}�jjrYd}�jj�tjdtjdtjdi�t����}d}|dur?dt	j
dt	j
f��fdd	�}n|�|�d
�}|dkrYdt	j
dt	j
f���fdd	�}��||��_�jS)a�Build the finalize function to be used on constants and at
        runtime. Cached so it's only created once for all output nodes.

        Returns a ``namedtuple`` with the following attributes:

        ``const``
            A function to finalize constant data at compile time.

        ``src``
            Source code to output around nodes to be evaluated at
            runtime.
        Nzenvironment.finalize(r��context.eval_ctxr@r[r$cs��|��Sr+r2rs)r2�env_finalizer2r3�finalize�sz.CodeGenerator._make_finalize.<locals>.finalizer<cs���j|��Sr+)r@rs�r2r�r%r2r3r��r)r�r�r@r�rr��eval_context�get�from_objr6r7r�)r%r�r��pass_argr2r�r3�_make_finalizees.


���zCodeGenerator._make_finalize�groupcCstt|��S)z�Given a group of constant values converted from ``Output``
        child nodes, produce a string to write to the template module
        source.
        )r4r)r%r�r2r2r3�_output_const_repr�sz CodeGenerator._output_const_reprr�cCs:|�|j�}|jjrt|�}t|tj�rt|�S|�|�S)aCTry to optimize a child of an ``Output`` node by trying to
        convert it to constant, finalized data at compile time.

        If :exc:`Impossible` is raised, the node is not constant and
        will be evaluated at runtime. Any other exception will also be
        evaluated at runtime for easier debugging.
        )	�as_constr-r�rrTr
�TemplateDatarkr�)r%r'r(r�r�r2r2r3�_output_child_to_const�s

z$CodeGenerator._output_child_to_constcCsP|jjr
|�d�n|jjr|�d�n|�d�|jdur&|�|j�dSdS)zXOutput extra source code before visiting a child of an
        ``Output`` node.
        z1(escape if context.eval_ctx.autoescape else str)(zescape(zstr(N)r-r.rCr�r��r%r'r(r�r2r2r3�_output_child_pre�s

�zCodeGenerator._output_child_precCs&|�d�|jdur|�d�dSdS)zWOutput extra source code after visiting a child of an
        ``Output`` node.
        r?N)rCr�r�r2r2r3�_output_child_post�s

�z CodeGenerator._output_child_postc	
Cs�|jr|jrdS|�d�|��|��}g}|jD]A}z|js*t|tj�s*t�	��|�
|||�}Wntj	tfyC|�|�Yqw|rUt|dt
�rU|d�|�q|�|g�q|jdur~t|�dkrq|�|j�d��n	|�|j�d��|��|D]P}t|t
�r�|�|�}|jdur�|�d|�q�|�|d�q�|jdur�|�d|�n|�|�|�|||�|�||�|�|||�|jdur�|�d�q�|jdur�|��|�t|�dkr�dnd	�|jr�|��dSdS)
Nrurr	r�z	.extend((r�r5r?r�)r�r�r�r�r�r
r�rTr��
Impossibler��	Exceptionr�rmr�r(r�r�r�r/r�rCr�)	r%r'r(r�r&�childr��item�valr2r2r3�visit_Output�s`

�
�
�







�
�zCodeGenerator.visit_OutputcCsF|��|�|�|�|j|�|�d�|�|j|�|�|�dSr�)rLr�r/rrCr'rZrFr2r2r3�visit_Assigns

zCodeGenerator.visit_AssigncCs�|��|��}d|_|j�|�|�|�|�|�|�|j|�|�	|�|�
|j|�|�d�|j
dur@|�|j
|�n
|�d|j�d��|�d�|�|�|�|�dS)NFz9 = (Markup if context.eval_ctx.autoescape else identity)(�concat(r?)rLr�r�r�r#rr�r�r&r�r/rrCr�r�rZr)r%r'r(r�r2r2r3�visit_AssignBlock#s 






zCodeGenerator.visit_AssignBlockc	Cs�|jdkr|js|js|jr|jr|jd�|j�|j�|j�}|jdkrM|j�	|�}|dur;|dt
kr;|�|�rM|�d|j�d|�d|�d��dS|�|�dS)	Nr�rr�rz(undefined(name=z) if z is missing else r?)
r�r�r�r�r�r�rOr�r%�	find_loadrrKrC)r%r'r(r%r�r2r2r3r�;s*
���
��zCodeGenerator.visit_NamecCsV|j�|j�}|�d|�d��|��|�d�|��|�|�d|j�d��dS)Nzif not isinstance(z
, Namespace):zMraise TemplateRuntimeError("cannot assign attribute on non-namespace object")r�r�)r�r%rOr�r�r��attr)r%r'r(r%r2r2r3�visit_NSRefTs�zCodeGenerator.visit_NSRefcCs:|�|j�}t|t�r|�t|��dS|�t|��dSr+)r�r-rTrhrCrkr4)r%r'r(r�r2r2r3�visit_Constbs
zCodeGenerator.visit_ConstcCsHz|�t|�|j���WdStjy#|�d|j�d��YdSw�Nz6(Markup if context.eval_ctx.autoescape else identity)(r?)rCr4r�r-r
r��datarFr2r2r3�visit_TemplateDatais
��z CodeGenerator.visit_TemplateDatacCs\|�d�d}t|j�D]\}}|r|�d�|�||�q|�|dkr)d�dSd�dS)Nr=rr<rz,)r?�rCr$rrr/�r%r'r(r1r�r2r2r3�visit_Tupleqs

 zCodeGenerator.visit_TuplecCsF|�d�t|j�D]\}}|r|�d�|�||�q
|�d�dS)Nr�r<r�r�r�r2r2r3�
visit_Listzs

zCodeGenerator.visit_ListcCs`|�d�t|j�D]\}}|r|�d�|�|j|�|�d�|�|j|�q
|�d�dS)Nr<r<r�r�)rCr$rrr/r�r[r�r2r2r3�
visit_Dict�s


zCodeGenerator.visit_Dict�+�-�*�/z//z**�%�and�orznot cCs`|jjrd}n	|jjrd}nd}|�|�d��|jD]
}|�||�|�d�q|�d�dS)Nz8(markup_join if context.eval_ctx.volatile else str_join)�markup_join�str_joinz((r<r�)r-r.r�rCr
r/)r%r'r(r�r�r2r2r3�visit_Concat�s
zCodeGenerator.visit_ConcatcCs>|�d�|�|j|�|jD]}|�||�q|�d�dS)Nr=r?)rCr/r��ops)r%r'r(r:r2r2r3�
visit_Compare�s


zCodeGenerator.visit_ComparecCs*|�dt|j�d��|�|j|�dS)Nr>)rC�	operatorsr:r/r�rFr2r2r3�
visit_Operand�szCodeGenerator.visit_OperandcCsX|jjr	|�d�|�d�|�|j|�|�d|j�d��|jjr*|�d�dSdS)N�(await auto_await(zenvironment.getattr(r<r?r�)r@rrCr/r'r�rFr2r2r3�
visit_Getattr�s

�zCodeGenerator.visit_GetattrcCs�t|jtj�r!|�|j|�|�d�|�|j|�|�d�dS|jjr*|�d�|�d�|�|j|�|�d�|�|j|�|�d�|jjrR|�d�dSdS)Nr�r�r�zenvironment.getitem(r<r?r�)	rTr�r
�Slicer/r'rCr@rrFr2r2r3�
visit_Getitem�s




�zCodeGenerator.visit_GetitemcCsd|jdur|�|j|�|�d�|jdur|�|j|�|jdur0|�d�|�|j|�dSdS)Nr�)�startr/rC�stopr�rFr2r2r3�visit_Slice�s




�zCodeGenerator.visit_Slice�	is_filterccs�|jjr
|�d�|r!|�|j|j�d��|jj�|j�}n|�|j|j�d��|jj�|j�}|durQ|jsQ|r@dnd}|�d|�d|j�d�|j	�t
jdt
jd	t
jd
i�t
�
|��}|durn|�|�d��dV|�||�|�d�|jjr�|�d�dSdS)
N�await auto_await(r=r�r�zNo rr]r�r�r@r<r?)r@rrCr�rOr�r�r�r�r�rr�r�r�r�)r%r'r(rr�	type_namer�r2r2r3�_filter_test_common�s6�
���
�z!CodeGenerator._filter_test_commoncCs�|�||d��Z|jdur|�|j|�n4|jjr(|�d|j�d|j�d��n)|jjr7|�d|j�d��n"|�d|j�d��Wd�dSWd�dSWd�dSWd�dS1sdwYdS)NTz(Markup(concat(z.)) if context.eval_ctx.autoescape else concat(r�zMarkup(concat(r�r?)rr'r/r-r.rCr�r�rFr2r2r3r�s&

�����"�zCodeGenerator.visit_FiltercCsB|�||d��|�|j|�Wd�dS1swYdSrz)rr/r'rFr2r2r3r�s"�zCodeGenerator.visit_Testcsh����d���fdd�}��d����j����d����j����d�|���d�dS)	Nr$cs8�jdur���j��dS��d�����d��dS)Nz1cond_expr_undefined("the inline if-expression on z6 evaluated to false and no else section was defined."))�expr2r/rCr:r2�r(r'r%r2r3�write_expr2"s
��z1CodeGenerator.visit_CondExpr.<locals>.write_expr2r=z if z else r?r�)r�rCr/�expr1r�)r%r'r(r
r2r	r3�visit_CondExprs


zCodeGenerator.visit_CondExprr�cCs�|jjr	|�d�|jjr|�d�n|�d�|�|j|�|r%ddind}|jr.ddini}|jr7ddini}|rE|j|fi|��n|sI|rQt	|fi|��}|�
|||�|�d�|jjrh|�d�dSdS)Nrzenvironment.call(context, z
context.call(r�
_loop_vars�_block_varsr?)r@rrCrAr/r'r�r�r�rqr�)r%r'r(r�r��loop_kwargs�block_kwargsr2r2r3r�5s$


�zCodeGenerator.visit_CallcCs"|�|jd�|�|j|�dS)Nr�)rCr�r/r[rFr2r2r3�
visit_KeywordLszCodeGenerator.visit_KeywordcC�&|�d�|�|j|�|�d�dS)NzMarkup(r?�rCr/r�rFr2r2r3�visit_MarkSafeRs
zCodeGenerator.visit_MarkSafecCrr�rrFr2r2r3�visit_MarkSafeIfAutoescapeWs
z(CodeGenerator.visit_MarkSafeIfAutoescapecCs|�d|j�dS)Nzenvironment.�rCrOrFr2r2r3�visit_EnvironmentAttribute^�z(CodeGenerator.visit_EnvironmentAttributecCs|�d|j�d|j���dS)Nzenvironment.extensions[z].)rC�
identifierrOrFr2r2r3�visit_ExtensionAttributecsz&CodeGenerator.visit_ExtensionAttributecCs|�|j|j�dSr+)rCr�rhrFr2r2r3�visit_ImportedNamehsz CodeGenerator.visit_ImportedNamecCs|�|j�dSr+rrFr2r2r3�visit_InternalNamekrz CodeGenerator.visit_InternalNamecCs|�d�dS)Nr�)rCrFr2r2r3�visit_ContextReferencensz$CodeGenerator.visit_ContextReferencecCs|�|�|��dSr+)rCrJrFr2r2r3�visit_DerivedContextReferencesrz+CodeGenerator.visit_DerivedContextReferencecC�|�d|�dS)N�continuer@rFr2r2r3�visit_ContinuexrzCodeGenerator.visit_ContinuecCr)N�breakr@rFr2r2r3�visit_Break{rzCodeGenerator.visit_BreakcCs:|��}|j�|�|�|�|�|j|�|�|�dSr+)r�r�r#rr�r&r)r%r'r(�scope_framer2r2r3�visit_Scope~s

zCodeGenerator.visit_ScopecCs�|��}|�|�d|�|����|�|�d��|�|j|�|�|�|jdd�}|j�|�|�	|�|�
|j|�|�|�|�
�dS)Nrz.vars = T)r�)r�r�rJr/r�rEr�r�r#rr�r&rrF)r%r'r(r�r$r2r2r3�visit_OverlayScope�s


z CodeGenerator.visit_OverlayScopec	Csr|jD]3}|�d|j�d��|�|j|�z	|j�|j�}Wntjy-d|j_	Yqwt
|j|j|�qdS)Nzcontext.eval_ctx.rT)�optionsr�r�r/r[r�r-r
r�r.�setattr)r%r'r(�keywordr�r2r2r3�visit_EvalContextModifier�s
��z'CodeGenerator.visit_EvalContextModifiercCsh|��}|j��}|�|�d��|�||�|jD]}|�||�q|j�|�|�d|�d��dS)Nz = context.eval_ctx.save()zcontext.eval_ctx.revert(r?)r�r-�saver�r*r&r/�revert)r%r'r(�old_ctx_name�	saved_ctxr�r2r2r3�visit_ScopedEvalContextModifier�s

z-CodeGenerator.visit_ScopedEvalContextModifier�NFTr�r�)r	r+)Nr)rr)�r�r�r�r6r�rk�TextIOrfr�propertyrSrgr�r�r)r�r�r�r�r
�Noder�r�r�r�r�rCr�r�r��Callr�r��Mappingr7r�rrrrrr�r�r�ryr3r8r:r?rAr+r-r,rErFrHr
rJrKrLrZrUrtr�r�rerz�Includer��Import�
FromImportr�r�r��Forr��Ifr�r�r��FilterBlockr��Withr��ExprStmtr��
NamedTupler��staticmethodr�r�r�r�r�r5r�r�r��Outputr��Assignr��AssignBlockr�r�r��NSRefr�rr�r�r�r�r�r��Dictr�rK�	visit_Add�	visit_Sub�	visit_Mul�	visit_Div�visit_FloorDiv�	visit_Pow�	visit_Mod�	visit_And�visit_OrrN�	visit_Pos�	visit_Neg�	visit_Notr9�Concatr��Comparer��Operandr��Getattrr��Getitemrr�rr�Iteratorrr�r��CondExprrr��Keywordr�MarkSafer�MarkSafeIfAutoescaper�EnvironmentAttributer�ExtensionAttributerrgr�InternalNamer�ContextReferencer�DerivedContextReferencer�Continuer!�Breakr#�Scoper%�OverlayScoper&�EvalContextModifierr*�ScopedEvalContextModifierr/r2r2r2r3r&,s"
����
���
�I���
�
 ���
�
���
��
� ����
�9+��
�S

	

.���
�w++3��
�7
0���
����
����
�O	


����)�������
���
���
���
���
���
�
���r0)Fr��typingr6�
contextlibr�	functoolsr�ior�	itertoolsrr)rr��
markupsaferrrr
�
exceptionsr�
idtrackingrr
rrrrr,r�utilsrrrHr�
TYPE_CHECKING�typing_extensions�ter@r�TypeVarr�r7rr�r9rkrIrKrMrNrUr�r1rfrZr]r�r3�Setrxryr)�RuntimeErrorrvr�rur�r�r&r2r2r2r3�<module>s��$�
������
���
�
��
�S

Spamworldpro Mini