%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core/17212/usr/lib/python3/dist-packages/jinja2/__pycache__/
Upload File :
Create Path :
Current File : //snap/core/17212/usr/lib/python3/dist-packages/jinja2/__pycache__/nodes.cpython-35.pyc



KP�g<q�@shdZddlZddlZddlmZddlmZddlmZm	Z	m
Z
ejejfZ
dejdejdejd	ejd
ejdejdejiZd
ejdejdejiZdejdejdejdejdejdejddd�ddd�iZ Gdd�de!�Z"Gdd�de#�Z$Gdd�de%�Z&dd �Z'Gd!d"�d"e	e$e%��Z(Gd#d$�d$e(�Z)Gd%d&�d&e(�Z*Gd'd(�d(e(�Z+Gd)d*�d*e)�Z,Gd+d,�d,e)�Z-Gd-d.�d.e)�Z.Gd/d0�d0e)�Z/Gd1d2�d2e)�Z0Gd3d4�d4e)�Z1Gd5d6�d6e)�Z2Gd7d8�d8e)�Z3Gd9d:�d:e)�Z4Gd;d<�d<e)�Z5Gd=d>�d>e)�Z6Gd?d@�d@e)�Z7GdAdB�dBe)�Z8GdCdD�dDe)�Z9GdEdF�dFe(�Z:GdGdH�dHe:�Z;GdIdJ�dJe:�Z<GdKdL�dLe:�Z=GdMdN�dNe:�Z>GdOdP�dPe>�Z?GdQdR�dRe>�Z@GdSdT�dTe>�ZAGdUdV�dVe>�ZBGdWdX�dXe>�ZCGdYdZ�dZe*�ZDGd[d\�d\e*�ZEGd]d^�d^e:�ZFGd_d`�d`e:�ZGGdadb�dbe:�ZHGdcdd�dde:�ZIGdedf�dfe:�ZJGdgdh�dhe:�ZKGdidj�dje:�ZLGdkdl�dle:�ZMGdmdn�dne:�ZNGdodp�dpe*�ZOeOjdqdrjPeQdsdt�eRe�eRe�BeRe �BD���7_Gdudv�dve;�ZSGdwdx�dxe;�ZTGdydz�dze;�ZUGd{d|�d|e;�ZVGd}d~�d~e;�ZWGdd��d�e;�ZXGd�d��d�e;�ZYGd�d��d�e;�ZZGd�d��d�e;�Z[Gd�d��d�e<�Z\Gd�d��d�e<�Z]Gd�d��d�e<�Z^Gd�d��d�e:�Z_Gd�d��d�e:�Z`Gd�d��d�e:�ZaGd�d��d�e:�ZbGd�d��d�e:�ZcGd�d��d�e:�ZdGd�d��d�e:�ZeGd�d��d�e)�ZfGd�d��d�e)�ZgGd�d��d�e)�ZhGd�d��d�e)�ZiGd�d��d�ei�Zjd�d��Zkelek�e$_m[kdS)�a}
    jinja2.nodes
    ~~~~~~~~~~~~

    This module implements additional nodes derived from the ast base node.

    It also provides some node tree helper functions like `in_lineno` and
    `get_nodes` used by the parser and translator in order to normalize
    python and jinja nodes.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
�N)�deque)�Markup)�izip�with_metaclass�	text_type�*�/z//z**�%�+�-�not�eq�ne�gtZgteq�ltZlteq�incCs
||kS)N�)�a�brr�./usr/lib/python3/dist-packages/jinja2/nodes.py�<lambda>2srZnotincCs
||kS)Nr)rrrrrr3sc@seZdZdZdS)�
Impossiblez8Raised if the node could not perform a requested action.N)�__name__�
__module__�__qualname__�__doc__rrrrr7src@s"eZdZdZdd�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�x�d	D]�}g}|jt|d|f��|j|j|f��t|�dksgtd��t|�tt|��ks�td��t|�||<qW|jdd�tj	||||�S)
N�fields�
attributesr�z multiple inheritance not allowedzlayout conflict�abstractF)zfieldsz
attributes)
�extend�getattr�get�len�AssertionError�set�tuple�
setdefault�type�__new__)�cls�name�bases�d�attrZstoragerrrr*@s
*zNodeType.__new__N)rrrrr*rrrrr;src@s=eZdZdZddd�Zdd�Zdd�ZdS)	�EvalContextzcHolds evaluation time information.  Custom attributes can be attached
    to it in extensions.
    NcCsF||_t|j�r-|j|�|_n|j|_d|_dS)NF)�environment�callable�
autoescape�volatile)�selfr1Z
template_namerrr�__init__Qs
	zEvalContext.__init__cCs
|jj�S)N)�__dict__�copy)r5rrr�saveYszEvalContext.savecCs!|jj�|jj|�dS)N)r7�clear�update)r5�oldrrr�revert\s
zEvalContext.revert)rrrrr6r9r=rrrrr0Lsr0cCs8|dkr4|jdkr'td��t|j�S|S)NzIif no eval context is passed, the node must have an attached environment.)r1�RuntimeErrorr0)�node�ctxrrr�get_eval_contextas

rAc@s�eZdZdZfZdZdZdd�Zdddd	�Zddd
d�Z	dd
�Z
dd�Zdd�Zddd�Z
dd�Zdd�Zdd�ZejZdd�ZdS)�Nodea�Baseclass for all Jinja2 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.
    �linenor1TcOs!|jrtd��|r�t|�t|j�kr�|jsUtd|jj��td|jjt|j�t|j�dkr�dp�df��x0t|j|�D]\}}t|||�q�Wx-|jD]"}t|||j	|d��q�W|rtdt
t|����dS)Nz#abstract nodes are not instanciablez%r takes 0 argumentsz%r takes 0 or %d argument%sr�s�zunknown attribute %r)r �	TypeErrorr$r�	__class__rr�setattrr�pop�next�iter)r5rrr,�argr/rrrr6s$			( z
Node.__init__Nccs�x�|jD]}||ko'dkns\|dk	rD||ks\|dk	r
||kr
y|t||�fVWq
tk
r�Yq
Xq
WdS)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)rr"�AttributeError)r5�exclude�onlyr,rrr�iter_fields�s
zNode.iter_fieldsccsrxk|j||�D]W\}}t|t�rVx9|D]}t|t�r5|Vq5Wqt|t�r|VqWdS)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)rP�
isinstance�listrB)r5rNrOZfield�item�nrrr�iter_child_nodes�s
zNode.iter_child_nodescCsx|j|�D]}|SWdS)ziFind the first node of a given type.  If no such node exists the
        return value is `None`.
        N)�find_all)r5�	node_type�resultrrr�find�sz	Node.findccsNxG|j�D]9}t||�r'|Vx|j|�D]}|Vq7Wq
WdS)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)rUrQrV)r5rWZchildrXrrrrV�s
z
Node.find_allcCsWt|g�}xA|rR|j�}d|jkr<||_|j|j��qW|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�popleftrr@r!rU)r5r@�todor?rrr�set_ctx�s		zNode.set_ctxFcCslt|g�}xV|rg|j�}d|jkrQ|jdksH|rQ||_|j|j��qW|S)z.Set the line numbers of the node and children.rCN)rrZrrCr!rU)r5rC�overrider[r?rrr�
set_lineno�s		zNode.set_linenocCsHt|g�}x2|rC|j�}||_|j|j��qW|S)z"Set the environment for all nodes.)rrZr1r!rU)r5r1r[r?rrr�set_environment�s		zNode.set_environmentcCs:t|�t|�ko9t|j��t|j��kS)N)r)r'rP)r5�otherrrr�__eq__�szNode.__eq__cCs|j|�S)N)ra)r5r`rrr�__ne__�szNode.__ne__cs3d�jjdj�fdd��jD��fS)Nz%s(%s)z, c3s+|]!}d|t�|d�fVqdS)z%s=%rN)r")�.0rL)r5rr�	<genexpr>�sz Node.__repr__.<locals>.<genexpr>)rGr�joinr)r5r)r5r�__repr__�s	z
Node.__repr__)zlinenozenvironment)rrrrrrr r6rPrUrYrVr\r^r_rarb�object�__hash__rfrrrrrBks 

		rBc@seZdZdZdZdS)�StmtzBase node for all statements.TN)rrrrr rrrrri�sric@seZdZdZdZdS)�Helperz,Nodes that exist in a specific context only.TN)rrrrr rrrrrj�srjc@seZdZdZdZdS)�TemplatezjNode that represents a template.  This must be the outermost node that
    is passed to the compiler.
    �bodyN)rl)rrrrrrrrrrksrkc@seZdZdZdZdS)�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.
    �nodesN)znodes)rrrrrrrrrrmsrmc@seZdZdZdZdS)�Extendsz Represents an extends statement.�templateN)ztemplate)rrrrrrrrrrosroc@seZdZdZd	ZdS)
�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`.
    �targetrKrl�else_�test�	recursiveN)ztargetziterzbodyrsztestru)rrrrrrrrrrqsrqc@seZdZdZdZdS)�Ifz4If `test` is true, `body` is rendered, else `else_`.rtrlrsN)ztestzbodyzelse_)rrrrrrrrrrvsrvc@seZdZdZdZdS)�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�defaultsrlN)znamezargsryzbody)rrrrrrrrrrw#srwc@seZdZdZdZdS)�	CallBlockz�Like a macro without a name but a call instead.  `call` is called with
    the unnamed macro as `caller` argument this node holds.
    �callrxryrlN)r{zargszdefaultszbody)rrrrrrrrrrz+srzc@seZdZdZdZdS)�FilterBlockzNode for filter sections.rl�filterN)zbodyzfilter)rrrrrrrrrr|2sr|c@seZdZdZdZdS)�BlockzA node that represents a block.r,rl�scopedN)znamezbodyr)rrrrrrrrrr~7sr~c@seZdZdZdZdS)�Includez'A node that represents the include tag.rp�with_context�ignore_missingN)ztemplater�r�)rrrrrrrrrr�<sr�c@seZdZdZdZdS)�Importz&A node that represents the import tag.rprrr�N)ztemplateztargetzwith_context)rrrrrrrrrr�Asr�c@seZdZdZdZdS)�
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.
    rp�namesr�N)ztemplateznameszwith_context)rrrrrrrrrr�Fs
r�c@seZdZdZdZdS)�ExprStmtzAA statement that evaluates an expression and discards the result.r?N)znode)rrrrrrrrrr�Tsr�c@seZdZdZdZdS)�Assignz"Assigns an expression to a target.rrr?N)ztargetznode)rrrrrrrrrr�Ysr�c@seZdZdZdZdS)�AssignBlockzAssigns a block to a target.rrrlN)ztargetzbody)rrrrrrrrrr�^sr�c@s7eZdZdZdZddd�Zdd�ZdS)�ExprzBaseclass for all expressions.TNcCs
t��dS)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.
        N)r)r5�eval_ctxrrr�as_constgsz
Expr.as_constcCsdS)z8Check if it's possible to assign something to this node.Fr)r5rrr�
can_assigntszExpr.can_assign)rrrrr r�r�rrrrr�cs
r�c@s7eZdZdZdZdZdZddd�ZdS)	�BinExprz%Baseclass for all binary expressions.�left�rightNTcCs�t||�}|jjr9|j|jjkr9t��t|j}y)||jj|�|j	j|��SWnt
k
r�t��YnXdS)N)rAr1�	sandboxed�operatorZintercepted_binopsr�_binop_to_funcr�r�r��	Exception)r5r��frrrr�s	
)
zBinExpr.as_const)zleftzright)rrrrrr�r r�rrrrr�ys
r�c@s7eZdZdZdZdZdZddd�ZdS)�	UnaryExprz$Baseclass for all unary expressions.r?NTcCs�t||�}|jjr9|j|jjkr9t��t|j}y||jj|��SWnt	k
r}t��YnXdS)N)
rAr1r�r�Zintercepted_unopsr�
_uaop_to_funcr?r�r�)r5r�r�rrrr��s	

zUnaryExpr.as_const)znode)rrrrrr�r r�rrrrr��s
r�c@s(eZdZdZdZdd�ZdS)�NameaLooks 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@cCs
|jdkS)N�true�false�none�True�False�None)ztruezfalser�zTruezFalsezNone)r,)r5rrrr��szName.can_assignN)znamezctx)rrrrrr�rrrrr��sr�c@seZdZdZdZdS)�LiteralzBaseclass for literals.TN)rrrrr rrrrr��sr�c@sCeZdZdZdZddd�Zedddd��ZdS)	�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).
    �valueNcCs|jS)N)r�)r5r�rrrr��szConst.as_constcCs;ddlm}||�s%t��||d|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_reprrCr1)Zcompilerr�r)r+r�rCr1r�rrr�from_untrusted�s	zConst.from_untrusted)zvalue)rrrrrr��classmethodr�rrrrr��s
r�c@s+eZdZdZdZddd�ZdS)�TemplateDatazA constant template string.�dataNcCs>t||�}|jr!t��|jr7t|j�S|jS)N)rAr4rr3rr�)r5r�rrrr��s			
zTemplateData.as_const)zdata)rrrrrr�rrrrr��sr�c@s7eZdZdZd	Zddd�Zdd�ZdS)
�Tuplez�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@Ncs/t|���t�fdd�|jD��S)Nc3s|]}|j��VqdS)N)r�)rc�x)r�rrrd�sz!Tuple.as_const.<locals>.<genexpr>)rAr'r�)r5r�r)r�rr��szTuple.as_constcCs(x!|jD]}|j�s
dSq
WdS)NFT)r�r�)r5rSrrrr��szTuple.can_assign)zitemszctx)rrrrrr�r�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�Listz&Any list literal such as ``[1, 2, 3]``r�Ncs)t|����fdd�|jD�S)Ncsg|]}|j���qSr)r�)rcr�)r�rr�
<listcomp>�s	z!List.as_const.<locals>.<listcomp>)rAr�)r5r�r)r�rr��sz
List.as_const)zitems)rrrrrr�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�DictzeAny dict literal such as ``{1: 2, 3: 4}``.  The items must be a list of
    :class:`Pair` nodes.
    r�Ncs/t|���t�fdd�|jD��S)Nc3s|]}|j��VqdS)N)r�)rcr�)r�rrrd�sz Dict.as_const.<locals>.<genexpr>)rA�dictr�)r5r�r)r�rr��sz
Dict.as_const)zitems)rrrrrr�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�PairzA key, value pair for dicts.�keyr�NcCs1t||�}|jj|�|jj|�fS)N)rAr�r�r�)r5r�rrrr�sz
Pair.as_const)zkeyzvalue)rrrrrr�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�Keywordz>A key, value pair for keyword arguments where key is a string.r�r�NcCs(t||�}|j|jj|�fS)N)rAr�r�r�)r5r�rrrr�
szKeyword.as_const)zkeyzvalue)rrrrrr�rrrrr�sr�c@s+eZdZdZdZddd�ZdS)	�CondExprzZA conditional expression (inline if expression).  (``{{
    foo if bar else baz }}``)
    rt�expr1�expr2NcCsYt||�}|jj|�r1|jj|�S|jdkrIt��|jj|�S)N)rArtr�r�r�r)r5r�rrrr�s	zCondExpr.as_const)ztestzexpr1zexpr2)rrrrrr�rrrrr�sr�c@s+eZdZdZdZdd	d
�ZdS)�FilteraThis node applies a filter on an expression.  `name` is the name of
    the filter, the rest of the fields are the same as for :class:`Call`.

    If the `node` of a filter is `None` the contents of the last buffer are
    filtered.  Buffers are created by macros and filter blocks.
    r?r,rx�kwargs�dyn_args�
dyn_kwargsNcs�t|����js'|jdkr0t��|jjj|j�}|dksft|dd�rot��|jj	��}�fdd�|j
D�}t|dd�r�|jd��n%t|dd�r�|jd|j�t�fdd	�|j
D��}|jdk	rSy|j|jj	���Wntk
rRt��YnX|jdk	r�y|j|jj	���Wntk
r�t��YnXy||||�SWntk
r�t��YnXdS)
NZ
contextfilterFcsg|]}|j���qSr)r�)rcr�)r�rrr�7s	z#Filter.as_const.<locals>.<listcomp>ZevalcontextfilterrZenvironmentfilterc3s|]}|j��VqdS)N)r�)rcr�)r�rrrd<sz"Filter.as_const.<locals>.<genexpr>)rAr4r?rr1�filtersr#r,r"r�rx�insertr�r�r�r!r�r�r;)r5r�Zfilter_�objrxr�r)r�rr�*s6		"


zFilter.as_const)znodeznamezargszkwargszdyn_argsz
dyn_kwargs)rrrrrr�rrrrr�!sr�c@seZdZdZd	ZdS)
�Testz�Applies a test on an expression.  `name` is the name of the test, the
    rest of the fields are the same as for :class:`Call`.
    r?r,rxr�r�r�N)znodeznamezargszkwargszdyn_argsz
dyn_kwargs)rrrrrrrrrr�Msr�c@s+eZdZdZd
Zddd	�ZdS)�Calla/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.
    r?rxr�r�r�Ncs�t|����js$�jjr-t��|jj��}�fdd�|jD�}t|t	�r�t
|dd�r�t��nJt
|dd�r�|jd��n%t
|dd�r�|jd|j�t�fdd	�|j
D��}|jdk	r>y|j|jj���Wntk
r=t��YnX|jdk	r�y|j|jj���Wntk
r�t��YnXy|||�SWntk
r�t��YnXdS)
Ncsg|]}|j���qSr)r�)rcr�)r�rrr�ds	z!Call.as_const.<locals>.<listcomp>ZcontextfunctionFZevalcontextfunctionrZenvironmentfunctionc3s|]}|j��VqdS)N)r�)rcr�)r�rrrdmsz Call.as_const.<locals>.<genexpr>)rAr4r1r�rr?r�rxrQ�_context_function_typesr"r�r�r�r�r!r�r�r;)r5r�r�rxr�r)r�rr�]s6	"


z
Call.as_const)znodezargszkwargszdyn_argsz
dyn_kwargs)rrrrrr�rrrrr�Tsr�c@s7eZdZdZd
Zddd�Zdd	�ZdS)�Getitemz@Get an attribute or item from an expression and prefer the item.r?rLr@NcCsxt||�}|jdkr't��y/|jj|jj|�|jj|��SWntk
rst��YnXdS)N�load)	rAr@rr1�getitemr?r�rLr�)r5r�rrrr��s	
zGetitem.as_constcCsdS)NFr)r5rrrr��szGetitem.can_assign)znodezargzctx)rrrrrr�r�rrrrr�~s
r�c@s7eZdZdZd
Zddd�Zdd	�ZdS)�GetattrznGet an attribute or item from an expression that is a ascii-only
    bytestring and prefer the attribute.
    r?r/r@NcCso|jdkrt��y5t||�}|jj|jj|�|j�SWntk
rjt��YnXdS)Nr�)	r@rrAr1r"r?r�r/r�)r5r�rrrr��s	
zGetattr.as_constcCsdS)NFr)r5rrrr��szGetattr.can_assign)znodezattrzctx)rrrrrr�r�rrrrr��s
r�c@s+eZdZdZdZddd�ZdS)	�Slicez_Represents a slice object.  This must only be used as argument for
    :class:`Subscript`.
    �start�stop�stepNcsLt|����fdd�}t||j�||j�||j��S)Ncs|dkrdS|j��S)N)r�)r�)r�rr�const�szSlice.as_const.<locals>.const)rA�slicer�r�r�)r5r�r�r)r�rr��szSlice.as_const)zstartzstopzstep)rrrrrr�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�ConcatzXConcatenates the list of expressions provided after converting them to
    unicode.
    rnNcs2t|���dj�fdd�|jD��S)NrEc3s$|]}t|j���VqdS)N)rr�)rcr�)r�rrrd�sz"Concat.as_const.<locals>.<genexpr>)rArern)r5r�r)r�rr��szConcat.as_const)znodes)rrrrrr�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�CompareziCompares an expression with some other expressions.  `ops` must be a
    list of :class:`Operand`\s.
    �expr�opsNcCs�t||�}|jj|�}}yFx?|jD]4}|jj|�}t|j||�}|}q2WWntk
r�t��YnX|S)N)rAr�r�r��_cmpop_to_func�opr�r)r5r�rXr�r�Z	new_valuerrrr��s
zCompare.as_const)zexprzops)rrrrrr�rrrrr��sr�c@seZdZdZdZdS)�Operandz$Holds an operator and an expression.r�r�N)zopzexpr)rrrrrrrrrr��sr�z(
The following operators are available: z, ccs|]}d|VqdS)z``%s``Nr)rcr�rrrrd�srdc@seZdZdZdZdS)�Mulz(Multiplies the left with the right node.rN)rrrrr�rrrrr��sr�c@seZdZdZdZdS)�Divz#Divides the left by the right node.rN)rrrrr�rrrrr��sr�c@seZdZdZdZdS)�FloorDivzjDivides the left by the right node and truncates conver the
    result into an integer by truncating.
    z//N)rrrrr�rrrrr��sr�c@seZdZdZdZdS)�AddzAdd the left to the right node.r
N)rrrrr�rrrrr��sr�c@seZdZdZdZdS)�Subz&Subtract the right from the left node.rN)rrrrr�rrrrr��sr�c@seZdZdZdZdS)�ModzLeft modulo right.r	N)rrrrr�rrrrr��sr�c@seZdZdZdZdS)�PowzLeft to the power of right.z**N)rrrrr�rrrrr��sr�c@s+eZdZdZdZddd�ZdS)�AndzShort circuited AND.�andNcCs1t||�}|jj|�o0|jj|�S)N)rAr�r�r�)r5r�rrrr�szAnd.as_const)rrrrr�r�rrrrr�sr�c@s+eZdZdZdZddd�ZdS)�OrzShort circuited OR.�orNcCs1t||�}|jj|�p0|jj|�S)N)rAr�r�r�)r5r�rrrr�
szOr.as_const)rrrrr�r�rrrrr�	sr�c@seZdZdZdZdS)�NotzNegate the expression.rN)rrrrr�rrrrr�sr�c@seZdZdZdZdS)�NegzMake the expression negative.rN)rrrrr�rrrrr�sr�c@seZdZdZdZdS)�Posz8Make the expression positive (noop for most expressions)r
N)rrrrr�rrrrr�sr�c@seZdZdZdZdS)�EnvironmentAttributez�Loads an attribute from the environment object.  This is useful for
    extensions that want to call a callback stored on the environment.
    r,N)zname)rrrrrrrrrr�$sr�c@seZdZdZdZdS)�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,N)r�zname)rrrrrrrrrr�+sr�c@seZdZdZdZdS)�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.
    �
importnameN)r�)rrrrrrrrrr�5sr�c@s(eZdZdZdZdd�ZdS)�InternalNamea7An 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 threated specially by the compiler.
    r,cCstd��dS)NzKCan't create internal names.  Use the `free_identifier` method on a parser.)rF)r5rrrr6GszInternalName.__init__N)zname)rrrrrr6rrrrr�>sr�c@s+eZdZdZdZddd�ZdS)�MarkSafez:Mark the wrapped expression as safe (wrap it as `Markup`).r�NcCs%t||�}t|jj|��S)N)rArr�r�)r5r�rrrr�PszMarkSafe.as_const)zexpr)rrrrrr�rrrrr�Lsr�c@s+eZdZdZdZddd�ZdS)�MarkSafeIfAutoescapez�Mark the wrapped expression as safe (wrap it as `Markup`) but
    only if autoescaping is active.

    .. versionadded:: 2.5
    r�NcCsJt||�}|jr!t��|jj|�}|jrFt|�S|S)N)rAr4rr�r�r3r)r5r�r�rrrr�]s			
zMarkSafeIfAutoescape.as_const)zexpr)rrrrrr�rrrrr�Usr�c@seZdZdZdS)�ContextReferencearReturns 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'))
    N)rrrrrrrrr�gs
r�c@seZdZdZdS)�ContinuezContinue a loop.N)rrrrrrrrr�tsr�c@seZdZdZdS)�Breakz
Break a loop.N)rrrrrrrrr�xsr�c@seZdZdZdZdS)�ScopezAn artificial scope.rlN)zbody)rrrrrrrrrr�|sr�c@seZdZdZdZdS)�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))])
    �optionsN)r�)rrrrrrrrrr��sr�c@seZdZdZdZdS)�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`.
    rlN)zbody)rrrrrrrrrr��sr�cOstd��dS)Nzcan't create custom node types)rF)rxr�rrr�_failing_new�sr�)nr�typesr��collectionsrZjinja2.utilsrZjinja2._compatrrr�FunctionType�
MethodTyper��mul�truediv�floordiv�pow�mod�add�subr��not_�pos�negr�r
rr�ger�ler�r�rr)rrgr0rArBrirjrkrmrorqrvrwrzr|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�r�re�sortedr&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��staticmethodr*rrrr�<module>s�														
�
			,*
-		
		
	

Zerion Mini Shell 1.0