Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
§
Éß]j# ã ób — d Z ddlmZ ddlmZ ddlmZ ddlmZ G d„ de¦ « Zd„ Z d „ Z
d
S )z_Functions that expose information about templates that might be
interesting for introspection.
é )Únodes)Ú iteritems)Ústring_types)Ú
CodeGeneratorc ó$ — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚTrackingCodeGeneratorz.We abuse the code generator for introspection.c óZ — t j | |dd¦ « t ¦ « | _ d S )Nz)r Ú__init__ÚsetÚundeclared_identifiers)ÚselfÚenvironments úk/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/jinja2/meta.pyr
zTrackingCodeGenerator.__init__ s- € ÝÔ˜t [Ð2CÐEVÑWÔWÐWÝ&)¡e¤eˆÔ#Ð#Ð#ó c ó — dS )zDon't write.N© )r
Úxs r ÚwritezTrackingCodeGenerator.write s € € € r c óÐ — t j | |¦ « t |j j ¦ « D ]6\ }\ }}|dk r(|| j j vr| j |¦ « Œ7dS )z$Remember all undeclared identifiers.ÚresolveN) r Úenter_framer ÚsymbolsÚloadsr Úglobalsr Úadd)r
ÚframeÚ_ÚactionÚparams r r z!TrackingCodeGenerator.enter_frame sw € åÔ! $¨Ñ.Ô.Ð.Ý"+¨E¬MÔ,?Ñ"@Ô"@ð 7ð 7шA‰�˜Ø˜Ò"Ð" u°DÔ4DÔ4LÐ'LÐ'LØÔ+×/Ò/°Ñ6Ô6Ð6øð 7ð 7r N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
r r r r r r r sG € € € € € Ø8Ð8ð,ð ,ð ,ðð ð ð7ð 7ð 7ð 7ð 7r r c ób — t | j ¦ « }| | ¦ « |j S )a Returns a set of all variables in the AST that will be looked up from
the context at runtime. Because at compile time it's not known which
variables will be used depending on the path the execution takes at
runtime, all variables are returned.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
>>> meta.find_undeclared_variables(ast) == set(['bar'])
True
.. admonition:: Implementation
Internally the code generator is used for finding undeclared variables.
This is good to know because the code generator might raise a
:exc:`TemplateAssertionError` during compilation and as a matter of
fact this function can currently raise that exception as well.
)r r Úvisitr )ÚastÚcodegens r Úfind_undeclared_variablesr( s. € õ&