lf#ddlmZddlmZdZdZdZdZddZdd Z Gd d e Z Gd d eZ GddeZ dS)) iteritems) NodeVisitorparamresolvealias undefinedNcxt|}t|}|D]}|||SN)parent)SymbolsFrameSymbolVisitorvisit)nodesparent_symbolssymvisitornodes q/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/jinja2/idtracking.py find_symbolsr sH  ( ( (C %%G d JcPt|}|||Sr )r analyze_node)rrrs rsymbols_for_noders+  ( ( (CT Jrc`eZdZddZdZddZdZdZdZdZ d Z d Z d Z d Z d ZdZdS)r Nc||d}n |jdz}||_||_i|_i|_t |_dS)Nr)levelr refsloadssetstores)selfr rs r__init__zSymbols.__init__sJ =~ q(    ee rc @t|}|j|fi|dSN) RootVisitorr)r"rkwargsrs rrzSymbols.analyze_node%s/d## d%%f%%%%%rcJd|j|fz}||j|<| ||j|<|S)Nzl_%d_%s)rrr)r"nameloadidents r _define_refzSymbols._define_ref)s5TZ.. $   $DJu  rct||jvr |j|S|j|j|SdSr%)rr find_load)r"targets rr.zSymbols.find_load0sB TZ  :f% % ; ";((00 0 # "rct||jvr |j|S|j|j|SdSr%)rr find_refr"r)s rr1zSymbols.find_ref6sA 49  9T? " ; ";''-- - # "rcX||}|td|z|S)NzITried to resolve a name to a reference that was unknown to the frame (%r))r1AssertionError)r"r)rvs rrefz Symbols.ref<s> ]]4  : 0267  rc6t|j}|j|j|j|_|j|_|j|_|Sr%) object__new__ __class____dict__updatercopyrr!)r"r5s rr=z Symbols.copyEsm ^^DN + + 4=)))).."":??$$K$$&&  rc|j|||jvrc|j<|j|}| ||t |fdS||tdfdSdSN)r*)r!addrr r1r,VAR_LOAD_ALIASVAR_LOAD_UNDEFINED)r"r) outer_refs rstorez Symbols.storeMs  ty {& K0066 ($$T0K$LLLF   T);T(B  C C C C C ! rcr|j|||tdfSr?)r!r@r,VAR_LOAD_PARAMETERr2s rdeclare_parameterzSymbols.declare_parameter_s5 ,>+EFFFrct||}| ||t|fdSdSr?)r1r,VAR_LOAD_RESOLVE)r"r)r/s rr*z Symbols.loadcsDt$$ >   T)94(@  A A A A A >rcXi}|D]2}|jD](}||jvr ||ddz||<)3|D]_}|j|j|j|j|j|j`t |D]\}}|t |kr||}| Jd|j.|j|}|t|f|j|<ot|f|j|<dS)Nrrzshould not happen) r!getrr<rrlenr1r rArI) r"branch_symbolsr!branchr/rr) branch_count outer_targets r branch_updatezSymbols.branch_updatehsc$ ; ;F - ; ;T[((!'FA!6!6!:v ; " + +C I  SX & & & J  ci ( ( ( K  sz * * * *"+F"3"3 : : D,s>2222]]4((F%%':%%%{&#{33D99 +*8,)GDJv&"2D!9DJv   : :rcpi}|}|/|jD]}||vr||||<|j}|/|Sr%)r!r1r )r"r5rr)s r dump_storeszSymbols.dump_storessX   3 3r>>#}}T22BtH;D   rct}|}|Ft|jD](\}\}}|tkr||)|j}|F|Sr%)r rrrFr@r )r"r5rr/instr_s rdump_param_targetszSymbols.dump_param_targetssj UU&/ &;&; # #" ...FF6NNN;D   r)NNr%)__name__ __module__ __qualname__r#rr,r.r1r6r=rDrGr*rQrSrWrrr r s    &&&111 ... DDD$GGGBBB :::4rr c\eZdZdZdZexZxZxZxZxZ xZ Z dZ dZ dZd dZdZd Zd S) r&c.t||_dSr%)r sym_visitorr"symbolss rr#zRootVisitor.__init__s-g66rc h|D]}|j|dSr%iter_child_nodesr^rr"rr'childs r _simple_visitzRootVisitor._simple_visitsA**,, * *E   " "5 ) ) ) ) * *rc N|jD]}|j|dSr%bodyr^rrds rvisit_AssignBlockzRootVisitor.visit_AssignBlock7Y * *E   " "5 ) ) ) ) * *rc l|dD]}|j|dS)N)call)excluderbrds rvisit_CallBlockzRootVisitor.visit_CallBlocksF**9*== * *E   " "5 ) ) ) ) * *rc N|jD]}|j|dSr%rhrds rvisit_OverlayScopezRootVisitor.visit_OverlayScoperkrric ~|dkr)|j|jd|j}nl|dkr|j}n^|dkrI|j|jd|j|j|jdSt d|pdD]}|j|dS)NriT)store_as_paramelsetestzUnknown for branchr[)r^rr/rielse_ru RuntimeError)r"r for_branchr'rNitems r visit_ForzRootVisitor.visit_Fors      " "4;t " D D DYFF 6 ! !ZFF 6 ! !   " "4;t " D D Dy$ &&ty111 F344 4Lb ) )D   " "4 ( ( ( ( ) )rc |jD]}|j||jD]}|j|dSr%)targetsr^rri)r"rr'r/res r visit_WithzRootVisitor.visit_Withsbl + +F   " "6 * * * *Y * *E   " "5 ) ) ) ) * *rc:td|jjz)NzCannot find symbols for %r)NotImplementedErrorr:rX)r"rargsr's r generic_visitzRootVisitor.generic_visits!! (4>+B B   rN)ri)rXrYrZr#rfvisit_Template visit_Block visit_Macrovisit_FilterBlock visit_Scopevisit_Ifvisit_ScopedEvalContextModifierrjrorqrzr}rr[rrr&r&s777***DQ QNQQ Q  Q  Q !@*********)))) ***      rr&cteZdZdZdZddZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdS)r zA visitor for `Frame.inspect`.c||_dSr%)r`r_s rr#zFrameSymbolVisitor.__init__s  rFc |s |jdkr!|j|jdS|jdkr!|j|jdS|jdkr!|j|jdSdS)z2All assignments to names go through this function.rrDr*N)ctxr`rGr)rDr*)r"rrsr's r visit_NamezFrameSymbolVisitor.visit_Names  )TX00 L * *49 5 5 5 5 5 X L  ty ) ) ) ) ) X   L  di ( ( ( ( ( rc D|j|jdSr%)r`r*r)r"rr's r visit_NSRefzFrameSymbolVisitor.visit_NSRefs  $)$$$$$rc j|jfijfd}||j}||j}||jpd}j|||gdS)Ncrx_}|D]}j|fi_|Sr%)r=r`r)rr5subnoder'original_symbolsr"s r inner_visitz0FrameSymbolVisitor.visit_If..inner_visitsS 0 5 5 7 7 7DL2  . . 7--f----+DLIrr[)rrur`rielif_rvrQ)r"rr'r body_symbols elif_symbols else_symbolsrs` ` @rrzFrameSymbolVisitor.visit_Ifs 49'''''<       #{49-- "{4:.. "{4:#344  ""L, #MNNNNNrc D|j|jdSr%)r`rDr)rs rrzFrameSymbolVisitor.visit_Macros  49%%%%%rc `|j|fi||j|jdSr%)rr`rDr/rs r visit_ImportzFrameSymbolVisitor.visit_Imports;4**6*** 4;'''''rc |j|fi||jD]R}t|tr!|j|d8|j|SdS)Nr)rnames isinstancetupler`rD)r"rr'r)s rvisit_FromImportz#FrameSymbolVisitor.visit_FromImports4**6***J ) )D$&& ) ""47++++ ""4((((  ) )rc R|j|jfi||j|jfi|dS)z'Visit assignments in the correct order.N)rrr/rs r visit_AssignzFrameSymbolVisitor.visit_Assigns@ 49''''' 4;))&)))))rc ,|j|jfi|dS)zqVisiting stops at for blocks. However the block sequence is visited as part of the outer scope. N)riterrs rrzzFrameSymbolVisitor.visit_Fors&  49'''''''rc ,|j|jfi|dSr%)rrmrs rroz"FrameSymbolVisitor.visit_CallBlock s$ 49'''''''rc ,|j|jfi|dSr%)rfilterrs rrz$FrameSymbolVisitor.visit_FilterBlocks$ 4;))&)))))rc D|jD]}||dSr%)valuesr)r"rr'r/s rr}zFrameSymbolVisitor.visit_Withs2k  F JJv      rc ,|j|jfi|dS)zStop visiting at block assigns.N)rr/rs rrjz$FrameSymbolVisitor.visit_AssignBlocks$ 4;))&)))))rc dS)zStop visiting at scopes.Nr[rs rrzFrameSymbolVisitor.visit_Scoperc dS)zStop visiting at blocks.Nr[rs rrzFrameSymbolVisitor.visit_Blockrrc dS)z!Do not visit into overlay scopes.Nr[rs rrqz%FrameSymbolVisitor.visit_OverlayScope!rrN)F)rXrYrZ__doc__r#rrrrrrrrzrorr}rjrrrqr[rrr r s(())))%%%OOO$&&&((()))*** ((( (((******''''''00000rr r%)_compatrrrrFrIrArBrrr8r r&r r[rrrs   |||||f|||~5 5 5 5 5 +5 5 5 pS0S0S0S0S0S0S0S0S0S0r