+
    WBix                     >   R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^
tRR	0tR
R0P                  ]4      tRRRRRRRRR]! 4       3
R lt ! R R4      t ! R R4      t ! R R4      t]P"                  ! R4      tR t ! R R4      tR# )zVprovides functionality for rendering a parsetree constructing into module
source code.N)ast)
exceptions)filters)	parsetree)util)PythonPrinter	UNDEFINEDSTOP_RENDERINGcontextloopTFc                    \         P                  ! 4       p\        V4      p\        V\	        VVVVVVVVV	V
V4      V 4       VP                  4       # )zUGenerate module source code given a parsetree node,
uri, and optional source filename)r   FastEncodingBufferr   _GenerateRenderMethod_CompileContextgetvalue)nodeurifilenamedefault_filtersbuffer_filtersimportsfuture_importssource_encodinggenerate_magic_commentstrict_undefinedenable_loopreserved_namesbufprinters   &&&&&&&&&&&&  1/usr/lib/python3.14/site-packages/mako/codegen.pycompiler       sc    " 
!
!
#CC G"	
 	" <<>    c                   &   a  ] tR t^Gt o R tRtV tR# )r   c                    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn        Wn	        Wn
        R # N)r   r   r   r   r   r   r   r   r   r   r   )selfr   r   r   r   r   r   r   r   r   r   r   s   &&&&&&&&&&&&r   __init___CompileContext.__init__H   sC      .,,.&<# 0&,r!   )r   r   r   r   r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno__r&   __static_attributes____classdictcell____classdict__s   @r   r   r   G   s     - -r!   r   c                      a  ] tR t^ct o RtR tR t]R 4       tR t	R t
R tR tR	 tRR ltR tR tRR ltRR ltR tR tR tR tR tR tR tR tR tR tR tR tRtV t R
# ) r   zRA template visitor object which generates the
full module source for a template.

c                   Wn         W n        W0n        R .V n        \	        V\
        P                  \
        P                  34      V n        V P                  '       d   RVP                  ,          pVP                  4       p\        VP                  P                  4      ^ 8  p\        VP                  P!                  RR4      4      p\        VP                  P!                  RR4      4      pR p	R p
VP"                  '       d   VP$                  '       g   VR.,          pMV P'                  4       p	V P                  P(                  p
RpV
e   V
P*                  P                  4       pV
P*                  P,                  '       g   VR.,          p\        V
P                  P!                  RR4      4      pV P                  P.                  ;'       g&    \        V
P                  P!                  RR4      4      V P                  n        MR.pRpR;rvVf   R	.pMR	.V,            Uu. uF  qNK  	  ppT P1                  T
;'       g    TWEWvV4       V	e   V	 F  p\3        WV4       K  	  V P                  '       g   V P5                  4        R # R # u upi )
Nz	render_%sbufferedFalsecached
**pageargsrender_bodyr   Fr
   )r   compilerr   identifier_stack
isinstancer   DefTagBlockTagin_deffuncnameget_argument_expressionslenfilter_argsargseval
attributesgetis_blockis_anonymouswrite_toplevelpagetag	body_declkwargsr   write_render_callabler   write_metadata_struct)r%   r   r7   r   namerA   filteredr2   r4   defsrH   as   &&&&        r   r&   _GenerateRenderMethod.__init__j   s)    	!% 	(8(8):L:L'MN;;;.D002D4++001A5HDOO//
GDEH$//--h@AFDG}}}T%6%6%6&&&(Dmm++G D"((AAC((///\N*Dg0044XwGH,0MM,E,E - -&&**='BJ) %~"''H<;D ){T121!A1D2""OOtTV	
 %g>  {{{&&(  3s   
Jc                   \        V P                  P                  4      V P                  P                  V P                  P                  &   R V P                  P
                  RV P                  P                  RV P                  P                  RV P                  P                  /pV P                  P                  RR\        P                  ! V4      R4       R# )r   r   r   line_mapz"""__M_BEGIN_METADATAz__M_END_METADATA
"""N)maxr   
source_maplinenor7   r   r   r   
writelinesjsondumps)r%   structs   & r   rL   +_GenerateRenderMethod.write_metadata_struct   s    7:LL##8
 3 34 ..4==$$t}}<<//	
 	 JJv&		
r!   c                (    V P                   R,          # )   )r8   r%   s   &r   identifiers!_GenerateRenderMethod.identifiers   s    $$R((r!   c                  a aaa . o/ o. oRS P                   n         ! VVVV 3R lR4      pV! 4       pS P                  P                   F  pVP	                  V4       K  	  SS P                   n        \        4       pS F"  pVP                  VP                  4       4      pK$  	  \        S P                   4      pWEn
        S P                   P                  '       dS   S P                   P                  '       d7   S P                  P                  RS P                   P                  ,          4       S P                   P                  '       dC   S P                  P                  RRP!                  S P                   P                  4      : 24       S P                  P                  R4       S P                  P                  R4       S P                  P                  R	4       S P                  P                  R
4       S P                  P                  R4       S P                  P                  R\"        ,          4       S P                  P                  R\$        P$                  ! 4       ,          4       S P                  P                  RS P                   P&                  ,          4       S P                  P                  RS P                   P(                  ,          4       S P                  P                  RS P                   P*                  ,          4       S P                  P                  RS P                   P                  ,          4       S P                   P,                  '       df   RpS P                   P,                   F-  pWgR,           ,          pS P                  P                  V4       K/  	  \.        P0                  ! VR^ ^ RR7      pMRpVP3                  S P                  4      p	VP4                  p
V
P                  V	P4                  4      Vn        VP                  P7                  \8        4       V'       d&   VP                  P7                  VP                  4       VS P                   n        S P                  P                  RV	P4                  P=                  4        Uu. uF  q3P>                  NK  	  up,          4       S P                  PA                  ^4       \C        S4      '       d   S PE                  S4       \C        S4      '       d+   S PG                  S4       S PI                  SR,          4       M"\C        S4      '       d   S PG                  S4       \K        V	P4                  P=                  4       4      # u upi )zhTraverse a template structure for module-level directives and
generate the start of module-level code.

Nc                   R   <a  ] tR t^t o V3R ltV3R ltV3R ltV3R ltRtV t	R# ):_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevelc                *   < SP                  V4       R # r$   )append)sr   inherits   &&r   visitInheritTagJ_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitInheritTag   s    t$r!   c                &   < VSVP                   &   R # r$   rM   )rh   r   
namespacess   &&r   visitNamespaceTagL_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitNamespaceTag   s    (,
499%r!   c                *   < VSP                   n        R # r$   )r7   rH   )rh   r   r%   s   &&r   visitPageTagG_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitPageTag   s    (,%r!   c                R   < VP                   '       d   SP                  V4       R # R # r$   )ismodulerg   )rh   r   module_codes   &&r   	visitCodeD_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitCode   s    ===&&t, !r!    N)
r(   r)   r*   r+   rj   ro   rr   rw   r,   r-   )r/   ri   rv   rn   r%   s   @r   FindTopLevelre      s     %--- -r!   rz   z# -*- coding:%s -*-zfrom __future__ import , z(from mako import runtime, filters, cachezUNDEFINED = runtime.UNDEFINEDz'STOP_RENDERING = runtime.STOP_RENDERINGz__M_dict_builtin = dictz__M_locals_builtin = localsz_magic_number = %rz_modified_time = %rz_enable_loop = %rz_template_filename = %rz_template_uri = %rz_source_encoding = %r 
ztemplate defined imports)sourcerW   posr   z_exports = %rr_   )&r7   rH   r   nodesaccept_visitorrn   setuniondeclared_identifiers_Identifiersdeclaredr   r   r   	writeliner   joinMAGIC_NUMBERtimer   r   r   r   r   
PythonCodebranchtopleveldefsupdateTOPLEVEL_DECLAREDra   valuesrM   write_blanksr?   write_module_codewrite_namespaceswrite_inheritlist)r%   rz   fnmodule_identmodule_identifiersr   impimpcodemain_identifiersmitri   rv   rn   s   f          @@@r   rG   $_GenerateRenderMethod.write_toplevel   s   
 
 $	- 	- NAQ ! $. uA'--a.D.D.FGL  *$--8&2# MM000---LL""%(E(EE =='''LL""99T]]99:= 	IJ>?HI89<=3lBC4tyy{BC2T]]5N5NNO%(>(>>	
 	3dmm6G6GGH#dmm&C&CC	
 ==   C}},,Tz!&&s+ - nn3G G-44TYY? --*-))))+
' 	##**+<=''..w/K/KL$6!/<<CCEFE!vvEFG	
 	!!!${"";/w<<!!*-wr{+__!!*-$1188:;; Gs   U<
c                   V P                   '       d7   VP                  pV'       d#   V P                  P                  RV,          4       V P                  P	                  VP
                  4       V P                  P                  RV: RRP                  V4      : R2RR4       V'       g   V'       g	   V'       d   V P                  P                  R4       V P                  P                  V P                  P                  P                  V P                  4      4       V P                   '       d   V P                  P                  '       d4   R	V9   d-   V P                  R,          P                  P!                  R
4       V P                   '       g   \#        V P                  P$                  4      ^ 8  g%   \#        V P                  P                  4      ^ 8  d]   V P                  P                  RRP                  V P                  P                   Uu. uF  pV: RV: 2NK  	  up4      ,          4       V P'                  V P                  RR7       V P                  P(                   F  p	V	P+                  V 4       K  	  V P-                  V P                  WEV4       V P                  P                  R4       V P                  P/                  ^4       V'       d"   V P1                  WW4V P                  RR7       R# R# u upi )zfwrite a top-level render callable.

this could be the main render() method or that of a top-level def.z@runtime._decorate_toplevel(%s)def (,):/__M_caller = context.caller_stack._push_frame()try:context._push_buffer()r5   pageargsz!__M_locals = __M_dict_builtin(%s)=T)toplevelNr_   )r<   	decoratorr   r   start_sourcerW   rX   r   r8   rg   r7   ra   r   r   rE   argument_declaredaddr?   locally_assignedwrite_variable_declaresr   r   write_def_finishr   write_cache_decorator)
r%   r   rM   rA   r2   rN   r4   r   xr   s
   &&&&&&&   r   rK   +_GenerateRenderMethod.write_render_callable  s4    ;;;I&&5	A 	!!$++.!388D>2=		
 x6LL""#;<$$MM%%,,TYY7	
 tyy111|t7K!!"%77;;JG{{{  112Q64##556:LL""3(( "&!1!1!C!C!CA $%a(!C 	$$T%5%5$EAT" ! 	diiVDt$!!!$&&DD,<,<t '  s   K>c                z    V F4  pV P                   P                  VP                  VP                  R7       K6  	  R# )z]write module-level template code, i.e. that which
is enclosed in <%! %> tags in the template.starting_linenoN)r   write_indented_blocktextrW   )r%   rv   r   s   && r   r   '_GenerateRenderMethod.write_module_codeV  s-     ALL--affahh-O r!   c                r    V P                   P                  RRRVP                  R,          ,          R4       R# )z:write the module-level inheritance-determination callable.z%def _mako_inherit(template, context):"_mako_generate_namespaces(context)z8return runtime._inherit_from(context, %s, _template_uri)fileN)r   rX   parsed_attributesr%   r   s   &&r   r   #_GenerateRenderMethod.write_inherit\  s5     	30F%%f-/	
r!   c                  a aa S P                   P                  RRRRRRRR4       S P                   P                  R4       VP                  4        EF  pRVP                  9   d   R	S P
                  n        S P                   P                  VP                  4       \        VP                  4      '       d   S P                   P                  R
4       . oS P
                  P                  P                  V4      oR	S n         ! VVV 3R lR4      pV! 4       pVP                   F  pVP                  V4       K  	  S P                   P                  RRP                  S4      ,          4       S P                   P                  R4       RS n        RpMRpRVP                   9   dN   S P                   P                  RVP"                  : RVP                   P%                  RR4      : RV: R24       MRVP                   9   dN   S P                   P                  RVP"                  : RV: RVP                   P%                  RR4      : R24       M.S P                   P                  RVP"                  : RV: R24       \'        VP                  P%                  RR4      4      '       d-   S P                   P                  R VP"                  ,          4       S P                   P                  R!\)        VP"                  4      ,          4       S P                   P+                  ^4       EK  	  \        V4      '       g   S P                   P                  R"4       S P                   P                  R4       R# )#z5write the module-level namespace-generating callable.z'def _mako_get_namespace(context, name):r   z+return context.namespaces[(__name__, name)]except KeyError:r   Nz'def _mako_generate_namespaces(context):importTzdef make_namespace():c                   >   <a  ] tR tRt o R tR tVVV3R ltRtV tR# )<_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitori  c                (    V P                  V4       R # r$   visitDefOrBaserh   r   s   &&r   visitDefTagH_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitor.visitDefTag      ((.r!   c                (    V P                  V4       R # r$   r   r   s   &&r   visitBlockTagJ_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitor.visitBlockTag  r   r!   c                   < VP                   '       d!   \        P                  ! R/ VP                  B hSP	                  VSRR7       SP                  VP                  4       R# ).Can't put anonymous blocks inside <%namespace>FnestedN)r   )rF   r   CompileExceptionexception_kwargswrite_inline_defrg   r=   )rh   r   exportra   r%   s   &&r   r   K_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitor.visitDefOrBase  sY    ,,,","="= # #'"7"7# 
 --dK-Ndmm4r!   ry   N	r(   r)   r*   r+   r   r   r   r,   r-   )r/   r   ra   r%   s   @r   NSDefVisitorr     s     //5 5r!   r   return [%s]r   Fzmake_namespace()Noner   zns = runtime.TemplateNamespace(z3, context._clean_inheritance_tokens(), templateuri=z, callables=z,  calling_uri=_template_uri)modulezns = runtime.ModuleNamespace(z1, context._clean_inheritance_tokens(), callables=z$, calling_uri=_template_uri, module=)zns = runtime.Namespace(z, calling_uri=_template_uri)inheritabler3   zcontext['self'].%s = nsz'context.namespaces[(__name__, %s)] = nspass)r   rX   r   r   rC   r7   has_ns_importsr   rW   r?   r   ra   r   r<   r   r   r   rM   rD   rB   reprr   )	r%   rn   r   r   visr   callable_namer   ra   s	   f&     @@r   r   &_GenerateRenderMethod.write_namespacesg  s   5909		
 	HI%%'D4??*/3,LL%%dkk24::&&'>?"mm77>>tD"5 5" #nA$$S) $&&}8H'IJ&&t,# 2 &///&& 		..2266B%
 T333&& 		%..228VD
 && yy-1 DOO''w?@@&&'@DII'NOLL""9DOK LL%%a(U (V :LL""6*t$r!   Nc                T   VP                    Uu/ uF  qDP                  VbK  	  pp\        4       pVP                  VP                  4      pTP                  VP
                  P                  4        Uu. uF  qDP                  NK  	  up4      pVP                  VP                  4      pVP                  VP                  4      pV P                  P                  '       d   RV9   pVP                  R4       MRpVe   VP                  V4      pV'       d   \        V P                  RR4      '       d   V P                  P!                  R4       RV P                  n        V P                  P$                  P'                  4        Fb  w  rRV	P(                  9   g   K  V P                  P!                  RV: R	\*        P,                  ! R
V	P(                  R,          4      : R24       Kd  	  V'       d   V P                  P!                  R4       V EF  pW9   d   WX,          p
V
P.                  '       d;   V
P0                  '       g   V P3                  W4       KI  V P5                  WRR7       K^  V
P7                  4       '       d   V P3                  W4       K  V P5                  WRR7       K  WP                  P$                  9   d&   V P                  P!                  V: RV: R24       K  \        V P                  RR4      '       d   V P                  P8                  '       dD   V P                  P;                  V: RV: R2RV,          RV: RV: R2RRV,          RR4       EKW  V P                  P!                  V: RV: RV: R24       EK  V P                  P8                  '       d2   V P                  P;                  RV: RV: R2RRV,          R4       EK  V P                  P!                  V: RV: R24       EK  	  V P                  P!                  R4       R# u upi u upi )a  write variable declarations at the top of a function.

the variable declarations are in the form of callable
definitions for defs and/or name lookup within the
function's context argument. the names declared are based
on the names that are referenced in the function body,
which don't otherwise have any explicit assignment
operation. names that are assigned within the body are
assumed to be locally-scoped variables and are not
separately declared.

for def callable definitions, if the def is a top-level
callable then a 'stub' callable is generated which wraps
the current Context into a closure. if the def is not
top-level, it is fully rendered as a local closure.

r   FNr   z_import_ns = {}Tr   z_mako_get_namespace(context, z)._populate(_import_ns, z\s*,\s*r   z%loop = __M_loop = runtime.LoopStack()r   z  = _mako_get_namespace(context, z = _import_ns.get(z, UNDEFINED)zif %s is UNDEFINED:r   z = context[]r   z&raise NameError("'%s' is not defined")z, context.get(z, UNDEFINED))z = context.get(z__M_writer = context.writer())rO   r=   r   r   
undeclaredclosuredefsr   
differencer   locally_declaredr7   r   discardintersectiongetattrr   r   has_importsrn   itemsrC   resplitrE   rF   write_def_declr   is_rootr   rX   )r%   ra   r   limitccomp_identsto_writehas_loopidentnscomps   &&&&       r   r   -_GenerateRenderMethod.write_variable_declares  sA   ( /:.>.>?.>zz1}.>?5 >>+"8"89 >>!,!8!8!?!?!AB!AAZZ!AB
 &&{'D'DE &&{'C'CD==$$$)HV$H ,,U3H/?GGLL""#45(,DMM%!]]55;;=	r}},LL** "HHZx1HI	 > LL""#JKE#")===,,,++D>--d-M||~~++D>--d-M--222&&?DeL 4==*:EBB}}555//$e-1E9"27?.FN  
 ..  %eU4 }}555//"27?.FN  ..AFNa h 	>?Q @ Cs   P 2P%c                b   VP                   pVP                  4       pVP                  RR7      pV P                  '       g\   \        V P                  P
                  4      ^ 8  g%   \        V P                  P                  4      ^ 8  d   VP                  ^ R4       MVP                  ^ R4       V P                  P                  RV: RRP                  V4      : R24       V P                  P                  R	V: RRP                  V4      : R
24       V P                  P                  R4       R# )z>write a locally-available callable referencing a top-level defTas_callzcontext._locals(__M_locals)r
   r   r   r   r   zreturn render_r   N)r=   r>   r<   r?   ra   r   r   insertr   r   r   )r%   r   ra   r=   	namedeclsnameargss   &&&   r   r   $_GenerateRenderMethod.write_def_declB  s    ==113	000>{{{  112Q64##556:OOA<=OOAy)#((9:MNO&.0BC	
 	t$r!   c           
     ,   VP                  4       pVP                  pV'       d#   V P                  P                  RV,          4       V P                  P                  RVP                  : RRP                  V4      : R24       \        VP                  P                  4      ^ 8  p\        VP                  P                  RR4      4      p\        VP                  P                  RR4      4      pV P                  P                  R	R
4       V'       g   V'       g	   V'       d   V P                  P                  R4       VP                  WR7      pV P                  V4       V P                  P!                  V4       VP"                   F  p	V	P%                  V 4       K  	  V P                  P'                  4        V P)                  WWh4       V P                  P                  R4       V'       d%   V P+                  VVP                  VRVRRR7       R# R# )z?write a locally-available def callable inside an enclosing def.z&@runtime._decorate_inline(context, %s)r   r   r   r   r2   r3   r4   r   r   r   r   NFT)inliner   )r>   r   r   r   r=   r   r?   r@   rA   rB   rC   rD   rX   r   r   r8   rg   r   r   popr   r   )
r%   r   ra   r   r  r   rN   r2   r4   r   s
   &&&&      r   r   &_GenerateRenderMethod.write_inline_defU  s    113	NN	LL""89D 	!]]CHHY,?@	
 t'',,-1++J@Adoo))(G<==	

 x6LL##$<=!(((=$$[1$$[1AT" !!#dh?t$&& '  r!   c                x   V'       gQ   V'       gI   V'       gA   V P                   P                  R4       V'       d   V P                   P                  RRR4       V'       g   V'       g
   V'       EdI   V'       g	   V'       d   V P                   P                  RR4       MV P                   P                  RR4       V'       d   V P                   P                  R4       RpV'       d(   V P                  VP                  P
                  VR4      pV P                   P                  R4       V'       d0   V'       g(   V P                  V P                  P                  VR4      pV'       g	   V'       d%   V P                   P                  R	V,          4       R# V P                   P                  R
V,          R4       R# R# )a"  write the end section of a rendering function, either outermost or
inline.

this takes into account if the rendering function was filtered,
buffered, etc.  and closes the corresponding try: block if any, and
writes code to retrieve captured content, apply filters, send proper
return value.	return ''finally:z!context.caller_stack._pop_frame()Nz__M_buf = context._pop_buffer()6__M_buf, __M_writer = context._pop_buffer_and_writer()__M_buf.getvalue()Fz	return %s__M_writer(%s))r   r   rX   create_filter_callabler@   rA   r7   r   )r%   r   r2   rN   r4   	callstackrh   s   &&&&&& r   r   &_GenerateRenderMethod.write_def_finish  s7    xLL"";/'' CT x666
 '' A ''L
 &&'JK$A//$$))1e LL""4(//MM00!U 6&&{Q7''(81(<kJ? $*r!   c                x  a a S P                   P                  RV: RV: 24       SP                  P                  R\	        V4      4      p/ p	S P
                  P                  e:   V	P                  V 3R lS P
                  P                  P                   4       4       V	P                  V3R lSP                   4       4       RV	9   d   \        \        V	R,          4      4      V	R&   S P                   P                  RV: R	R
P                  V4      : R24       V U
u. uF3  p
RV
9   d(   RV
P                  R4      ^ ,          3^,          ,          MT
NK5  	  pp
S P                  VVSP                  4       R7       V'       d   RV: RV: R	R
P                  V4      : RRP                  V	P                  4        UUu. uF  w  rV: RV: R2NK  	  upp4      : RV: R2pS P                  S P
                  P                   VR4      pS P                   P#                  RV,           R4       R# S P                   P#                  RV: RV: R	R
P                  V4      : RRP                  V	P                  4        UUu. uF  w  rV: RV: R2NK  	  upp4      : RV: R2RR4       R# u up
i u uppi u uppi )z`write a post-function decorator to replace a rendering
callable with a cached version of itself.__M_z = 	cache_keyNc              3      <"   T FW  pVP                  R 4      '       g   K  VR8w  g   K%  VR,          SP                  P                  P                  V,          3x  KY  	  R# 5icache_r  :   NNN)
startswithr7   rH   r   ).0par%   s   & r   	<genexpr>>_GenerateRenderMethod.write_cache_decorator.<locals>.<genexpr>  sS      AB==* F/1[/@ FB..@@DEAs   A"A"8A"c              3      <"   T FC  pVP                  R 4      '       g   K  VR8w  g   K%  VR,          SP                  V,          3x  KE  	  R# 5ir  )r  r   )r  r  node_or_pagetags   & r   r  r    sG      
7}}X& <+-+< <RV_66r:;7s   AA$Atimeoutr   r   r   r   r   z%s=%s)r   r   z.context.get('local').cache._ctx_get_or_create(z, lambda:__M_z),  context, r|   r{   z__M_defname=r   Fzreturn z9__M_writer(context.get('local').cache._ctx_get_or_create(z), context, z))r	  )r   r   r   rD   r   r7   rH   r   intrB   r   r   r   undeclared_identifiersr   r  r   rX   )r%   r  rM   rA   r2   ra   r  r   cachekey
cache_argsrP   	pass_argskvrh   s   ff&&&&&&       r   r   +_GenerateRenderMethod.write_cache_decorator  s]    	d;<"4488d
 
==  , --//AA 
 	 
%77
 	

 
"$'Z	-B(C$DJy!chhtnEF LP
KOa#(GQ)A-.A4 	 
 	$$!88: 	% 	

 8 HHY'GG8B8H8H8JK8Ja+8JK   ++,,aA LL##IM48LL##
 HHY'GG8B8H8H8JK8Ja+8JK  =
& L( Ls   9J+>J0>J6c                    R pRV9  d   V'       d   V P                   P                  '       d2   V P                   P                  P                  P                  V,           pV P                   P                  '       d%   RV9  d   V P                   P                  V,           pV Fh  pVR8X  d   K  \
        P                  ! RV4      pV'       d&   VP                  ^^4      w  rxV! V4      p	W,           pMV! V4      pVf   Q hV: RV: R2pKj  	  V# )zwrite a filter-applying expression based on the filters
present in the given filter names, adjusting for the global
'default' filter aliases as needed.c                     \         P                  ! R V 4      '       d
   RV ,           # \        P                  P	                  W 4      # )z
decode\..+zfilters.)r   matchr   DEFAULT_ESCAPESrD   rm   s   &r   locate_encodeC_GenerateRenderMethod.create_filter_callable.<locals>.locate_encode  s5    xxt,,!D((..224>>r!   r   z(.+?)(\(.*\))r   r   )r7   rH   r@   rA   r   r   r*  group)
r%   rA   targetis_expressionr,  emr   fargsr   s
   &&&&      r   r  ,_GenerateRenderMethod.create_filter_callable	  s    
	? d?==(((==00<<AADHD==000S_==884?DACx)1-A wwq!}!%(I!!$}$}!"F+F  r!   c                   V P                   P                  VP                  4       \        VP                  4      '       gw   V P
                  P                  e:   \        V P
                  P                  P                  P                  4      '       g&   \        V P
                  P                  4      '       d]   V P                  VP                  P                  RVP                  ,          R4      pV P                   P                  RV,          4       R # V P                   P                  RVP                  ,          4       R # )Nz%sTr  )r   r   rW   r?   escapesr7   rH   r@   rA   r   r  escapes_coder   r   )r%   r   rh   s   && r   visitExpression%_GenerateRenderMethod.visitExpression)  s    !!$++.%%1--99>>??4==0011++!!&&tyy(8$A LL""#3a#78LL""#3dii#?@r!   c                  aa SP                   '       d   V P                  P                  R 4       SP                  '       dT   V P                  P                  R4       V P                  P                  R4       V P                  P                  R 4       R # R # V P                  P	                  SP
                  4       V P                  P                  '       d)   SP                  R8X  d   \        SV P                  4      pMSP                  pV P                  P                  V4       SP                  4       oV3R lpS'       d   \        ;QJ d    R S 4       F  '       d   K   RM	  RM! R S 4       4      '       dA   \        ;QJ d    V3R lS 4       F  '       d   K   RM	  RM! V3R lS 4       4      '       g   V! 4       '       d   V P                  P                  R	4       R # R # )
Nr
  zloop = __M_loop._exit()forc                     < S FI  p \        V \        P                  4      '       d   K%  \        V \        P                  4      '       d    R #  R# 	  R# )TFNr9   r   CommentControlLine)r   childrens    r   _search_for_control_lineH_GenerateRenderMethod.visitControlLine.<locals>._search_for_control_lineP  s<    !A!!Y%6%677 #Ay'<'<==#  "r!   c              3   v   "   T F/  p\        V\        P                  \        P                  34      x  K1  	  R # 5ir$   r=  )r  r   s   & r   r  9_GenerateRenderMethod.visitControlLine.<locals>.<genexpr>Z  s2      % q9#4#4i6K6K"LMM%s   79FTc              3      <"   T FV  p\        V\        P                  4      '       g   K%  SP                  VP                  4      ;'       g    VP
                  x  KX  	  R # 5ir$   )r9   r   r?  
is_ternarykeywordisend)r  r   r   s   & r   r  rD  ^  sF      %!!Y%:%:; ;T__QYY/::177:%s   "A!!A!A!r   )rH  r   r   has_loop_contextr   rW   r7   r   rG  mangle_mako_loopr   get_childrenall)r%   r   r   rA  r@  s   &f  @r   visitControlLine&_GenerateRenderMethod.visitControlLine:  s^   :::LL""4($$$&&z2&&'@A&&t, %
 LL%%dkk2}}(((T\\U-B'dll;yyLL""4(((*H! 3 %333 %   C %CCC %  
 ,--&&v. .r!   c                    V P                   P                  VP                  4       V P                   P                  R \	        VP
                  4      ,          4       R# )r  N)r   r   rW   r   r   contentr   s   &&r   	visitText_GenerateRenderMethod.visitTextg  s9    !!$++./$t||2DDEr!   c           
        \        VP                  P                  4      ^ 8  pV'       d   V P                  P	                  RR4       VP
                   F  pVP                  V 4       K  	  V'       dM   V P                  P	                  RRRV P                  VP                  P                  RR4      ,          R4       R# R# )	    z#__M_writer = context._push_writer()r   r
  r  r  r  FN)r?   r@   rA   r   rX   r   r   r  )r%   r   rN   r   s   &&  r   visitTextTag"_GenerateRenderMethod.visitTextTagk  s    t'',,-1LL##5v AT" LL##H --$$))+?  r!   c                   VP                   '       g   V P                  P                  VP                  VP                  R 7       V P
                  '       g   \        V P                  P                  4      ^ 8  dv   V P                  P                  R4       V P                  P                  RRP                  VP                  4        Uu. uF  p\        V4      NK  	  up4      ,          4       R# R# R# R# u upi )r   z0__M_locals_builtin_stored = __M_locals_builtin()z__M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in [%s] if __M_key in __M_locals_builtin_stored]))r   N)ru   r   r   r   rW   r<   r?   ra   r   r   r   r   r   )r%   r   r   s   && r   rw   _GenerateRenderMethod.visitCode~  s    }}}LL--		4;; .  ;;;3t'7'7'H'H#IA#M
 &&F &&G hh1J1J1LM1LAQ1LMNO $N; "  Ns   C5c                j   V P                   P                  VP                  4       VP                  P	                  R 4      pV'       d8   V P                   P                  RVP                  R,          : RV: R24       R# V P                   P                  RVP                  R,          ,          4       R# )rA   zruntime._include_file(context, r   z, _template_uri, r   z1runtime._include_file(context, %s, _template_uri)N)r   r   rW   rC   rD   r   r   )r%   r   rA   s   && r   visitIncludeTag%_GenerateRenderMethod.visitIncludeTag  s    !!$++.""6*LL""))&1149
 LL""C))&13r!   c                    R # r$   ry   r   s   &&r   ro   '_GenerateRenderMethod.visitNamespaceTag      r!   c                    R # r$   ry   r   s   &&r   r   !_GenerateRenderMethod.visitDefTag  r^  r!   c                   VP                   '       d/   V P                  P                  R VP                  ,          4       R
# VP	                  RR7      pVR.,          pV P                  P                  RVP                  ,          4       V P                  P                  RVP                  : RRP                  V4      : R24       V P                  P                  R	4       R
# )z%s()Tr   r5   zOif 'parent' not in context._data or not hasattr(context._data['parent'], '%s'):zcontext['self'].r   r   r   r}   N)rF   r   r   r=   r>   r   )r%   r   r  s   && r   r   #_GenerateRenderMethod.visitBlockTag  s    LL""6DMM#9:44T4BH&HLL"">@DN LL"",0MM388H;MN LL""4(r!   c                (    V P                  V4       R # r$   visitCallTagr   s   &&r   visitCallNamespaceTag+_GenerateRenderMethod.visitCallNamespaceTag  s     	$r!   c                  a aaa	 S P                   P                  R 4       R.o	S P                  P                  VRR7      oSP                  VRR7      oSP	                  R4       S P
                  P                  S4        ! VVV	V 3R lR4      pV! 4       pVP                   F  pVP                  V4       K  	  S P
                  P                  4        VP                  P                  4       pS P                   P                  RR	P                  V4      ,          4       RpV'       d   S P                   P                  R
R4       S P                  S4       S P
                  P                  S4       VP                   F  pVP                  S 4       K  	  S P
                  P                  4        S P                  WRRRR7       S P                   P                  RRR	P                  S	4      ,          R4       S P                   P                  RR4       S P                   P!                  VP"                  4       S P                   P                  RS P%                  . VP&                  R4      ,          RRR4       R# )zdef ccall(caller):bodyTr   Fcallerc                   @   <a  ] tR tRt o R tR tVVVV3R ltRtV tR# )6_GenerateRenderMethod.visitCallTag.<locals>.DefVisitori  c                (    V P                  V4       R # r$   r   r   s   &&r   r   B_GenerateRenderMethod.visitCallTag.<locals>.DefVisitor.visitDefTag        &r!   c                (    V P                  V4       R # r$   r   r   s   &&r   r   D_GenerateRenderMethod.visitCallTag.<locals>.DefVisitor.visitBlockTag  ro  r!   c                   < SP                  VSR R7       VP                  '       g   SP                  VP                  4       VP                  SP                  9   d   SP                  VP                   R# R# )Fr   N)r   rF   rg   r=   r   )rh   r   body_identifierscallable_identifiersr   r%   s   &&r   r   E_GenerateRenderMethod.visitCallTag.<locals>.DefVisitor.visitDefOrBase  sb    %%d,@%O(((MM$--0 ==$4$@$@@(44T]]C Ar!   ry   Nr   )r/   rs  rt  r   r%   s   @r   
DefVisitorrl    s     ''D Dr!   rv  zdef body(%s):r   r   r   )r  Nr   zccontext.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))r  r
  z&context.caller_stack.nextcaller = None)r   r   ra   r   add_declaredr8   rg   r   r   r  rI   r>   r   rX   r   r   r   rW   r  
expression)
r%   r   rv  r   r   bodyargsr2   rs  rt  r   s
   f&     @@@r   re  "_GenerateRenderMethod.visitCallTag  s   34#//66tD6I/66tE6J
 	%%h/$$%56	D 	D  lAS! !!#>>::<(1CCD LL##$<fE$$%56$$%56AT" !!#deUeLmsxx7G&H$O+ 	
 	!!$++.))"dootDE4	
r!   )r7   r8   r<   r   r   FN)T)FF)!r(   r)   r*   r+   __doc__r&   rL   propertyra   rG   rK   r   r   r   r   r   r   r   r   r  r8  rM  rQ  rU  rw   rZ  ro   r   r   rf  re  r,   r-   r.   s   @r   r   r   c   s     
/)b
" ) )k<Z7rP	
[%z|@|%&,\1KfQf@A"+/ZF&*) B
 B
r!   r   c                      a  ] tR tRt o RtRR ltR t]R 4       tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )r   i  zCtracks the status of identifier names as template code is rendered.Nc                ~   VEe0   \        V\        P                  4      '       d,   \        4       V n        \
        P                  ! 4       V n        EM\        VP                  4      P                  VP                  P                  4        Uu. uF  qUP                  NK  	  up4      P                  VP                  4      P                  VP                  4      V n        V'       d+   V P                  P                  VP                  4      V n        \
        P                  ! R/ VP                  B V n        M)\        4       V n        \
        P                  ! 4       V n        Wn        \        4       V n        \        4       V n        \        4       V n        \        4       V n        \
        P                  ! 4       V n	        W n        Ve   VP%                  V 4       V P                  P&                  P)                  V P                  4      pV'       d-   \*        P,                  ! RRP/                  V4      ,          4      hR # u upi )Nz'Reserved words declared in template: %sr{   ry   )r9   r   NamespaceTagr   r   r   SetLikeDictr   r   r   r   rM   r   r   r   r7   r   r   r   r   r   r   NameConflictErrorr   )r%   r7   r   parentr   r   illegal_namess   &&&&&  r   r&   _Identifiers.__init__  s    $	 6 677 #$($4$4$6!
 (UF,>,>,E,E,GH,GqFF,GHIU6223U6334	  $(MM$7$78I8I$JDM %)$4$4$Kv7J7J$K!EDM $ 0 0 2D  %
 !$
 !$ "%  ++-	%44AA!!
 ..9))M*+  c Is   H:c                0    \        V P                  W3/ VB # )zMcreate a new Identifiers for a new Node, with
this Identifiers as the parent.)r   r7   )r%   r   rJ   s   &&,r   r   _Identifiers.branchH  s     DMM4@@@r!   c                z    \        V P                  P                  V P                  4      P	                  4       4      # r$   )r   r   r   r   r   r`   s   &r   rO   _Identifiers.defsN  s-    4$$**4+;+;<CCEFFr!   c                   R \        V P                  4      : R\        V P                  4      : R\        V P                  4      : RV P                  P                  4        Uu. uF  qP                  NK  	  up: RV P                  P                  4        Uu. uF  qP                  NK  	  up: RV P                  : R2# u upi u upi )zIdentifiers(declared=z, locally_declared=z, undeclared=z, topleveldefs=z, closuredefs=z, argumentdeclared=r   )	r   r   r   r   r   r   rM   r   r   )r%   r   s   & r   __repr___Identifiers.__repr__R  s     T]]#T**+T__%!%!2!2!9!9!;<!;A!;<!%!1!1!8!8!:;!:A!:;&&
	
 =;s   #CCc                6   VP                  4        FR  pVR8w  g   K  W P                  P                  V P                  4      9  g   K7  V P                  P                  V4       KT  	  VP                  4        F  pV P                  P                  V4       K   	  R# )zdupdate the state of this Identifiers with the undeclared
and declared identifiers of the given node.r
   N)r!  r   r   r   r   r   r   r%   r   r   s   && r   check_declared_Identifiers.check_declareda  s{     002E	!e==3F3F%%4 ' ##E*	 3
 ..0E!!%%e, 1r!   c                    V P                   P                  V4       WP                  9   d   V P                  P                  V4       R # R # r$   )r   r   r   remove)r%   r   s   &&r   rw  _Identifiers.add_declaredm  s5    % OO#OO""5) $r!   c                (    V P                  V4       R # r$   r  r   s   &&r   r8  _Identifiers.visitExpressionr      D!r!   c                (    V P                  V4       R # r$   r  r   s   &&r   rM  _Identifiers.visitControlLineu  r  r!   c                    VP                   '       gB   V P                  V4       V P                  P                  VP	                  4       4      V n        R # R # r$   )ru   r  r   r   r   r   s   &&r   rw   _Identifiers.visitCodex  sC    }}}%$($9$9$?$?))+%D! r!   c                r    V P                   VJ d'   VP                   F  pVP                  V 4       K  	  R # R # r$   )r   r   r   r%   r   r   s   && r   ro   _Identifiers.visitNamespaceTag  s1     99ZZ  &   r!   c                   VP                  VP                  4      pW!VP                  &   Ve`   W2JdY   VP                  '       g   VP                  '       d3   \        P                  ! RVP                  ,          3/ VP
                  B hR # R # R # )Nz<%%def or %%block named '%s' already exists in this template.)rD   r=   rE   r   r   r   )r%   
collectionr   existings   &&& r   _check_name_exists_Identifiers._check_name_exists  s    >>$--0$(4==! $("3"3"3--+-1]]; ''  #4 % !r!   c                   VP                  4       '       d0   VP                  '       g   V P                  V P                  V4       M+WP                  Jd   V P                  V P
                  V4       VP                  4        FR  pVR 8w  g   K  W P                  P                  V P                  4      9  g   K7  V P                  P                  V4       KT  	  WP                  J dY   VP                  4        F  pV P                  P                  V4       K   	  VP                   F  pVP                  V 4       K  	  R# R# r
   N)r   rF   r  r   r   r   r!  r   r   r   r   r   r   r   r   r   r%   r   r   r   s   &&  r   r   _Identifiers.visitDefTag  s    <<>>$"3"3"3##D$5$5t<"##D$4$4d;002E	!e==3F3F%%4 ' ##E*	 3 99224&&**51 5 ZZ  &  	 r!   c                v   WP                   Jd   VP                  '       g   \        V P                   \        P                  4      '       dI   \
        P                  ! R VP                  : RV P                   P                  : R23/ VP                  B h\        V P                   \        P                  \        P                  34      '       d1   \
        P                  ! R VP                  : R23/ VP                  B hVP                  4        FR  pVR8w  g   K  W P                  P                  V P                  4      9  g   K7  V P                  P!                  V4       KT  	  VP                  '       gC   V P#                  V P$                  V4       V P                  P!                  VP&                  4       M+WP                   Jd   V P#                  V P(                  V4       VP+                  4        F  pV P,                  P!                  V4       K   	  VP.                   F  pVP1                  V 4       K  	  R# )zNamed block 'z' not allowed inside of def ''z#' not allowed inside of <%call> tagr
   N)r   rF   r9   r   r:   r   r   rM   r   CallTagCallNamespaceTagr!  r   r   r   r   r   r  r   r=   r   r   r   r   r   r  s   &&  r   r   _Identifiers.visitBlockTag  s   yy ):):):$))Y%5%566 11yy$))..2 ++ 
 		I--y/I/IJ  !11yy# ++  002E	!e==3F3F%%4 ' ##E*	 3    ##D$5$5t<OO."##D$4$4d;..0E""&&u- 1AT" r!   c                    VP                  4        FR  pVR 8w  g   K  W P                  P                  V P                  4      9  g   K7  V P                  P                  V4       KT  	  R# r  )r!  r   r   r   r   r   r  s   && r   rU  _Identifiers.visitTextTag  sP    002E	!e==3F3F%%4 ' ##E*	 3r!   c                (    V P                  V4       R # r$   r  r   s   &&r   rZ  _Identifiers.visitIncludeTag  r  r!   c                    VP                  4        F  pV P                  P                  V4       K   	  V P                  V4       R # r$   )r   r   r   r  r  s   && r   rr   _Identifiers.visitPageTag  s7    ..0E""&&u- 1D!r!   c                (    V P                  V4       R # r$   rd  r   s   &&r   rf  "_Identifiers.visitCallNamespaceTag  s    $r!   c                l   WP                   J d   VP                  4        FR  pVR 8w  g   K  W P                  P                  V P                  4      9  g   K7  V P
                  P                  V4       KT  	  VP                  4        F  pV P                  P                  V4       K   	  VP                   F  pVP                  V 4       K  	  R# VP                  4        FR  pVR 8w  g   K  W P                  P                  V P                  4      9  g   K7  V P
                  P                  V4       KT  	  R# r  )r   r!  r   r   r   r   r   r   r   r   r   r  s   &&  r   re  _Identifiers.visitCallTag  s    99446I%%}}7J7J))8 + OO''.	 7
 224&&**51 5ZZ  &   446I%%}}7J7J))8 + OO''.	 7r!   )	r   r   r7   r   r   r   r   r   r   )NNF)r(   r)   r*   r+   r|  r&   r   r}  rO   r  r  rw  r8  rM  rw   ro   r  r   r   rU  rZ  rr   rf  re  r,   r-   r.   s   @r   r   r     s|     MAFA G G

-*
""''(#B+""
 / /r!   r   z^for\s+((?:\(?)\s*(?:\(?)\s*[A-Za-z_][A-Za-z_0-9]*(?:\s*,\s*(?:[A-Za-z_][A-Za-z_0-9]*),??)*\s*(?:\)?)(?:\s*,\s*(?:(?:\(?)\s*[A-Za-z_][A-Za-z_0-9]*(?:\s*,\s*(?:[A-Za-z_][A-Za-z_0-9]*),??)*\s*(?:\)?)),??)*\s*(?:\)?))\s+in\s+(.*):c                   \        4       pV P                  V4       VP                  '       d   RV P                  R,          n        \
        P                  V P                  4      pV'       dC   VP                  RVP                  ^4      ,          R4       RVP                  ^4      ,          pV# \        RV P                  ,          4      hV P                  pV# )zconverts a for loop into a context manager wrapped around a for loop
when access to the `loop` variable has been detected in the for loop body
Tzloop = __M_loop._enter(%s)r   zfor %s in loop:zCouldn't apply loop context: %sr_   )LoopVariabler   detectedr   rI  	_FOR_LOOPr*  r   rX   r.  SyntaxError)r   r   loop_variabler*  r   s   &&   r   rJ  rJ    s     !NM&*.

2'		*,u{{1~=
 %u{{1~5D
 K ?$))KLLyyKr!   c                   B   a  ] tR tRt o RtR tR tR tR tR t	Rt
V tR	# )
r  i  zMA node visitor which looks for the name 'loop' within undeclared
identifiers.c                    R V n         R# r{  r  r`   s   &r   r&   LoopVariable.__init__  s	    r!   c                    R VP                  4       9   d
   RV n        R# VP                  4        F  pVP                  V 4       K  	  R# )r   TN)r!  r  rK  r   r  s   && r   _loop_reference_detected%LoopVariable._loop_reference_detected  s;    T0022 DM&&(  & )r!   c                (    V P                  V4       R # r$   r  r   s   &&r   rM  LoopVariable.visitControlLine       %%d+r!   c                (    V P                  V4       R # r$   r  r   s   &&r   rw   LoopVariable.visitCode#  r  r!   c                (    V P                  V4       R # r$   r  r   s   &&r   r8  LoopVariable.visitExpression&  r  r!   r  N)r(   r)   r*   r+   r|  r&   r  rM  rw   r8  r,   r-   r.   s   @r   r  r    s(     ',,, ,r!   r  )r|  rY   r   r   makor   r   r   r   r   
mako.pygenr   r   r   r   RESERVED_NAMES	frozensetr    r   r   r   r  rJ  r  ry   r!   r   <module>r     s     	       $ 
 !"23 V$**+<= ;%P- -8[
 [
|k/ k/\ JJ&	., ,r!   