[~ph x UdZddlZddlZddlZddlmZddlmZddl m Z ej r ddl Z ddlmZejdd Zejejejejejejejd Zejeejejejgejffed <ejej ej!d Z"ejeejejgejffed<ej#ej$ej%ej&ej'ej(dddZ)ejeejejejgejffed<Gdde*Z+Gdde,Z-GddZ.dd dej/e.de.fdZ0Gdd e-Z1Gdd e1Z2Gd!d"e1Z3Gd#d$e1Z4Gd%d&e2Z5Gd'd(e2Z6Gd)d*e2Z7Gd+d,e2Z8Gd-d.e2Z9Gd/d0e2Z:Gd1d2e2Z;Gd3d4e2Z<Gd5d6e2Z=Gd7d8e2Z>Gd9d:e2Z?Gd;de2ZAGd?d@e2ZBGdAdBe2ZCGdCdDe1ZDGdEdFeDZEGdGdHeDZFGdIdJeDZGGdKdLeDZHGdMdNeDZIGdOdPeIZJGdQdReIZKGdSdTeIZLGdUdVeIZMGdWdXeIZGdYdZe3ZNGd[d\e3ZOGd]d^eDZPdejQd_d`ej/e.dejLejMejejejejfffdaZRGdbdceDZSGdddeeSZTGdfdgeSZUGdhdieDZVGdjdkeDZWGdldmeDZXGdndoeDZYGdpdqeDZZGdrdseDZ[Gdtdue3Z\GdvdweEZ]GdxdyeEZ^Gdzd{eEZ_Gd|d}eEZ`Gd~deEZaGddeEZbGddeEZcGddeEZdGddeEZeGddeFZfGddeFZgGddeFZhGddeDZiGddeDZjGddeDZkGddeDZlGddeDZmGddeDZnGddeDZoGddeDZpGdde2ZqGdde2ZrGdde2ZsGdde2ZtGdde2ZuGddeuZvdejdejddfdZwexewe-_y[wdS)zAST 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 _NodeBoundNode)bound)*///**%+-_binop_to_func)notrr _uaop_to_funcc ||vSNabs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/jinja2/nodes.pyr+s qAvc ||vSrrrs rrr,s !1*r)eqnegtgteqltlteqinnotin_cmpop_to_funcceZdZdZdS) Impossiblez8Raised if the node could not perform a requested action.N__name__ __module__ __qualname____doc__rrrr)r)0sBBBBrr)ceZdZdZdZdS)NodeTypezA metaclass for nodes that handles the field and attribute inheritance. fields and attributes from the parent class are automatically forwarded to the child.cdD]}g}|t|r|dnt|d|||dt |dks Jdt |t t |ks Jdt |||<|ddt ||||S) N)fields attributesrrrz multiple inheritance not allowedzlayout conflictabstractF) extendgetattrobjectgetlensettuple setdefaulttype__new__)mcsnamebasesdattrstorages rr>zNodeType.__new__9s* % %DG NN7u#@588&$KK L L L NN155r?? + + +u::???$F???w<<3s7||#4#44446G444GnnAdGG Z'''||Cua000rN)r+r,r-r.r>rrrr0r04s--- 1 1 1 1 1rr0ceZdZdZ d dddejeddfdZdejeej ffdZ d ejeej fddfd Z dS) EvalContextzcHolds evaluation time information. Custom attributes can be attached to it in extensions. N environmentr template_namereturnc||_t|jr|||_n |j|_d|_dSNF)rGcallable autoescapevolatile)selfrGrHs r__init__zEvalContext.__init__JsK' K* + + 5)44]CCDOO)4DO rc4|jSr)__dict__copyrOs rsavezEvalContext.saveTs}!!###roldcl|j|j|dSr)rRclearupdate)rOrVs rrevertzEvalContext.revertWs2  S!!!!!rr) r+r,r-r.tOptionalstrrPMappingAnyrUrZrrrrFrFEs LP(9:C $aiQU +$$$$"!)CJ/"D""""""rrFnodectxrIc^|*|jtdt|jS|S)NzIif no eval context is passed, the node must have an attached environment.)rG RuntimeErrorrF)r`ras rget_eval_contextrd\s? {   #) 4+,,, Jrc eZdZUdZdZejedfed<dZ ejedfed<dZ e ed<ej d ed <dej dej d d fd Z ddej ejedej ejed ejejeej ffdZ ddej ejedej ejed ejdfdZdejed ej efdZdejejeejejedffd ejefdZded dfdZd de ded dfdZd!dZdej d efdZejZd efdZd efdZ d S)"r aBaseclass 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.r2linenorGr3TrgrrGrINc |jrtd|rt|t|jkr|js$tt |jdtt |jdt|jdt|jdkrdndt |j|D]\}}t||||jD]'}t||| |d(|r,tdtt|dS) Nz#abstract nodes are not instantiablez takes 0 argumentsz takes 0 or z argumentrszunknown attribute ) r4 TypeErrorr9r2r=r+zipsetattrr3popnextiter)rOr2r3r@argrCs rrPz Node.__init__sy = CABB B  )6{{c$+....{R#tDzz':$P$P$PQQQDzz*GG#dk:J:JGG'*4;'7'71'<'<"GG!f55 ) ) cdC((((O < >D ## KK--// 0 0 0  1  rFoverridect|g}|rV|}d|jvr|j|r||_|||V|S)z.Set the line numbers of the node and children.rg)rrr3rgr5r})rOrgrrr`s r set_linenozNode.set_linenostdV}} 1<<>>D4?**;&(&"(DK KK--// 0 0 0  1  rct|g}|rD|}||_|||D|S)z"Set the environment for all nodes.)rrrGr5r})rOrGrr`s rset_environmentzNode.set_environments[dV}} 1<<>>D*D  KK--// 0 0 0 1 rotherct|t|urtSt|t|kSr)r=NotImplementedr;rv)rOrs r__eq__z Node.__eq__sR ::T%[[ ( (! !T%%''((E%2C2C2E2E,F,FFFrcdfdjD}tjd|dS)N, c3DK|]}|dt|dVdS)=N)r6).0rrOs r z Node.__repr__..s=TT1>>GD!T$:$:>>TTTTTTr())joinr2r=r+)rOargs_strs` r__repr__z Node.__repr__sK99TTTT TTTTTt**%333333rcdtjttjfddffd g|dS)Nr`rIct|ts$t|dSdt |jd|jsddSt|jD]\}}|rdt||}t|trbdt|D]'\}}|rd|(d|ddS)Nznodes.rrr[]) rxr appendreprr=r+r2 enumerater6ry)r`idxfieldvaluer{_dumpbufs rrzNode.dump.._dumpsUdD))  4::&&& JJ6T 3666 7 7 7;  3' 44 ! ! U%JJt$$$e,,eT**!JJsOOO%.u%5%5$$ T-JJt,,,d JJsOOOOE%LLLL JJsOOOOOrrj)r[Unionr r_r)rOrrs @@rdumpz Node.dumpsf ae ,        0 d wws||rNN)F)rGrrIr )!r+r,r-r.r2r[Tupler]__annotations__r3r4intr\r_rP ContainerIteratorrvr}Typerrrrrboolrrrr7__hash__rrrrrr r gs !#FAGCH """$=JS!===H KKKM****MMQUMtMMMM(15-1AK,-jS)* AGCJ' ( 015-1AK,-jS)* F  "afZ0QZ 5K 1 !3QWQVJ=OQT=T5U!UV 1 J  1 1 1 1 3 6            GAEGdGGGG H4#4444cr) metaclassceZdZdZdZdS)StmtzBase node for all statements.TNr+r,r-r.r4rrrrrs''HHHrrceZdZdZdZdS)Helperz,Nodes that exist in a specific context only.TNrrrrrrs66HHHrrc8eZdZUdZdZejeed<dS)TemplatezjNode that represents a template. This must be the outermost node that is passed to the compiler. bodyrN r+r,r-r.r2r[Listr rrrrrr$s5F &,rrc8eZdZUdZdZejded<dS)OutputzA node that holds multiple expressions which are then printed out. This is used both for the `print` statement and the regular template data. nodesExprrN)r+r,r-r.r2r[rrrrrrr-s5F 6&>rrc"eZdZUdZdZded<dS)Extendsz Represents an extends statement.)templaterrN)r+r,r-r.r2rrrrrr6s)** FrrceZdZUdZdZeed<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`. )targetrprelse_test recursiverrprrrrN) r+r,r-r.r2r rr[rr\rrrrrr=stFF LLL JJJ &, 6$< *T OOOOOrrceZdZUdZdZeed<ejeed<ejded<ejeed<dS)Ifz4If `test` is true, `body` is rendered, else `else_`.)rrelif_rrrrrN) r+r,r-r.r2r rr[rrrrrrOs\>> /F JJJ &, 6$< 6$<rrceZdZUdZdZeed<ejded<ejded<eje ed<d S) MacrozA 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@argsdefaultsrr@NamerrrrN) r+r,r-r.r2r]rr[rr rrrrrYsb 2F III &.fVn &,rrceZdZUdZdZded<ejded<ejded<ejeed <d S) CallBlockzLike a macro without a name but a call instead. `call` is called with the unnamed macro as `caller` argument this node holds. )callrrrCallrrrrrrN) r+r,r-r.r2rr[rr rrrrrfsb2F LLL &.fVn &,rrcBeZdZUdZdZejeed<ded<dS) FilterBlockzNode for filter sections.)rfilterrFilterrNrrrrrrrs;## F &, rrcxeZdZUdZdZejded<ejded<ejeed<dS)WithzSpecific 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 )targetsvaluesrrrrrN) r+r,r-r.r2r[rrr rrrrrzsY +F VF^ F6N &,rrcVeZdZUdZdZeed<eje ed<e ed<e ed<dS)BlockzkA node that represents a block. .. versionchanged:: 3.0.0 the `required` field was added. )r@rscopedrequiredr@rrrN) r+r,r-r.r2r]rr[rr rrrrrrsN 4F III &, LLLNNNNNrrc6eZdZUdZdZded<eed<eed<dS)Includez'A node that represents the include tag.)r with_contextignore_missingrrrrN)r+r,r-r.r2rrrrrrrsA11 ;Frrc6eZdZUdZdZded<eed<eed<dS)Importz&A node that represents the import tag.)rrrrrrrN)r+r,r-r.r2rr]rrrrrrs>00 3F KKKrrceZdZUdZdZded<ejeje ej e e ffed<e ed<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. )rnamesrrrrrN) r+r,r-r.r2rr[rrr]rrrrrrrse  3F 6!'#qwsCx001 2222rrc"eZdZUdZdZeed<dS)ExprStmtzAA statement that evaluates an expression and discards the result.r`r`N)r+r,r-r.r2r rrrrrrs$KK F JJJJJrrc,eZdZUdZdZded<eed<dS)Assignz"Assigns an expression to a target.)rr`rrr`N)r+r,r-r.r2rr rrrrrs-,, F NNN JJJJJrrcbeZdZUdZdZded<ejded<eje ed<dS) AssignBlockzAssigns a block to a target.)rrrrrrrrN) r+r,r-r.r2rr[r\rr rrrrrsK&& )F NNN Jx    &,rrcTeZdZdZdZddejedejfdZ de fdZ dS) rzBaseclass for all expressions.TNeval_ctxrIct)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)rOrs ras_constz Expr.as_constsllrcdS)z8Check if it's possible to assign something to this node.FrrTs r can_assignzExpr.can_assignsurr) r+r,r-r.r4r[r\rFr_rrrrrrrrsj((H  K!8 AE    DrrcleZdZUdZdZeed<eed<eed<dZd de j e d e j fd Z dS) BinExprz%Baseclass for all binary expressions.)leftrightrroperatorTNrrIc\t||}|jjr!|j|jjvrt t |j} ||j||j |S#t$r}t |d}~wwxYwr) rdrG sandboxedrintercepted_binopsr)rrrr ExceptionrOrfes rrzBinExpr.as_consts#D(33  *  !5!HHH,,  4= ) &1TY''114:3F3Fx3P3PQQ Q & & &,,A % &s;B B+B&&B+rr+r,r-r.r2rrr]r4r[r\rFr_rrrrrrsq// F JJJ KKKMMMH & &K!8 &AE & & & & & &rrcbeZdZUdZdZeed<eed<dZd de j e de j fd Z dS) UnaryExprz$Baseclass for all unary expressions.rr`rTNrrIc*t||}|jjr!|j|jjvrt t |j} ||j|S#t$r}t |d}~wwxYwr) rdrGrrintercepted_unopsr)rr`rrrs rrzUnaryExpr.as_const s#D(33  *  !5!GGG,,  $- ( &1TY''1122 2 & & &,,A % &s"A44 B>B  Brr rrrr r sh.. F JJJMMMH & &K!8 &AE & & & & & &rr c8eZdZUdZdZeed<eed<defdZdS)ra 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>NoneTruenonetrueFalsefalser@rTs rrzName.can_assign&sy RRRrN r+r,r-r.r2r]rrrrrrrrs[F III HHHSDSSSSSSrrc8eZdZUdZdZeed<eed<defdZdS)NSRefz)Reference to a namespace value assignment)r@rCr@rCrIcdS)NTrrTs rrzNSRef.can_assign1s trNrrrrrr*sN33 F III IIIDrrceZdZdZdZdS)LiteralzBaseclass for literals.TNrrrrrr9s!!HHHrrc eZdZUdZdZejed<d deje dejfdZ e d dejdeje d d ddfd 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). rrNrrIc|jSrrrs rrzConst.as_constIs zrrgrGzt.Optional[Environment]c\ddlm}||st||||S)zReturn 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))clsrrgrGr"s rfrom_untrustedzConst.from_untrustedLsI ,+++++}U## ,, s5[AAAArrr)r+r,r-r.r2r[r_rr\rFr classmethodrr%rrrrr?s F 5LLLK!8AE#'15 BBuB 3B/ B  BBB[BBBrrcJeZdZUdZdZeed<ddeje defdZ dS) TemplateDatazA constant template string.)datar)NrrIct||}|jrt|jrt |jS|jSr)rdrNr)rMrr)rs rrzTemplateData.as_constdsI#D(33   ,,    %$)$$ $yrr) r+r,r-r.r2r]rr[r\rFrrrrr(r(^sX%% F IIIK!8Crr(ceZdZUdZdZejeed<e ed<d dej e dej ej dffd Zdefd ZdS) rzFor 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,raNrrI.cdt|tfd|jDS)Nc3BK|]}|VdSrrrxrs rrz!Tuple.as_const..ys/>>aQZZ))>>>>>>r)rdr;r,rs `rrzTuple.as_constws7#D(33>>>>4:>>>>>>rcH|jD]}|sdSdS)NFT)r,r)rOr{s rrzTuple.can_assign{s6J  D??$$ uu trr)r+r,r-r.r2r[rrrr]r\rFrr_rrrrrrrrms F 6$< HHH??K!8?AGAESVJDW????DrrceZdZUdZdZejeed<ddej e dejej fdZ dS) rz&Any list literal such as ``[1, 2, 3]``r,r,NrrIcJt|fd|jDS)Nc:g|]}|Srr/r0s r z!List.as_const..s%999 8$$999r)rdr,rs `rrz List.as_consts.#D(339999dj9999rr) r+r,r-r.r2r[rrrr\rFr_rrrrrrsi00 F 6$<::K!8:AF15M::::::rrceZdZUdZdZejded< d deje dej ej ej ffdZ dS) DictzeAny dict literal such as ``{1: 2, 3: 4}``. The items must be a list of :class:`Pair` nodes. r4Pairr,NrrIcdt|tfd|jDS)Nc3BK|]}|VdSrr/r0s rrz Dict.as_const..s/==QAJJx((======r)rddictr,rs `rrz Dict.as_consts9$D(33====$*======rr) r+r,r-r.r2r[rrr\rFr9r_rrrrr9r9s}F 6&>37>> ;/> qu >>>>>>rr9ceZdZUdZdZeed<eed< d deje dej ej ej ffdZ dS) r:zA key, value pair for dicts.keyrr@rNrrIct||}|j||j|fSr)rdr@rrrs rrz Pair.as_consts>$D(33x  **DJ,?,?,I,IIIrr) r+r,r-r.r2rrr[r\rFrr_rrrrr:r:s&& F III KKK37JJ ;/J  JJJJJJrr:cxeZdZUdZdZeed<eed<d dej e dej eej ffdZ dS) Keywordz>A key, value pair for keyword arguments where key is a string.r?r@rNrrIcdt||}|j|j|fSr)rdr@rrrs rrzKeyword.as_consts.#D(33x,,X6666rr)r+r,r-r.r2r]rrr[r\rFrr_rrrrrCrCspHH F HHH KKK77K!87AGCQRQVJDW777777rrCc~eZdZUdZdZeed<eed<ejeed<d deje dej fd Z dS) CondExprzZA conditional expression (inline if expression). (``{{ foo if bar else baz }}``) )rexpr1expr2rrGrHNrrIct||}|j|r|j|S|jt |j|Sr)rdrrrGrHr)rs rrzCondExpr.as_constsi#D(33 9  h ' ' 1:&&x00 0 : ,, z""8,,,rr) r+r,r-r.r2rrr[r\rFr_rrrrrFrFs|(F JJJ KKK :d  - -K!8 -AE - - - - - -rrF)_FilterTestCommonrrcfd|jD}tfd|jD}|jP ||jn!#t $r}t|d}~wwxYw|jP | |jn!#t $r}t|d}~wwxYw||fS)Nc:g|]}|Srr/r0s rr7z!args_as_const..s% 4 4 4QAJJx 4 4 4rc3BK|]}|VdSrr/r0s rrz args_as_const..s/<<1!**X&&<<<<<.constxs{t<<)) )r) rdr[r\rr_slicerwrxry)rOrr}s ` rrzSlice.as_constus#D(33 *qz$' *AJqu,= * * * * * * UU4:&&di(8(8%% :J:JKKKrr) r+r,r-r.r2r[r\rrrFr~rrrrrvrvks'F :d  *T  *T LLK!8LELLLLLLrrvc`eZdZUdZdZejeed<ddej e de fdZ dS) ConcatzXConcatenates the list of expressions provided after converting them to strings. rrNrrIcpt|dfd|jDS)Nrjc3\K|]&}t|V'dSr)r]rr0s rrz"Concat.as_const..s7EEQs1::h//00EEEEEEr)rdrrrs `rrzConcat.as_consts;#D(33wwEEEE$*EEEEEErr) r+r,r-r.r2r[rrrr\rFr]rrrrrrspF 6$<FFK!8FCFFFFFFrrcteZdZUdZdZeed<ejded<d dej e dej fd Z dS) CompareziCompares an expression with some other expressions. `ops` must be a list of :class:`Operand`\s. )expropsrOperandrNrrIc0t||}|j|x}} |jD]>}|j|}t |j||}|sdS|}?n!#t $r}t|d}~wwxYw|SrK)rdrrrr'oprr))rOrrrr new_valuers rrzCompare.as_consts#D(33++H555 &h " "G,,X66 '.ui@@! 55! " & & &,,A % & sAA51A55 B?BBr) r+r,r-r.r2rrr[rr\rFr_rrrrrrssF JJJ  K!8AErrc,eZdZUdZdZeed<eed<dS)rz$Holds an operator and an expression.)rrrrN)r+r,r-r.r2r]rrrrrrrs-.. F GGG JJJJJrrceZdZdZdZdS)Mulz(Multiplies the left with the right node.r Nr+r,r-r.rrrrrrs22HHHrrceZdZdZdZdS)Divz#Divides the left by the right node.r Nrrrrrrs--HHHrrceZdZdZdZdS)FloorDivzbDivides the left by the right node and converts the result into an integer by truncating. r NrrrrrrsHHHrrceZdZdZdZdS)AddzAdd the left to the right node.rNrrrrrrs))HHHrrceZdZdZdZdS)Subz&Subtract the right from the left node.rNrrrrrrs00HHHrrceZdZdZdZdS)ModzLeft modulo right.rNrrrrrrsHHHrrceZdZdZdZdS)PowzLeft to the power of right.rNrrrrrrs%%HHHrrcHeZdZdZdZddejedejfdZ dS)AndzShort circuited AND.andNrrIct||}|j|o|j|Srrdrrrrs rrz And.as_consts<#D(33y!!(++M 0C0CH0M0MMrr r+r,r-r.rr[r\rFr_rrrrrrsXHNNK!8NAENNNNNNrrcHeZdZdZdZddejedejfdZ dS)OrzShort circuited OR.orNrrIct||}|j|p|j|Srrrs rrz Or.as_consts<#D(33y!!(++Ltz/B/B8/L/LLrrrrrrrrsXHMMK!8MAEMMMMMMrrceZdZdZdZdS)NotzNegate the expression.rNrrrrrrs  HHHrrceZdZdZdZdS)NegzMake the expression negative.rNrrrrrrs''HHHrrceZdZdZdZdS)Posz8Make the expression positive (noop for most expressions)rNrrrrrrsBBHHHrrc"eZdZUdZdZeed<dS)EnvironmentAttributezLoads an attribute from the environment object. This is useful for extensions that want to call a callback stored on the environment. rr@Nr+r,r-r.r2r]rrrrrrs*F IIIIIrrc,eZdZUdZdZeed<eed<dS)ExtensionAttributezReturns 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@rr@Nrrrrrrs3$FOOO IIIIIrrc"eZdZUdZdZeed<dS) 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. ) importnamerNrrrrrrs* FOOOOOrrc*eZdZUdZdZeed<ddZdS) 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. rr@rINc td)NzKCan't create internal names. Use the `free_identifier` method on a parser.rkrTs rrPzInternalName.__init__2s 4   r)rIN)r+r,r-r.r2r]rrPrrrrr'sDF III      rrcJeZdZUdZdZeed<ddeje de fdZ dS) MarkSafez:Mark the wrapped expression as safe (wrap it as `Markup`).rrNrrIcpt||}t|j|Sr)rdrrrrs rrzMarkSafe.as_const?s/#D(33di((22333rr) r+r,r-r.r2rrr[r\rFrrrrrrr9sXDD F JJJ44K!84F444444rrcpeZdZUdZdZeed< ddeje dej e ej ffdZ dS) MarkSafeIfAutoescapezMark the wrapped expression as safe (wrap it as `Markup`) but only if autoescaping is active. .. versionadded:: 2.5 rrNrrIct||}|jrt|j|}|jrt |S|Sr)rdrNr)rrrMr)rOrrs rrzMarkSafeIfAutoescape.as_constNsY$D(33   ,, y!!(++   $<<  rr)r+r,r-r.r2rrr[r\rFrrr_rrrrrrDsr F JJJ37   ;/         rrceZdZdZdS)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*rrrrrZsrrceZdZdZdS)DerivedContextReferencezReturn 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*rrrrrlsrrceZdZdZdS)ContinuezContinue a loop.Nr*rrrrrusrrceZdZdZdS)Breakz Break a loop.Nr*rrrrrysrrc8eZdZUdZdZejeed<dS)ScopezAn artificial scope.rrNrrrrrr}s/ F &,rrcBeZdZUdZdZeed<eje ed<dS) OverlayScopeaAn 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 )rYrrYrN) r+r,r-r.r2rrr[rr rrrrrs>  !F MMM &,rrc8eZdZUdZdZejeed<dS)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))]) )optionsrN) r+r,r-r.r2r[rrCrrrrrrs5F VG_rrc8eZdZUdZdZejeed<dS)ScopedEvalContextModifierzModifies 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`. rrNrrrrrrs5 F &,rrrrNz te.NoReturnc td)Nzcan't create custom node typesr)rrNs r _failing_newrs 4 5 55r)zr.r[rtypingr[ collectionsr markupsaferutilsr TYPE_CHECKINGtyping_extensionsterGrTypeVarrmultruedivfloordivpowmodaddsubrr9r]Callabler_rnot_posnegrrr r!ger#ler'rr)r=r0rFr\rdr rrrrrrrrrrrrrrrrrrrrr rrrrr(rrr:rCrFrrQrJrrhrrkrsrvrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr staticmethodr>rrrrs?)""""(((((( QY|6 2 2 2       ,   BBsAJqu~qu'<==> =  :: qvc1:qugqun556 + + + K + K   $ $ B BsAJqu~qu'<==>   CCCCCCCC11111t111""""""""".6 ;(?KnnnnnXnnnnb4 T tTd$$     D           $     4        D   dT$tT$4.&&&&&d&&&2&&&&&&&&0SSSSS4SSS"     D   d BBBBBGBBB>     7   G*:::::7::: > > > > >7 > > > J J J J J6 J J J 7 7 7 7 7f 7 7 7-----t---, '- .:;*[:QWQVAE]AF15!%<0 01*-&-&-&-&-&-&-&-&`33333 333"          ! ! ! ! !4 ! ! ! &&&&&d&&&,&&&&&d&&&,LLLLLDLLL* F F F F FT F F Fd8f' ' w' ' ' ' NNNNN'NNNMMMMMMMM) ) )4        4     4   $44444t4444,t$dtDD4&     $    3666=6666 < --LLr