Files
intellecton/venv/lib/python3.12/site-packages/jinja2/__pycache__/nodes.cpython-312.pyc
T

423 lines
57 KiB
Plaintext
Raw Normal View History

Ë
jã
ó UdZddlZddlZddlZddlmZddlmZddl m
Z
ejr
ddl Z
ddlmZej dd ¬
«Zej$ej&ej(ej*ej,ej.ej0d œZej4eej8ej:ej:gej:ffed <ej>ej@ejBd
œZ"ej4eej8ej:gej:ffed<ejFejHejJejLejNejPdddœZ)ej4eej8ej:ej:gej:ffed<Gdde*«Z+Gdde,«Z-Gdd«Z.dd dej^e.de.fdZ0Gdd e-¬«Z1Gdd e1«Z2Gd!„d"e1«Z3Gd#„d$e1«Z4Gd%„d&e2«Z5Gd'„d(e2«Z6Gd)„d*e2«Z7Gd+„d,e2«Z8Gd-„d.e2«Z9Gd/„d0e2«Z:Gd1„d2e2«Z;Gd3„d4e2«Z<Gd5„d6e2«Z=Gd7„d8e2«Z>Gd9„d:e2«Z?Gd;„d<e2«Z@Gd=„d>e2«ZAGd?„d@e2«ZBGdA„dBe2«ZCGdC„dDe1«ZDGdE„dFeD«ZEGdG„dHeD«ZFGdI„dJeD«ZGGdK„dLeD«ZHGdM„dNeD«ZIGdO„dPeI«ZJGdQ„dReI«ZKGdS„dTeI«ZLGdU„dVeI«ZMGdW„dXeI«ZGdY„dZe3«ZNGd[„d\e3«ZOGd]„d^eD«ZPded_d`ej^e.dej˜eej:ej4ej:ej:fffda„ZRGdb„dceD«ZSGdd„deeS«ZTGdf„dgeS«ZUGdh„dieD«ZVGdj„dkeD«ZWGdl„dmeD«ZXGdn„doeD«ZYGdp„dqeD«ZZGdr„dseD«Z[Gdt„due3«Z\Gdv„dweE«Z]Gdx„dyeE«Z^Gdz„d{eE«Z_Gd|„d}eE«Z`Gd~„deE«ZaGd€„deE«ZbGd‚„dƒeE«ZcGd„„d…eE«ZdGd†„d‡eE«ZeGdˆ„d‰eF«ZfGdŠ„deF«ZgGdŒ„deF«ZhGdŽ„deD«ZiGddeD«ZjGd’„d“eD«ZkGd”„d•eD«ZlGd–„d—eD«ZmGd˜„d™eD«ZnGdš„deD«ZoGdœ„deD«ZpGdž„dŸe2«ZqGd „d¡e2«ZrGd¢„d£e2«ZsGd¤„d¥e2«ZtGd¦„d§e2«ZuGd¨„d©eu«Zvdªej:d«ej:dd¬fd­„Zwexew«e-_y[wy)®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_funccó
||vS©©Úbs úO/home/antigravity/intellecton/venv/lib/python3.12/site-packages/jinja2/nodes.pyú<lambda>r-s
q˜Av€ócó
||vSrrrs rrr.s
˜! 1˜*€r)ÚeqÚneÚgtÚgteqÚltÚlteqÚinÚnotinÚ_cmpop_to_funccóeZdZdZy)Ú
Impossiblez8Raised if the node could not perform a requested action.N©Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrr)r)2sÚBrr)cóeZdZdZdZy)Ú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.cóŒdD]}g}|jt|r|dnt|d««|j|j|d««t |«dksJd«t |«t t |««k(sJd«t
|«||<Œ˜|jdd«tj||||«S) N)ÚfieldsÚ
attributesrrrz multiple inheritance not allowedzlayout conflictÚabstractF)
ÚextendÚgetattrÚobjectÚgetÚlenÚsetÚtupleÚ
setdefaultÚtypeÚ__new__)ÚmcsÚnameÚbasesÚattrÚstorages rr>zNodeType.__new__;Ø %ˆDØ13ˆGØ N‰Nœ7©u ¢8¼&À$ÈÓ N‰N˜1Ÿ5™5  r›?Ô u“:  FÐ$FÓ Fw“<¤3¤s¨7£|Ó#4Ò GÐ6GÓ ˜G“nˆAˆdŠGð

Z Ô|‰|˜C  u¨aÓ0rN)r+r,r-r.r>rrrr0r06s ñ 1rr0cóÂeZdZdZ d dddej
eddfdZdejeejffdZ
d ejeejfddfd
Z y) Ú EvalContextzcHolds evaluation time information. Custom attributes can be attached
to it in extensions.
environmentrÚ
template_nameÚreturncó¨||_t|j«r|j|«|_d|_y|j|_d|_y©NF)rGÚcallableÚ
autoescapeÚvolatile)ÚselfrGrHs rÚ__init__zEvalContext.__init__LsKð'ˆÔÜ K× 4°]ÓCˆDŒOðˆ
ð4ˆDŒO؈
rcó6|jj«Sr)Ú__dict__Úcopy©rOs rÚsavezEvalContext.saveVsØ}‰}×#rÚoldcón|jj«|jj|«yr)rRÚclearÚupdate)rOrVs rÚrevertzEvalContext.revertYs$Ø
×ÑÔØ
×ј!rr) r+r,r-r.ÚOptionalÚstrrPÚMappingÚAnyrUrZrrrrFrFGstñð
LPñØØ9:¿¹ÀC¹ðà
óð$a—ii  Q§U¡U 
Ñ"˜!Ÿ)™) ¯© "°Dô"rrFÚnodeÚctxrIcób|€,|j td«t|j«S|S)NzIif no eval context is passed, the node must have an attached environment.)rGÚ RuntimeErrorrF)r`ras rÚget_eval_contextrd^s=Ø
€{Ø × Ñ Ð ðð
ô˜4× €Jrc
ó¢eZdZUdZdZej edfed<dZ ej edfed<dZ
e ed<ejd ed
<dejdejd d fd
Z ddejejedejejed ej ej eejffdZ ddejejedejejed ej dfdZdej&ed ejefdZdej,ej&eej ej&edffd ej efdZded dfdZdde ded dfdZd dZdejd efdZej<Zd efdZd efdZ y )!r 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.r2©ÚlinenorGr3TrgrrGrINc óz|jr td«|rÒt|«t|j«k7r†|js!tt |«j
d«tt |«j
dt|j«dt|j«dk7rd«d«t
|j|«D]\}}t|||«Œ|jD]}t|||j|d««Œ!|r tdtt|«««y) Nz#abstract nodes are not instantiablez takes 0 argumentsz takes 0 or z argumentrÚzunknown attribute ) r4Ú TypeErrorr9r2r=r+ÚzipÚsetattrr3ÚpopÚnextÚiter)rOr2r3r@ÚargrCs rrPz
Node.__init__s/Ø =Š=ÜÐ Ü6‹{œc $§+¡+Ó—{#¤t¨D£z×':Ñ':Ð&=Ð=OÐ$PÓܘD“z×-¨\¼#¸d¿k¹kÓ:JÐ9Kؤs¨4¯;©;Ó'7¸1Ò'< ÐGóðàBDÐGóðô§¡¨fÓ
)‘ ˜˜d 
—O <ˆ D˜$ 
§¡¨t°TÓ :Õ  ÜÐ0´´d¸:Ó6FÓ1GÐ0JÐ  rÚexcludeÚonlyc#ó’K|jD]%}|||||vs|Œ||vsŒ |t||«fŒ'y#t$rYŒ4wxYw­w)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)r2r6ÚAttributeError)rOrrrsr@s rÚ iter_fieldszNode.iter_fields“sgèø€ð—K‘Kò ˆDà T Ð'¨D¸Ñ,?ØÑ°ªðؤ¨¨dÓ 3Ð øôÙðüs*AŸA¥8µA¸ AÁAÁAÁAc#óÄK|j||«D]G\}}t|t«r|D]}t|t«sŒ|ŒŒ3t|t«sŒD|ŒIy­w)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)rvÚ
isinstanceÚlistr )rOrrrsÚitemÚns rÚiter_child_nodeszNode.iter_child_nodes©saèø€ð×°Ó ‰GˆAˆtܘ$¤Ôò ! !¤TÕñ ô˜D¤$Õ
ñ
 ùs>A ÁA ÁA Ú node_typecó6|j|«D]}|cSy)ziFind the first node of a given type. If no such node exists the
return value is `None`.
N)Úfind_all)rOr~Úresults rÚfindz Node.findºs&ð—mm  ˆFØŠMð ðrc#óŒK|j«D]+}t||«r||j|«Ed{Œ-y7Œ­w)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)r}rxr€)rOr~Úchilds rr€z
Node.find_allÃsFèø€ð × 1ˆEܘ% Ô Ø—~‘~ iÓ 
1ús8AºA»Aracó°t|g«}|rG|j«}d|jvr||_|j |j ««|rŒG|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.
ra)rÚpopleftr2rar5r})rOraÚtodor`s rÚset_ctxz Node.set_ctxÎsQô dV}ˆÙØ—<<“>ˆ˜Ÿ ÑØ K‰K˜× ð
ˆ rÚoverridecóÌt|g«}|rU|j«}d|jvr|j|r||_|j |j ««|rŒU|S)z.Set the line numbers of the node and children.rg)rr†r3rgr5r})rOrgr‰r‡r`s rÚ
set_linenozNode.set_linenoÜs[ädV}ˆÙØ—<<“>ˆ˜4Ÿ?™?Ñ—;&©(Ø"(D”KØ K‰K˜× ð ˆ rcó”t|g«}|r9|j«}||_|j|j ««|rŒ9|S)z"Set the environment for all nodes.)rr†rGr5r})rOrGr‡r`s rÚset_environmentzNode.set_environmentçsDädV}ˆÙØ—<<“>ˆ*ˆ Ø K‰K˜× ðˆ rÚothercó t|«t|«urtSt|j««t|j««k(Sr)r=ÚNotImplementedr;rv)rOs rÚ__eq__z Node.__eq__ðs?Ü :œT %›[Ñ  T×(¬E°%×2CÑ2CÓ2EÓ,FÑFrcó‚djˆfdjD««}t«jd|dS), c3óBK|]}|dt|d«Œy­w)ú=N)r6)Ú.0rrOs €rú <genexpr>z Node.__repr__.<locals>.<genexpr>ùs&øèø€ÒTÀ1 ˜s !¤G¨D°!°TÓ$:Ð#=ÔTùsƒú))Újoinr2r=r+)rOÚargs_strs` rÚ__repr__z
Node.__repr__øs9ø€Ø—9‘9ÓÏ É ÔÜt“*×&  Ð3rcóœdtjttjfddfˆˆfd ŠgŠ|«dj «S)Nr`rIcóTt|t«sjt|««yjdt |«j
d«|j sjd«yt|j «D]\}}|rjd«t||«}t|t«rQ‰jd«t|«D] \}}|rjd«|«Œ"jd«Œ†|«Œjd«y)Nznodes.r˜r™r“ú])
rxr ÚappendÚreprr=r+r2Ú enumerater6ry)r`ÚidxÚfieldÚvaluer{Ú_dumpÚbufs €€rzNode.dump.<locals>._dumpýø€Ü˜d¤DÔ
œ4 à J‰J˜¤ 
× 3Ñ 3Ð4°AÐ —;’;Ø
˜3”ØÜ¯ © Ó
!
Ø—J‘J˜tÔ  eÓ,ܘe¤TÔ—J‘J˜s”OÜ%.¨uÓ%5ò$™ ˜˜TÙØŸJ™J tÔ˜d ð—J‘J˜s•Oá˜%•Lð

J‰JsOrrj)r[ÚUnionr r_)rOs @@rÚdumpz Node.dumpüsCù€ð œŸ¤¤a§e¡e  Ñ °ö ð0ˆÙ
ˆdŒ Øw‰wsr©NN)F)rGrrIr )!r+r,r-r.r2r[ÚTupler]Ú__annotations__r3r4Úintr\r_rPÚ ContainerÚIteratorrvr}ÚTyperrr€rˆÚboolrrrr7Ú__hash__rœrrrr r isñð !#€FˆAG‰GC˜ Ó"Ø$=€J˜˜S˜Ñ€Hà ƒKؘMÑM §¡ðM°Q·U±UðM¸Mð(15Ø-1ñà˜AŸK™K¨Ñðj‰j˜Ÿ SÑð
A—GG˜C §¡˜'Ñ (ó ð015Ø-1ñà˜AŸK™K¨Ñðj‰j˜Ÿ SÑð
ó ð"˜aŸf™f °Q·Z±ZÀ
Ñ5Kóð Ÿ §¡¨
Ñ!3°Q·W±W¸Q¿V¹VÀJÑ=OÐQTÐ=TÑ5UÐ!UÑ 
ó  ˜3ð  6ó ñ  ð °ð Àó óðG˜AŸE™EðG dóGð €Hð4˜#ór)Ú metaclasscóeZdZdZdZy)ÚStmtzBase node for all statements.TN©r+r,r-r.r4rrrs
ÙHrcóeZdZdZdZy)ÚHelperz,Nodes that exist in a specific context only.TNr·rrr s
ÙHrcó:eZdZUdZdZej eed<y)ÚTemplatezjNode that represents a template. This must be the outermost node that
is passed to the compiler.
©Úbodyr½N© r+r,r-r.r2r[ÚListr r­rrr&sñð€FØ
&‰&‰,Ôrcó:eZdZUdZdZej ded<y)ÚOutputzA 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.r2r[r¿r­rrr/sñð€FØ 6‰6&‰>Ôrcó eZdZUdZdZded<y)ÚExtendsz Represents an extends statement.)ÚtemplaterÄN)r+r,r-r.r2r­rrr8sÙ
€FØÔrcó eZdZUdZdZeed<eed<ejeed<ejeed<ejeed<e
ed<y )
Ú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`.
)ÚtargetrpÚelse_ÚtestÚ recursiverÊrpN) r+r,r-r.r2r r­r[r¿r\rrr?sIñðF€FØ ƒLØ
ƒJØ
&‰&‰,ÓØ 6‰6$‰<ÓØ
*‰*
ÓØ„OrcóŒeZdZUdZdZeed<ejeed<ejded<ejeed<y)ÚIfz4If `test` is true, `body` is rendered, else `else_`.)Úelif_rËN) r+r,r-r.r2r r­r[r¿rrrQs9Ù
/€FØ
ƒJØ
&‰&‰,ÓØ 6‰6$‰<ÓØ 6‰6$‰<ÔrcóŒeZdZUdZdZeed<ejded<ejded<eje ed<y )
Ú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ÓN)
r+r,r-r.r2r]r­r[r¿r rrr[s=ñð
2€FØ
ƒIØ
&‰&‰.ÓØf‰fV‰nÓØ
&‰&‰,ÔrcóŒeZdZUdZdZded<ejded<ejded<ejeed <y
) Ú 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ÓÚCallrØN) r+r,r-r.r2r­r[r¿r rrrr×r×hs=ñð2€FØ
ƒLØ
&‰&‰.ÓØf‰fV‰nÓØ
&‰&‰,Ôrr×cóDeZdZUdZdZej eed<ded<y)Ú FilterBlockzNode for filter sections.)Úfilterr½ÚFilterrÜNr¾rrrtsÙ
€FØ
&‰&‰,ÓØ Ôrcó‚eZdZUdZdZej ded<ej ded<ej eed<y)Ú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½N) r+r,r-r.r2r[r¿r­r rrr|s8ñð +€FØ
V‰VF‰^ÓØ
F‰F6‰NÓØ
&‰&‰,ÔrcóXeZdZUdZdZeed<eje ed<e
ed<e
ed<y)ÚBlockzkA node that represents a block.
.. versionchanged:: 3.0.0
the `required` field was added.
)r@ÚscopedÚrequiredr@N) r+r,r-r.r2r]r­r[r¿r rrrs+ñð 4€FØ
ƒIØ
&‰&‰,ÓØ ƒLØ„Nrcó4eZdZUdZdZded<eed<eed<y)ÚIncludez'A node that represents the include tag.)Ú with_contextÚignore_missingrÄN)r+r,r-r.r2r­rrrsÙ
;€FØÓØÓØÔrcó4eZdZUdZdZded<eed<eed<y)ÚImportz&A node that represents the import tag.)N)r+r,r-r.r2r­r]rrr sÙ
3€FØÓØ ƒKØÔrcóŠeZdZUdZdZded<ejeje eje e ffed<e ed<y)Ú
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.
)ÚnamesrèN) r+r,r-r.r2r­r[r¿r]rrr©sDñ ð3€FØÓØ 6‰6!—''˜#˜qŸw™w s¨C  Ôrcó eZdZUdZdZeed<y)ÚExprStmtzAA statement that evaluates an expression and discards the result.©r`r`N)r+r,r-r.r2r r­rrr»sÙ
€FØ
„Jrcó*eZdZUdZdZded<eed<y)ÚAssignz"Assigns an expression to a target.)r`r`N)r+r,r-r.r2r­r rrrÂsÙ
€FØ ƒNØ
„JrcóheZdZUdZdZded<ejded<eje ed<y) Ú AssignBlockzAssigns a block to a target.)N)
r+r,r-r.r2r­r[r\r¿r rrrÊs,Ù
)€FØ ƒNØ
J‰J Ó Ø
&‰&‰,Ôrcó`eZdZdZdZddej edejfdZ de
fdZ y) rÄzBaseclass for all expressions.TNÚeval_ctxrIcót«)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)©rOs rÚas_constz
Expr.as_constØs ôrcóy)z8Check if it's possible to assign something to this node.FrrTs rÚ
can_assignzExpr.can_assignåsàrr) r+r,r-r.r4r[r\rFr_rrrÓs6Ù€Hñ  §¡¨KÑ!8ð ÀAÇEÁEó ð˜DôrcóxeZdZUdZdZeed<eed<eed<dZd de je d e jfd
Z
y) ÚBinExprz%Baseclass for all binary expressions.)ÚleftÚrightrÿrÚoperatorTNr÷rIcótt||«}|jjr,|j|jjvr
t «t |j} ||jj|«|jj|««S#t$r}t «|d}~wwxYwr) rdrGÚ sandboxedrÚintercepted_binopsr)rrÿrÚ Exception©rOÚes rzBinExpr.as_constós—Ü# D¨(Óð
× Ñ × 
 ×!5Ñ!5×!HÑ!HÑ“,Ð Ü ˜4Ÿ=™=Ñ )ˆðT—YY×Ó1°4·:±:×3FÑ3FÀxÓ3PÓ QøÜò“,  %ûð &úsÁ#:B B7Â' B2Â2B7r©r+r,r-r.r2r­r]r4r[r\rFr_rrrês>Ù
€FØ
ƒJØ ƒK؃MØ€Hñ
& §¡¨KÑ!8ð
&ÀAÇEÁEô
&rcóneZdZUdZdZeed<eed<dZd
de je de jfd „Z
y) Ú UnaryExprz$Baseclass for all unary expressions.rñr`rTNr÷rIcó@t||«}|jjr,|j|jjvr
t «t |j} ||jj|««S#t$r}t «|d}~wwxYwr)
rdrGrrÚintercepted_unopsr)rr`rrs rzUnaryExpr.as_const s†Ü# D¨(Óð
× Ñ × 
 ×!5Ñ!5×!GÑ!GÑ“,Ð Ü ˜$Ÿ-™-Ñ (ˆðT—YY×Ó 2øÜò“,  %ûð &úsÁ# B BÂ
BÂBrr rrrr r s9Ù
€FØ
ƒJ؃MØ€Hñ
& §¡¨KÑ!8ð
&ÀAÇEÁEô
&rr có6eZdZUdZdZeed<eed<defdZy)a Looks 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@rar@rarIcó|jdvS)N>ÚNoneÚTrueÚnoneÚtrueÚFalseÚfalse©r@rTs rzName.can_assign(sØy‰yÐ RÐRrN© r+r,r-r.r2r]r­rrrs&ñð€FØ
ƒIØ ƒHðS˜Srcó6eZdZUdZdZeed<eed<defdZy)ÚNSRefz)Reference to a namespace value assignment)r@rCr@rCrIcóy)NTrrTs rzNSRef.can_assign3sð
rNrrrrrr,s Ù
€FØ
ƒIØ
ƒIð˜rrcóeZdZdZdZy)ÚLiteralzBaseclass for literals.TNr·rrrrr;s
ÙHrrc
óÊeZdZUdZdZej ed<d deje dej fdZ
e d
dej deje d d
ddfd «Z
y)Ú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).
©Nr÷rIcó|jSrrs rzConst.as_constKs Øz‰zÐrrgrGzt.Optional[Environment]cóHddlm}||«s
t«||||¬«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_reprrf)Úcompilerr"r))Úclsr¦rgrGr"s rÚfrom_untrustedzConst.from_untrustedNs&õ˜“,Ð Ù°[ÔArr)r+r,r-r.r2r[r_r­r\rFÚ classmethodr®r%rrrrrAs‹ñð €FØ 5‰5ƒLñ §¡¨KÑ!8ðÀAÇEÁEóðð#'Ø15ñ Bàu‰uðBð
˜3‘ðBðBð
ò BóñBrrcóLeZdZUdZdZeed<ddeje defdZ
y) Ú TemplateDatazA constant template string.)Údatar)Nr÷rIcó t||«}|jr
t«|jrt |j
«S|j
Sr)rdrNr)rMrr)s rzTemplateData.as_constfsAÜ# D¨(ÓØ × Ò Ü“,Ð Ø × Ò Ü˜$Ÿ)™)Ó y‰yÐrr) r+r,r-r.r2r]r­r[r\rFrrrr(r(`s+Ù
€FØ
ƒIñ §¡¨KÑ!8ðÀCôrr(có®eZdZUdZdZej eed<e ed<d deje dejejdffd „Zdefd
Zy) 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.
)Úitemsrar,raNr÷rI.cóXt|«Štˆfd|jD««S)Nc3ó@K|]}|j«Œy­wr©©r–Úxr÷s €rr—z!Tuple.as_const.<locals>.<genexpr>{søèø€Ò>¨aQ—Z‘Z ×>ùóƒ)rdr;r,s `rzTuple.as_constys$ø€Ü# D¨(Ó3ˆÜÓ>°4·:±:Ô>rcóJ|jD]}|j«rŒyy)NFT)r,)rOr{s rzTuple.can_assign}s'Ø—J ˆDØ—?‘?Õð ðrr)r+r,r-r.r2r[r¿r­r]r\rFr_rrros[ñð
€FØ 6‰6$‰<ÓØ ƒHñ? §¡¨KÑ!8ð?ÀAÇGÁGÈAÏEÉEÐSVÈJÑDWó˜rcó”eZdZUdZdZej eed<ddeje
dej ejfdZ y) r¿z&Any list literal such as ``[1, 2, 3]``©r,r,Nr÷rIcóvt||«}|jDcgc]}|j|«Œc}Scc}wr)rdr,)rOr1s rz
List.as_constŠs/Ü# D¨(Ó3ˆØ.2¯j©jÖ
˜8Õ9ùÒ9s6r)
r+r,r-r.r2r[r¿r­r\rFr_rrrr¿r¿s@Ù
€FØ 6‰6$‰<Óñ: §¡¨KÑ!8ð:ÀAÇFÁFÈ1Ï5É5ÁMô:rr¿có®eZdZUdZdZej ded< d deje dejejejffdZ y)
ÚDictzeAny dict literal such as ``{1: 2, 3: 4}``. The items must be a list of
:class:`Pair` nodes.
r5ÚPairr,Nr÷rIcóXt|«Štˆfd|jD««S)Nc3ó@K|]}|j«Œy­wrr/r0s €rr—z Dict.as_const.<locals>.<genexpr>søèø€Ò=¨QA—JJ˜=ùr2)rdÚdictr,s `rz
Dict.as_const—s&ø€ô$ D¨(ÓÜÓ=°$·*±*Ô=rr)
r+r,r-r.r2r[r¿r­r\rFr8r_rrrr8r8sTñð€FØ 6‰6&‰>Óð37ñŸ
 
q—uu Ñ ô>rr8cóžeZdZUdZdZeed<eed< d deje dejejejffdZ y)
r9zA key, value pair for dicts.©Úkeyr¦r?Nr÷rIcó†t||«}|jj|«|jj|«fSr)rdr?s rz
Pair.as_const¥s9ô$ D¨(ÓØx‰x× Ñ  Ó*¨D¯J©J×,?Ñ,?ÀÓ,IÐIrr)
r+r,r-r.r2r­r[r\rFr_rrrr9r9žsOÙ
€FØ
ƒIØ ƒKð37ñJØŸ
 Jà
˜ŸÑ ôJrr9cóˆeZdZUdZdZeed<eed<d deje
dejeejffdZ
y)
ÚKeywordz>A key, value pair for keyword arguments where key is a string.r>r?Nr÷rIcóht||«}|j|jj|«fSr)rdr?s rzKeyword.as_const³s,Ü# D¨(ÓØx‰x˜Ÿ×,¨XÓ6rr)r+r,r-r.r2r]r­r[r\rFr_rrrrBrB¬sDÙ
€FØ ƒHØ ƒKñ§¡¨KÑ!8ð7ÀAÇGÁGÈCÐQR×QVÑQVÈJÑDWô7rrBcóŽeZdZUdZdZeed<eed<ejeed<d
deje dejfd „Z y) ÚCondExprzZA conditional expression (inline if expression). (``{{
foo if bar else baz }}``)
)Úexpr1Úexpr2rÌrFrGNr÷rIcóèt||«}|jj|«r|jj|«S|j
t «|jj|«Sr)rdrFrGr)s rzCondExpr.as_constÂs^Ü# D¨(ÓØ 9‰9× Ñ ˜ —::×&   :‰:Ð Ü“,Ð àz‰z×" ,rr) r+r,r-r.r2r­r[r\rFr_rrrrErE¸sGñð(€FØ
ƒJØ ƒKØ :‰: Óñ §¡¨KÑ!8ð -ÀAÇEÁEô -rrE)Ú_FilterTestCommonrÙcóö|jDcgc]}|j«Œ}}tˆfd|jD««}|j+ |j |jj««|j/ |j|jj««||fS||fScc}w#t $r}t«|d}~wwxYw#t $r}t«|d}~wwxYw)Nc3ó@K|]}|j«Œy­wrr/r0s €rr—z args_as_const.<locals>.<genexpr>Òsøèø€Ò<¨1!—**˜X×<ùr2)
r<ÚkwargsÚdyn_argsr5rr)Ú
dyn_kwargsrY)r`r1rLrs ` rÚ
args_as_constrOÎø€ð+/¯)©)Ö 4 QˆAJ‰J Ð 4€DÐ
Ó· ± Ô
<€Fà ‡} ð K‰K˜Ÿ
×.¨xÓ  Ð M‰M˜$Ÿ/™/×2°8Ó  ˆˆ4ˆùò 5øô ò“,  %ûð &ûô ò“,  %ûð &ús5B>Á*C *Cà Cà CÃCà C8Ã( C3Ã3C8cóþeZdZUdZeed<eed<ejeed<eje ed<ejeed<ejeed<dZ dZ d
d
eje
d ejfd Zy )rI)r`r@rLrMrNr`r@rLrMrNTNr÷rIcó@t||«}|jr
t«|jr|jj
}n|jj }|j|j«}tj|«}||tjur
t«|jjr.t|dd«dustj|«r
t«t!||«\}}|j#d|j$j'|««|tj(ur|j#d|«n.|tjur|j#d|j« ||i|¤ŽS#t*$r}t«|d}~wwxYw)jinja_async_variantFTr)rdrNr)Ú
_is_filterrGÚfiltersÚtestsr8r@rÚfrom_objÚcontextÚis_asyncr6ÚinspectÚiscoroutinefunctionrOÚinsertr`Ú eval_contextr)rOÚenv_mapÚfuncÚpass_argrÓrLrs rz_FilterTestCommon.as_constîsUÜ# D¨(Óà × Ò Ü“,Ð à ?Š?Ø×2‰Gà×0ˆGà{‰{˜4Ÿ9™9ÓÜ×$ TÓ*ˆà ˆ<˜8¤x×'7Ñ'7Ñ“,Ð à × Ñ × Ó 7¸4Ñ ×*¨4Ô“,Ð ä$ T¨8Ó4‰ ˆˆfØ At—y‘y×)¨(Ó ”x× K‰K˜˜8Õ
œ×
K‰K˜˜8× ˜Ð( Ñ (øÜò“,  %ûð &úsÅ<FÆ FÆ
FÆFr)r+r,r-r2r­r]r[r¿r9r\r4rSrFr_rrrrIrIãsuØ
I€FØ
ƒJØ
ƒIØ
&‰&‰,ÓØ
F‰F4‰LÓØj‰j˜ÑÓØ
˜4Ñ Ó Ø€HØ€Jñ"& §¡¨KÑ!8ð"&ÀAÇEÁEô"&rrIcó‚eZdZUdZej
eed<ddej
edejfˆfd
Z
ˆxZ S)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.
r`rIcóP|j
t«t|
|¬«S)N))r`r)Úsuperrú)rOÚ __class__s €rzFilter.as_consts(ø€Ø 9‰9Ð Ü“,Ð ä‰wѨÐÓ2rr) r+r,r-r.r[r\r­rFr_Ú
__classcell__)rcs@rs>ø…ñð *‰*
Óñ§¡¨KÑ!8ð3ÀAÇEÁE÷3rcóeZdZdZdZy)Ú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.rSrrrrfrf$sñðJrrfcó°eZdZUdZdZeed<ejeed<eje ed<ejeed<ejeed<y) 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.
)r`rLrMrNr`rLrMrNN) r+r,r-r.r2r­r[r¿rBr\rrr1sNñðB€FØ
ƒJØ
&‰&‰,ÓØ
F‰F7‰OÓØj‰j˜ÑÓØ
˜4Ñ Ô rcóteZdZUdZdZeed<eed<eed<d
deje
dejfd „Z y) ÚGetitemz@Get an attribute or item from an expression and prefer the item.)r`rqrar`rqraNr÷rIcó"|jdk7r
t«t||«} |jj |j
j
|«|jj
|««S#t$r}t«|d}~wwxYw©load) rar)rdrGÚgetitemr`rqr©rOrs rzGetitem.as_constIsØ 8‰8 Ü“,Ð ä# D¨(Ó3ˆð×'× ×" ,¨d¯h©h×.?Ñ.?ÀÓ.Ióð
øôò“,  %ûð &ús§A
A5Á5 BÁ> B Â Br©
r+r,r-r.r2r­r]r[r\rFr_rrrririAs9Ù
#€FØ
ƒJØ
ƒIØ ƒHñ & §¡¨KÑ!8ð &ÀAÇEÁEô &rricóteZdZUdZdZeed<eed<eed<d
deje
dejfd „Z y) ÚGetattrznGet an attribute or item from an expression that is a ascii-only
bytestring and prefer the attribute.
)r`rCrar`rCraNr÷rIcó|jdk7r
t«t||«} |jj |j
j
|«|j«S#t$r}t«|d}~wwxYwrk) rar)rdrGr6r`rCrrns rzGetattr.as_constasmØ 8‰8 Ü“,Ð ä# D¨(Ó3ˆð×'×· ± ×0BÑ0BÀ8Ó0LÈdÏiÉiÓ XøÜò“,  %ûð &ús§>A&Á& A?Á/ A:Á:A?rrorrrrqrqWs=ñð%€FØ
ƒJØ
ƒIØ ƒHñ & §¡¨KÑ!8ð &ÀAÇEÁEô &rrqcó®eZdZUdZdZej eed<ej eed<ej eed<d
dej e de
fd „Z y) ÚSlicez_Represents a slice object. This must only be used as argument for
:class:`Subscript`.
)ÚstartÚstopÚsteprurvrwNr÷rIcót|«Šdtjtdtjtjfˆfd }t ||j «||j«||j««S)objrIcó,|y|j«Srr/)rys €rÚconstzSlice.as_const.<locals>.constzsø€ØˆØ—<< Ó )r) rdr[r\r_Úslicerurvrw)rOr{s ` rzSlice.as_constwsdø€Ü# D¨(Ó3ˆð *”q—zz¤$Ñ *¬A¯J©J´q·u±uÑ,=õ
U˜4Ÿ:™:Ó¨d¯i©iÓ(8¹%ÀÇ Á Ó:JÓKrr) r+r,r-r.r2r[r\r­rFr|rrrrtrtmsZñð'€FØ :‰: ÓØ
*‰*
ÓØ
*‰*
ÓñL §¡¨KÑ!8ðLÀEôLrrtcófeZdZUdZdZej eed<ddeje
de fdZ y) ÚConcatzXConcatenates the list of expressions provided after converting
them to strings.
Nr÷rIcódt|«Šdjˆfd|jD««S)Nrjc3óRK|]}t|j««Œ y­wr)r]r0s €rr—z"Concat.as_const.<locals>.<genexpr>Œsøèø€ÒE°Q”s˜1Ÿ:™: hÓ/×Eùsƒ$')rds `rzConcat.as_constŠs(ø€Ü# D¨(ÓØw‰wÓE¸$¿*¹*ÔErr)
r+r,r-r.r2r[r¿r­r\rFr]rrrr~r~s;ñð€FØ 6‰6$‰<ÓñF §¡¨KÑ!8ðFÀCôFrr~có„eZdZUdZdZeed<ejded<d
deje
dejfd „Z y) ÚCompareziCompares an expression with some other expressions. `ops` must be a
list of :class:`Operand`\s.
)ÚexprÚopsrƒÚOperandr„Nr÷rIcó*t||«}|jj|«x}} |jD]<}|jj|«}t |j
||«}|sy|}Œ> |S#t $r}t«|d}~wwxYwrK)rdr„r'Úoprr))rOrr‡Ú new_valuers rzCompare.as_const˜sÜ# D¨(ÓØŸ×+¨HÓð
—h
"ØŸG™G×,¨XÓ6 ܯ©Ñ.¨u°iÓ@áÙ à!‘ñ
ˆ
øôò“,  %ûð &ús«AA9Á2A9Á9 BÂ B
Â
Br)
r+r,r-r.r2r­r[r¿r\rFr_rrrrrsBñð€FØ
ƒJØ
 Ñ Óñ §¡¨KÑ!8ðÀAÇEÁEôrrcó*eZdZUdZdZeed<eed<y)r…z$Holds an operator and an expression.)r‡r‡N)r+r,r-r.r2r]r­rrrr…r…«sÙ
€FØ ƒGØ
„Jrr…cóeZdZdZdZy)ÚMulz(Multiplies the left with the right node.r r+r,r-r.rrrrrr³s
ÙHrrcóeZdZdZdZy)ÚDivz#Divides the left by the right node.r NrŒrrr¹s
ÙHrcóeZdZdZdZy)ÚFloorDivzbDivides the left by the right node and converts the
result into an integer by truncating.
r
NrŒrrrrr¿sñðHrrcóeZdZdZdZy)ÚAddzAdd the left to the right node.rNrŒrrrrrÇs
ÙHrrcóeZdZdZdZy)ÚSubz&Subtract the right from the left node.rNrŒrrrr”r”Ís
ÙHrr”cóeZdZdZdZy)ÚModzLeft modulo right.rNrŒrrrrrÓs
ÙàHrr–cóeZdZdZdZy)ÚPowzLeft to the power of right.rNrŒrrrr˜r˜Ùs
ÙHrr˜cóTeZdZdZdZddej edejfdZ y)ÚAndzShort circuited AND.ÚandNr÷rIcóŠt||«}|jj|«xr|jj|«Sr©rdrÿrs rz And.as_constäs7Ü# D¨(Ó3ˆØy‰y×! (Ó·
±
×0CÑ0CÀHÓ0MÐMrr©
r+r,r-r.rr[r\rFr_rrrßs-Ùà€HñN §¡¨KÑ!8ðNÀAÇEÁEôNrcóTeZdZdZdZddej edejfdZ y)ÚOrzShort circuited OR.ÚorNr÷rIcóŠt||«}|jj|«xs|jj|«Srrs rz Or.as_constîs7Ü# D¨(Ó3ˆØy‰y×! L¨t¯z©z×/BÑ/BÀ8Ó/LÐLrrrrrr r és-Ùà€HñM §¡¨KÑ!8ðMÀAÇEÁEôMrr cóeZdZdZdZy)ÚNotzNegate the expression.rNrŒrrrós
Ù àHrcóeZdZdZdZy)ÚNegzMake the expression negative.rNrŒrrrùs
ÙHrcóeZdZdZdZy)ÚPosz8Make the expression positive (noop for most expressions)rNrŒrrrÿs
ÙHrcó eZdZUdZdZeed<y)ÚEnvironmentAttributezLoads an attribute from the environment object. This is useful for