AlkantarClanX12

Your IP : 18.117.8.177


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/jinja2/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/jinja2/__pycache__/meta.cpython-311.pyc

�

�܋f,��`�dZddlZddlmZddlmZddlmZejrddl	m
Z
Gd�d	e��Zd
ejdej
efd�ZejejejejfZejejejejejfZd
ejdejejefd
�ZdS)z_Functions that expose information about templates that might be
interesting for introspection.
�N�)�nodes)�
CodeGenerator)�Frame)�Environmentc�H��eZdZdZd�fd�Zdeddfd�Zd	eddf�fd
�Z�xZ	S)�TrackingCodeGeneratorz.We abuse the code generator for introspection.�environmentr�returnNc�t��t���|dd��t��|_dS)Nz<introspection>)�super�__init__�set�undeclared_identifiers)�selfr
�	__class__s  ��\/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/jinja2/meta.pyrzTrackingCodeGenerator.__init__s3���
������&7�9J�K�K�K�25�%�%��#�#�#��xc��dS)zDon't write.N�)rrs  r�writezTrackingCodeGenerator.writes���r�framec����t���|��|jj���D]6\}\}}|dkr(||jjvr|j�|���7dS)z$Remember all undeclared identifiers.�resolveN)	r
�enter_frame�symbols�loads�itemsr
�globalsr�add)rr�_�action�paramrs     �rrz!TrackingCodeGenerator.enter_frames����
�����E�"�"�"�"'�-�"5�";�";�"=�"=�	7�	7��A������"�"�u�D�4D�4L�'L�'L��+�/�/��6�6�6��	7�	7r)r
rrN)
�__name__�
__module__�__qualname__�__doc__r�strrrr�
__classcell__)rs@rr	r	s��������8�8�8�8�8�8�8�8��s��t�����7��7�4�7�7�7�7�7�7�7�7�7�7rr	�astrc�b�t|j��}|�|��|jS)aReturns 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) == {'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)r+�codegens  r�find_undeclared_variablesr/!s.��&$�C�O�4�4�G��M�M�#�����)�)rc#�K�|�t��D�]$}|j}t|tj��sxt|tjtjf��rM|jD]D}t|tj��r$t|j	t��r	|j	V��@dV��EndV���t|j	t��r
|j	V���t|tj��rFt|j	ttf��r%|j	D]}t|t��r|V���� dV���&dS)abFinds all the referenced templates from the AST.  This will return an
    iterator over all the hardcoded template extensions, inclusions and
    imports.  If dynamic inheritance or inclusion is used, `None` will be
    yielded.

    >>> from jinja2 import Environment, meta
    >>> env = Environment()
    >>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
    >>> list(meta.find_referenced_templates(ast))
    ['layout.html', None]

    This function is useful for dependency tracking.  For example if you want
    to rebuild parts of the website after a layout template has changed.
    N)�find_all�
_ref_types�template�
isinstancer�Const�Tuple�Listr�valuer)�Include�tuple�list)r+�noder3�
template_names    r�find_referenced_templatesr>=sk����"���Z�(�(�!�!��#�}���(�E�K�0�0�	��(�U�[�%�*�$=�>�>�
�%-�^�#�#�M�"�-���=�=�#�%�m�&9�3�?�?�6�"/�"5�5�5�5��#�
�
�
�
�#��
�
�
���h�n�c�*�*�
	��.� � � � ���e�m�
,�
,�	���N�U�D�M�2
�2
�	�"*��
(�
(�
��m�S�1�1�(�'�'�'�'��
(�
�J�J�J�J�C!�!r)r(�typing�t�r�compilerrr�
TYPE_CHECKINGr
rr	�Template�Setr)r/�Extends�
FromImport�Importr9r2�Union�_RefType�Iterator�Optionalr>rrr�<module>rMs5��������������#�#�#�#�#�#��������?�)�(�(�(�(�(�(�7�7�7�7�7�M�7�7�7�&*�5�>�*�a�e�C�j�*�*�*�*�0�m�U�-�u�|�U�]�
K�
��7�5�=�%�"2�E�L�%�-�O�P��2�5�>�2�a�j���C��6Q�2�2�2�2�2�2r