OwlCyberSecurity - MANAGER
Edit File: codegen.cpython-312.pyc
� ����e��gx������������������������:����d�Z�ddlZddlZddlZddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlm Z �ddl mZ�d Zd dhZ dd hj������������������e �������Zddddddddd�e��������f d�Z�G�d��d�������Z�G�d��d�������Z�G�d��d�������Z�ej"������������������d�������Zd��Z�G�d��d�������Zy)zVprovides functionality for rendering a parsetree constructing into module source code.�����N)�ast)� exceptions)�filters)� parsetree)�util)� PythonPrinter� ���� UNDEFINED�STOP_RENDERING�context�loopTFc�����������������������t��������j��������������������������}t��������|�������} t��������| t ��������||||||||| | |�������|���������|j��������������������������S�)zYGenerate 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��� �;/opt/hc_python/lib/python3.12/site-packages/mako/codegen.py�compiler"������sc������"�� !� !� #�C��C� �G�����������"���� �� ��"��<�<�>������c�������������������������e�Zd�Zd��Zy)r���c�����������������������||�_���������||�_��������||�_��������||�_��������||�_��������||�_��������||�_��������||�_��������| |�_��������| |�_ ��������||�_ ��������y��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__z_CompileContext.__init__H���sY���������� �� �.���,������,���.���&<��#� 0���&���,��r#���N)�__name__� __module__�__qualname__r(�����r#���r!���r���r���G���s������-r#���r���c�������������������������e�Zd�ZdZd��Zd��Zed����������Zd��Zd��Z d��Z d��Zd ��Zdd�Z d��Zd ��Z �dd�Z � �dd�Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zy )r���zZA template visitor object which generates the full module source for a template. c����������������������||�_���������||�_��������||�_��������d�g|�_��������t ��������|t ��������j������������������t ��������j������������������f�������|�_��������|�j������������������r�d|j������������������z��}|j��������������������������}t��������|j������������������j�������������������������dkD��}t��������|j������������������j!������������������dd��������������}t��������|j������������������j!������������������dd��������������}d�} d�} |j"������������������r�|j$������������������s�|dgz ��}n�|�j'��������������������������} |�j������������������j(������������������} d}| ��| j*������������������j��������������������������}| j*������������������j,������������������s|dgz ��}t��������| j������������������j!������������������dd��������������}|�j������������������j.������������������xs%�t��������| j������������������j!������������������dd��������������|�j������������������_��������ndg}d }d x}}|�d g}nd g|z���D��cg�c]��}|���}}|�j1������������������| xs�||||||��������| �| D�]��}t3��������|||����������|�j������������������s|�j5���������������������������y�y�c�c}w�)Nz render_%sr����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 ���r4���r����namer>����filteredr/���r1����defsrE����as��� r!���r(���z_GenerateRenderMethod.__init__j���s#�������� �� ��� �!%���� �� �(8�(8�)�:L�:L�'M�N����;�;�����.�D��0�0�2�D��4�+�+�0�0�1�A�5�H��D�O�O�/�/� �G�D�E�H��$�/�/�-�-�h��@�A�F��D��G��}�}�T�%6�%6����&���&�&�(�D��m�m�+�+�G� �D��"��(�(�A�A�C���(�(�/�/��\�N�*�D��g�0�0�4�4�X�w�G�H��,0�M�M�,E�,E��-���&�&�*�*�=�'�B�J�� � �)��%�~����"'�'�H�x��<��;�D� )�{�T�1�2�1�!�A�1�D�2��"�"��O�t�T�4��8�V� ������%�g�x��>�����{�{��&�&�(�����3s����0 I c����������������������t��������|�j������������������j�������������������������|�j������������������j������������������|�j������������������j������������������<���|�j������������������j ������������������|�j������������������j������������������|�j������������������j������������������|�j������������������j������������������d�}|�j������������������j������������������ddt��������j������������������|�������d��������y�)N)r���r���r����line_mapz"""�__M_BEGIN_METADATAz__M_END_METADATA """)�maxr ���� source_map�linenor4���r���r���r���� writelines�json�dumps)r'����structs��� r!���rI���z+_GenerateRenderMethod.write_metadata_struct����s�������7:��L�L�#�#�8 ��������� 3� 3�4��� � �.�.��=�=�$�$�#�}�}�<�<����/�/� ��� ������ ��J�J�v��&� r#���c������������������ �����|�j�������������������d���S�)N���)r5����r'���s��� r!����identifiersz!_GenerateRenderMethod.identifiers����s�������$�$�R�(�(r#���c������������������8 ������� ��g��i�� g��d��j�������������������_���������G���� ��fd�d�������}�|��������}��j������������������j������������������D�]��}|j ������������������|����������� ��j�������������������_��������t ����������������}�D�]!��}|j������������������|j���������������������������������}�#�t����������j��������������������������}||_ ����������j�������������������j������������������rH��j�������������������j������������������r2��j������������������j������������������d��j�������������������j������������������z������������j�������������������j������������������rA��j������������������j������������������ddj!��������������������j�������������������j�������������������������������������j������������������j������������������d����������j������������������j������������������d����������j������������������j������������������d ����������j������������������j������������������d ����������j������������������j������������������d����������j������������������j������������������dt"��������z������������j������������������j������������������d t%��������j$��������������������������z������������j������������������j������������������d��j�������������������j&������������������z������������j������������������j������������������d��j�������������������j(������������������z������������j������������������j������������������d��j�������������������j*������������������z������������j������������������j������������������d��j�������������������j������������������z������������j�������������������j,������������������r[d}��j�������������������j,������������������D�]%��}||dz���z ��}��j������������������j������������������|���������'�t/��������j0������������������|dddd��������}nd}|j3��������������������j�������������������������} |j4������������������} | j������������������| j4�������������������������|_��������|j������������������j7������������������t8����������������|r%|j������������������j7������������������|j��������������������������|��j�������������������_����������j������������������j������������������d| j4������������������j=��������������������������D��cg�c]��}|j>���������������������c}z������������j������������������jA������������������d��������tC����������������r��jE���������������������������tC����������������r&��jG������������������� ����������jI�������������������d�����������ntC��������� �������r��jG������������������� ��������tK��������| j4������������������j=���������������������������������S�c�c}w�)zxTraverse a template structure for module-level directives and generate the start of module-level code. Nc��������������������6������e�Zd�Z��fd�Z�fd�Z�fd�Z�fd�Zy)�:_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevelc������������������(�������j������������������|��������y�r&���)�append)�sr����inherits��� �r!����visitInheritTagzJ_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitInheritTag����s����������t�$r#���c������������������$������|�|j�������������������<���y�r&����rJ���)ra���r���� namespacess��� �r!����visitNamespaceTagzL_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitNamespaceTag����s�������(,� �4�9�9�%r#���c������������������(������|�j�������������������_��������y�r&���)r4���rE���)ra���r���r'���s��� �r!����visitPageTagzG_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitPageTag����s�������(,�� � �%r#���c������������������B������|j�������������������r�j������������������|��������y�y�r&���)�ismoduler`���)ra���r����module_codes��� �r!���� visitCodezD_GenerateRenderMethod.write_toplevel.<locals>.FindTopLevel.visitCode����s��������=�=��&�&�t�,��!r#���N)r)���r*���r+���rc���rg���ri���rm���)rb���rl���rf���r'���s�������r!����FindTopLevelr^�������s������� %� -� -� -r#���rn���z# -*- coding:%s -*-zfrom __future__ import �, z(from mako import runtime, filters, cachezUNDEFINED = 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��� r���ztemplate defined imports)�sourcerS����posr���z _exports = %r����rY���)&r4���rE���r����nodes�accept_visitorrf����set�union�declared_identifiers�_Identifiers�declaredr���r���r ���� writeliner����join�MAGIC_NUMBER�timer���r���r���r���r���� PythonCode�branch�topleveldefs�update�TOPLEVEL_DECLAREDr[����valuesrJ����write_blanksr<����write_module_code�write_namespaces� write_inherit�list)r'���rn����f�n�module_ident�module_identifiersr����imp�impcode�main_identifiers�mitrb���rl���rf���s���` @@@r!���rD���z$_GenerateRenderMethod.write_toplevel����s������� ���� ��� $�� � �� -�� -�� �N�������A� ���Q���!��$.�� � � ��u���A�'�-�-�a�.D�.D�.F�G�L����*�$�-�-�8��&2��#�� �M�M�0�0�� � �-�-��L�L�"�"�%�� � �(E�(E�E� ���=�=�'�'��L�L�"�"��9�9�T�]�]�9�9�:�=� �� �����I�J������>�?������H�I������8�9������<�=������3�l�B�C������4�t�y�y�{�B�C������2�T�]�]�5N�5N�N�O������%�� � �(>�(>�>� �� �����3�d�m�m�6G�6G�G�H������#�d�m�m�&C�&C�C� ���=�=� � ��C��}�}�,�,���s�T�z�!�����&�&�s�+��-���n�n�����3��G���G�-�4�4�T�Y�Y�?�� �-�-��*-�)�)��)�)�+ ��'�� �#�#�*�*�+<�=���'�'�.�.�w�/K�/K�L�$6�� � �!�������/�<�<�C�C�E�F�E�!�q�v�v�E�F� G� �� ���!�!�!�$��{���"�"�;�/��w�<��!�!�*�-����w�r�{�+� ��_��!�!�*�-��$�1�1�8�8�:�;�;���Gs����T c������������������f����|�j�������������������r,|j������������������}|r|�j������������������j������������������d|z����������|�j������������������j ������������������|j ��������������������������|�j������������������j ������������������d|�ddj������������������|��������d�dd��������|s|s|r|�j������������������j������������������d��������|�j������������������j������������������|�j������������������j������������������j������������������|�j���������������������������������|�j�������������������r|�j������������������j������������������r,d |v�r(|�j������������������d ���j������������������j!������������������d��������|�j�������������������s�t#��������|�j������������������j$�������������������������dkD��s"t#��������|�j������������������j�������������������������dkD��rT|�j������������������j������������������d dj������������������|�j������������������j������������������D��cg�c] ��}|�d|�����c}�������z����������|�j'������������������|�j������������������d���������|�j������������������j(������������������D�]��} | j+������������������|�����������|�j-������������������|�j������������������|||��������|�j������������������j������������������d��������|�j������������������j/������������������d��������|r"|�j1������������������|||||�j������������������d���������yyc�c}w�)znwrite 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()r2���rY����pageargsr���z!__M_locals = __M_dict_builtin(%s)�=T)�toplevelNrt���)r9���� decoratorr ���r|����start_sourcerS���rT���r}���r5���r`���r4���r[���r����r���rB����argument_declared�addr<����locally_assigned�write_variable_declaresru���rv����write_def_finishr�����write_cache_decorator) r'���r���rJ���r>���r/���rK���r1���r�����xr����s ��� r!���rH���z+_GenerateRenderMethod.write_render_callable��s1�������;�;����I�����&�&�5� �A��� ���!�!�$�+�+�.������!�3�8�8�D�>�2�=�� ���x�6��L�L�"�"�#;�<����$�$��M�M�%�%�,�,�T�Y�Y�7� �����t�y�y�1�1�|�t�7K��!�!�"�%�7�7�;�;�J�G��{�{��� � �1�1�2�Q�6��4�#�#�5�5�6��:��L�L�"�"�3��(�(��"&�!1�!1�!C�!C��!C�A��$%�a�(�!C���� �� �$�$�T�%5�%5��$�E������A� ���T�"��!�� ���d�i�i��8�V�D������t�$����!�!�!�$���&�&��d�D�(�D�,<�,<�t�� '�� ����s����J.c������������������t�����|D�]3��}|�j�������������������j������������������|j������������������|j����������������������������5�y)zewrite module-level template code, i.e. that which is enclosed in <%! %> tags in the template.��starting_linenoN)r ����write_indented_block�textrS���)r'���rl���r����s��� r!���r����z'_GenerateRenderMethod.write_module_codeV��s-��������A��L�L�-�-�a�f�f�a�h�h�-�O��r#���c������������������`�����|�j�������������������j������������������ddd|j������������������d���z��d��������y)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 ���rT����parsed_attributes�r'���r���s��� r!���r����z#_GenerateRenderMethod.write_inherit\��s5������� �����3�0�F��%�%�f�-� /�� r#���c������������������x����������j�������������������j������������������dddddddd����������j�������������������j������������������d��������|j��������������������������D��]���}d|j������������������v�rd ��j ������������������_����������j�������������������j������������������|j��������������������������t��������|j�������������������������r҉�j�������������������j������������������d ��������g����j ������������������j������������������j������������������|��������d ��_ ���������G�����fd�d�������}�|��������}|j������������������D�]��}|j������������������|������������j�������������������j������������������d dj��������������������������z������������j�������������������j������������������d��������d��_ ��������d}nd}d|j ������������������v�rJ��j�������������������j������������������d|j"�������������������d|j ������������������j%������������������dd��������d|�d���������n�d|j ������������������v�rJ��j�������������������j������������������d|j"�������������������d|�d|j ������������������j%������������������dd��������d���������n,��j�������������������j������������������d|j"�������������������d|�d���������t'��������|j������������������j%������������������dd��������������r(��j�������������������j������������������d |j"������������������z������������j�������������������j������������������d!t)��������|j"�������������������������z������������j�������������������j+������������������d"������������t��������|�������s��j�������������������j������������������d#����������j�������������������j������������������d��������y)$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):�importTzdef make_namespace():c��������������������(������e�Zd�Zd��Zd��Z����fd�Zy)�<_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitorc������������������&�����|�j������������������|��������y�r&�����visitDefOrBase�ra���r���s��� r!����visitDefTagzH_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitor.visitDefTag�����������(�(��.r#���c������������������&�����|�j������������������|��������y�r&���r����r����s��� r!���� visitBlockTagzJ_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitor.visitBlockTag���r����r#���c������������������������|j�������������������r t��������j������������������ �di�|j����������������������j ������������������|�d����������j������������������|j��������������������������y�)NF��nested)z.Can't put anonymous blocks inside <%namespace>)rC���r����CompileException�exception_kwargs�write_inline_defr`���r:���)ra���r����exportr[���r'���s��� ���r!���r����zK_GenerateRenderMethod.write_namespaces.<locals>.NSDefVisitor.visitDefOrBase���s[��������,�,�",�"=�"=�!/�#��#'�"7�"7�#��� ��-�-�d�K��-�N�� � �d�m�m�4r#���N�r)���r*���r+���r����r����r����)r����r[���r'���s������r!����NSDefVisitorr������s�������/�/�5r#���r�����return [%s]r����Fzmake_namespace()�Noner����zns = runtime.TemplateNamespace(z3, context._clean_inheritance_tokens(), templateuri=z, callables=z, calling_uri=_template_uri)�modulezns = runtime.ModuleNamespace(z1, context._clean_inheritance_tokens(), callables=z$, calling_uri=_template_uri, module=�)zns = runtime.Namespace(z, calling_uri=_template_uri)�inheritabler0���zcontext['self'].%s = nsz'context.namespaces[(__name__, %s)] = ns�����pass)r ���rT���r|���r����r@���r4����has_ns_importsr����rS���r<���ru���r[���r����r9���rv���r}���r����rJ���rA���r?����reprr����) r'���rf���r���r�����visr����� callable_namer����r[���s ���` @@r!���r����z&_GenerateRenderMethod.write_namespacesg��s������������5��9��0�9��� �� �����H�I��%�%�'�D��4�?�?�*�/3�� � �,��L�L�%�%�d�k�k�2��4�:�:�����&�&�'>�?���"�m�m�7�7�>�>�t�D��"���5��5�"�#�n�����A��$�$�S�)��$����&�&�}�����8H�'I�J����&�&�t�,�#��� 2� � &� ���/�/�/����&�&��� � ��.�.�2�2�6�6�B�%�� ���T�3�3�3����&�&��� � �%��.�.�2�2�8�V�D�� �����&�&���y�y�-�1����D�O�O�'�'� �w�?�@����&�&�'@�D�I�I�'N�O��L�L�"�"�9�D����O�K� �� �L�L�%�%�a�(�U�(�V��:���L�L�"�"�6�*������t�$r#���Nc������������������l����|j�������������������D��ci�c]��}|j������������������|���}}t����������������}|j������������������|j�������������������������}|j������������������|j ������������������j ��������������������������D��cg�c]��}|j���������������������c}�������}|j������������������|j�������������������������}|j������������������|j�������������������������}|�j������������������j������������������rd|v�}|j������������������d��������nd}|�|j������������������|�������}|r�t��������|�j������������������dd�������r�|�j������������������j!������������������d��������d|�j������������������_��������|�j������������������j$������������������j'��������������������������D�]W��\��}} d| j(������������������v�s�|�j������������������j!������������������d|�d t+��������j,������������������d | j(������������������d�����������d����������Y�|r|�j������������������j!������������������d��������|D��]���}||v�r}||���} | j.������������������r4| j0������������������s|�j3������������������| |���������8|�j5������������������| |d� ���������M| j7��������������������������r|�j3������������������| |���������p|�j5������������������| |d� ����������||�j������������������j$������������������v�r"|�j������������������j!������������������|�d|�d�����������t��������|�j������������������dd�������rr|�j������������������j8������������������r6|�j������������������j;������������������|�d|�d�d|z��d|�d|�d�dd|z��dd����������"|�j������������������j!������������������|�d|�d|�d�����������H|�j������������������j8������������������r*|�j������������������j;������������������d|�d|�d�dd|z��d�����������|�j������������������j!������������������|�d|�d�������������|�j������������������j!������������������d��������yc�c}w�c�c}w�)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)zif %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())rL���r:���rw���rx���� undeclared�closuredefsr����� differencer�����locally_declaredr4���r����discard�intersection�getattrr ���r|����has_importsrf����itemsr@����re�splitrB���rC����write_def_declr�����is_rootr���rT���)r'���r[���r�����limit�c�comp_idents�to_write�has_loop�ident�ns�comps��� r!���r����z-_GenerateRenderMethod.write_variable_declares���s?�����(�/:�.>�.>�?�.>��q�z�z�1�}�.>��?��5����>�>�+�"8�"8�9����>�>�!,�!8�!8�!?�!?�!A�B�!A�A�Q�Z�Z�!A�B� ����&�&�{�'D�'D�E����&�&�{�'C�'C�D���=�=�$�$���)�H����V�$��H�����,�,�U�3�H���� � �/?��G��L�L�"�"�#4�5�(,�D�M�M�%�!�]�]�5�5�;�;�=� ��r��r�}�}�,��L�L�*�*��"��H�H�Z����x�1H�I� ���>����L�L�"�"�#J�K��E���#�"�5�)���=�=��,�,��+�+�D�+�>��-�-�d�K��-�M��|�|�~��+�+�D�+�>��-�-�d�K��-�M��$�-�-�2�2�2����&�&�?D�e�L����4�=�=�*:�E�B��}�}�5�5����/�/�$�e�-�1�E�9�"�27��?�.�F��N� � � �����.�.�� %�e�U�4����}�}�5�5����/�/�"�27��?�.�F��N� ������.�.�AF��N��a��h� �����>�?��Q�@��� Cs����N,�1N1c������������������D����|j�������������������}|j��������������������������}|j������������������d��������}|�j������������������sWt��������|�j������������������j �������������������������dkD��s"t��������|�j������������������j�������������������������dkD��r|j������������������dd��������n|j������������������dd��������|�j������������������j������������������d|�ddj������������������|��������d ���������|�j������������������j������������������d |�ddj������������������|��������d���������|�j������������������j������������������d��������y) z>write a locally-available callable referencing a top-level defT��as_callr���zcontext._locals(__M_locals)r���r����r����r����r����zreturn render_r����N)r:���r;���r9���r<���r[���r����r�����insertr ���r|���r}���)r'���r���r[���r:���� namedecls�nameargss��� r!���r����z$_GenerateRenderMethod.write_def_declB��s��������=�=���1�1�3� ��0�0��0�>���{�{��� � �1�1�2�Q�6��4�#�#�5�5�6��:��O�O�A�<�=��O�O�A�y�)�������#�(�(�9�:M�N�O������&.�����0B�C� �� �����t�$r#���c����������� ������������|j��������������������������}|j������������������}|r|�j������������������j������������������d|z����������|�j������������������j������������������d|j�������������������ddj������������������|��������d���������t ��������|j������������������j�������������������������dkD��}t��������|j������������������j������������������dd��������������}t��������|j������������������j������������������d d��������������}|�j������������������j������������������d d��������|s|s|r|�j������������������j������������������d��������|j������������������||� �������}|�j������������������|��������|�j������������������j!������������������|��������|j"������������������D�]��} | j%������������������|�����������|�j������������������j'���������������������������|�j)������������������||||��������|�j������������������j������������������d��������|r#|�j+������������������||j������������������|d|dd���������yy)z?write a locally-available def callable inside an enclosing def.z&@runtime._decorate_inline(context, %s)r����r����r����r����r���r/���r0���r1���r����r����r����r����NFT)�inliner����)r;���r����r ���r|���r:���r}���r<���r=���r>���r?���r@���rA���rT���r����r����r5���r`���ru���rv����popr����r����) r'���r���r[���r����r����r����rK���r/���r1���r����s ��� r!���r����z&_GenerateRenderMethod.write_inline_defU��s��������1�1�3� ��N�N� ���L�L�"�"�8�9�D� �� �����!�]�]�C�H�H�Y�,?�@� ���t�'�'�,�,�-��1������+�+�J��@�A���d�o�o�)�)�(�G�<�=�������=�� � ��x�6��L�L�#�#�$<�=�!�(�(��f�(�=���$�$�[�1����$�$�[�1����A� ���T�"������!�!�#����d�H�h��?������t�$���&�&��� � ������� '�� ��r#���c����������������������|s>|s<|s:|�j�������������������j������������������d��������|r|�j�������������������j������������������ddd��������|s|s|�r|s|r|�j�������������������j������������������dd��������n|�j�������������������j������������������dd��������|r|�j�������������������j������������������d��������d}|r'|�j������������������|j������������������j ������������������|d�������}|�j�������������������j������������������d��������|r)|s'|�j������������������|�j������������������j������������������|d�������}|s|r|�j�������������������j������������������d |z����������y|�j�������������������j������������������d |z��d��������yy)aJ��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|���rT����create_filter_callabler=���r>���r4���r���)r'���r���r/���rK���r1���� callstackra���s��� r!���r����z&_GenerateRenderMethod.write_def_finish���s5��������x��L�L�"�"�;�/�����'�'�� C�T����x�6��6� ����'�'�� A������'�'��L�� �����&�&�'J�K�$�A���/�/��$�$�)�)�1�e���� �L�L�"�"�4�(����/�/��M�M�0�0�!�U�����6����&�&�{�Q��7����'�'�(8�1�(<�k�J�?�$*r#���c����������������������������j�������������������j������������������d|�d|�����������j������������������j������������������dt ��������|��������������}i�} ��j ������������������j�������������������8| j��������������������fd���j ������������������j������������������j������������������D�����������������| j�������������������fd��j������������������D�����������������d| v�rt��������t��������| d�����������������| d<�����j�������������������j������������������d|�d d j������������������|��������d���������|D�� cg�c]#��} d| v�rd | j������������������d�������d���fdz��z��n| ��%�}} ��j������������������||�j�����������������������������������|r�d|�d|�d d j������������������|��������ddj������������������| j��������������������������D��� cg�c] ��\��}} |�d| �d����c} }��������d|�d�}��j��������������������j ������������������j ������������������|d�������}��j�������������������j#������������������d|z���d��������y��j�������������������j#������������������d|�d|�d d j������������������|��������ddj������������������| j��������������������������D��� cg�c] ��\��}} |�d| �d����c} }��������d|�d�dd��������yc�c} w�c�c} }w�c�c} }w�)zhwrite a post-function decorator to replace a rendering callable with a cached version of itself.�__M_z = � cache_keyNc��������������3��������K����|�]B��}|j������������������d��������r/|dk7��r*|dd��j������������������j������������������j������������������|���f����D�y�w��cache_r��������N)� startswithr4���rE���r����)�.0�par'���s��� �r!���� <genexpr>z>_GenerateRenderMethod.write_cache_decorator.<locals>.<genexpr>���sL������������A�B��=�=��*�r�[�/@���A�B�����.�.�@�@��D�E�A�s����AAc��������������3����r����K����|�].��}|j������������������d��������r|dk7��r|dd��j������������������|���f����0�y�wr����)r��r����)r��r���node_or_pagetags��� �r!���r��z>_GenerateRenderMethod.write_cache_decorator.<locals>.<genexpr>���sB����������� �7���}�}�X�&�2��+<�����V�_�6�6�r�:�;�7�s����47�timeoutr����r����r����r����r����z%s=%sr���rt���)r����r����z.context.get('local').cache._ctx_get_or_create(z , lambda:__M_z ), context, rp���ro���z__M_defname=r����Fzreturn z9__M_writer(context.get('local').cache._ctx_get_or_create(z), context, z))r����)r ���r|���r����rA���r����r4���rE���r�����intr?���r}���r����r�����undeclared_identifiersr����r����r���rT���)r'���r��rJ���r>���r/���r[���r����r�����cachekey� cache_argsrM���� pass_args�k�vra���s���`` r!���r����z+_GenerateRenderMethod.write_cache_decorator���s_������� ������d�;�<�"�4�4�8�8���d�� ���� ��=�=� � �,�������-�-�/�/�A�A��� � � ���� �%�7�7� �� � �� �"�$'��Z� �-B�(C�$D�J�y�!�������c�h�h�t�n�E�F��LP� �KO�a�#��(�G������Q��)�A�-�.��A�4�� �� �� �$�$���!�8�8�:�� %�� � ������H�H�Y�'��G�G�8B�8H�8H�8J�K�8J���1�a��+�8J�K������ ���+�+�� � �,�,�a���A�� �L�L�#�#�I��M�4�8��L�L�#�#� ����H�H�Y�'��G�G�8B�8H�8H�8J�K�8J���1�a��+�8J�K�������� ��= ��&�L��(�Ls����(I/�I4�I:c����������������������d��}d|vrx|rv|�j�������������������j������������������r-|�j�������������������j������������������j������������������j������������������|z���}|�j�������������������j������������������rd|vr|�j�������������������j������������������|z���}|D�]W��}|dk(��r� t��������j������������������d|�������}|r#|j������������������dd�������\��}}�||�������} | |z���}n�||�������}|�J��|�d|�d�}�Y�|S�)z�write a filter-applying expression based on the filters present in the given filter names, adjusting for the global 'default' filter aliases as needed.c������������������x�����t��������j������������������d|��������rd|�z���S�t��������j������������������j ������������������|�|��������S�)Nz decode\..+zfilters.)r�����matchr����DEFAULT_ESCAPESrA���re���s��� r!���� locate_encodezC_GenerateRenderMethod.create_filter_callable.<locals>.locate_encode��s4�������x�x� �t�,�!�D�(�(��.�.�2�2�4��>�>r#���r����z (.+?)(\(.*\))r����rt���r����r����)r4���rE���r=���r>���r���r����r���group) r'���r>����target� is_expressionr���e�mr�����fargsr����s ��� r!���r����z,_GenerateRenderMethod.create_filter_callable ��s������� ?���d�?���=�=�(�(��=�=�0�0�<�<�A�A�D�H�D��=�=�0�0�S��_��=�=�8�8�4�?�D��A��C�x�����)�1�-�A�� �w�w�q�!�}���u�!�%�(����I��!�!�$���}�$�}�!"�F�+�F����� r#���c������������������>����|�j�������������������j������������������|j��������������������������t��������|j�������������������������sh|�j ������������������j�������������������3t��������|�j ������������������j������������������j������������������j�������������������������st��������|�j ������������������j�������������������������rS|�j������������������|j������������������j������������������d|j������������������z��d�������}|�j�������������������j������������������d|z����������y�|�j�������������������j������������������d|j������������������z����������y�)Nz%sTr����)r ���r����rS���r<����escapesr4���rE���r=���r>���r���r�����escapes_coder����r|���)r'���r���ra���s��� r!����visitExpressionz%_GenerateRenderMethod.visitExpression)��s����������!�!�$�+�+�.������� � �%�%�1��� � �-�-�9�9�>�>�?��4�=�=�0�0�1��+�+��!�!�&�&��t�y�y�(8�$��A�� �L�L�"�"�#3�a�#7�8��L�L�"�"�#3�d�i�i�#?�@r#���c��������������������������j�������������������rz|�j������������������j������������������d����������j������������������rR|�j������������������j������������������d��������|�j������������������j������������������d��������|�j������������������j������������������d���������y�y�|�j������������������j �������������������j ��������������������������|�j������������������j������������������r&�j������������������dk(��rt���������|�j�������������������������}n�j������������������}|�j������������������j������������������|���������j����������������������������fd�}�r-t��������d���D����������������rt���������fd��D����������������s�|��������r|�j������������������j������������������d��������y�y�)Nr����zloop = __M_loop._exit()�forc��������������������������D�]:��}�t��������|�t��������j�������������������������r�t��������|�t��������j�������������������������r�y�y�y�)NTF�r6���r����Comment�ControlLine)r�����childrens��� �r!����_search_for_control_linezH_GenerateRenderMethod.visitControlLine.<locals>._search_for_control_lineP��s6�������!�A�!�!�Y�%6�%6�7� �#�A�y�'<�'<�=�#� ��"r#���c��������������3����p���K����|�].��}t��������|t��������j������������������t��������j������������������f�����������0�y��wr&���r!��)r��r����s��� r!���r��z9_GenerateRenderMethod.visitControlLine.<locals>.<genexpr>Z��s0�����������%����q�9�#4�#4�i�6K�6K�"L�M�%�s����46c��������������3��������K����|�]G��}t��������|t��������j�������������������������r+�j������������������|j�������������������������xs�|j ����������������������I�y��wr&���)r6���r���r#��� is_ternary�keyword�isend)r��r����r���s��� �r!���r��z9_GenerateRenderMethod.visitControlLine.<locals>.<genexpr>^��sB������������%��!�!�Y�%:�%:�;���_�_�Q�Y�Y�/�:�1�7�7�:�%�s����A Ar����) r*��r ���r|����has_loop_contextr����rS���r4���r���r)���mangle_mako_loopr�����get_children�all)r'���r���r����r%��r$��s��� ` @r!����visitControlLinez&_GenerateRenderMethod.visitControlLine:��s�������:�:��L�L�"�"�4�(��$�$����&�&�z�2����&�&�'@�A����&�&�t�,��%� � �L�L�%�%�d�k�k�2��}�}�(�(�T�\�\�U�-B�'��d�l�l�;���y�y���L�L�"�"�4�(��(�(�*�H� !������%��������%���� �,�-����&�&�v�.��.r#���c�����������������������|�j�������������������j������������������|j��������������������������|�j�������������������j������������������dt ��������|j �������������������������z����������y�)Nr����)r ���r����rS���r|���r�����contentr����s��� r!���� visitTextz_GenerateRenderMethod.visitTextg��s9���������!�!�$�+�+�.������/�$�t�|�|�2D�D�Er#���c����������� �������Z����t��������|j������������������j�������������������������dkD��}|r|�j������������������j ������������������dd��������|j ������������������D�]��}|j ������������������|�����������|rG|�j������������������j ������������������ddd|�j������������������|j������������������j������������������dd�������z��d���������y�y�) Nr���z#__M_writer = context._push_writer()r����r����r����r����r����F)r<���r=���r>���r ���rT���ru���rv���r����)r'���r���rK���r����s��� r!����visitTextTagz"_GenerateRenderMethod.visitTextTagk��s��������t�'�'�,�,�-��1����L�L�#�#�5�v� �����A� ���T�"�����L�L�#�#��H� ��-�-��$�$�)�)�+?������ ��r#���c�����������������������|j�������������������s�|�j������������������j������������������|j������������������|j���������������������������|�j ������������������s�t ��������|�j������������������j�������������������������dkD��rn|�j������������������j������������������d��������|�j������������������j������������������ddj������������������|j��������������������������D��cg�c] ��}t��������|����������c}�������z����������y�y�y�y�c�c}w�)Nr����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����) rk���r ���r����r����rS���r9���r<���r[���r����r|���r}���ry���r����)r'���r���r����s��� r!���rm���z_GenerateRenderMethod.visitCode~��s��������}�}��L�L�-�-�� � �4�;�;�� .�� ���;�;�3�t�'7�'7�'H�'H�#I�A�#M� ����&�&�F������&�&�G���h�h��1J�1J�1L�M�1L�A��Q��1L�M�N�O���$N�;����"� Ns����:Cc������������������>����|�j�������������������j������������������|j��������������������������|j������������������j ������������������d�������}|r0|�j�������������������j������������������d|j������������������d����d|�d���������y�|�j�������������������j������������������d|j������������������d���z����������y�)Nr>���zruntime._include_file(context, r����z, _template_uri, r����z1runtime._include_file(context, %s, _template_uri))r ���r����rS���r@���rA���r|���r����)r'���r���r>���s��� r!����visitIncludeTagz%_GenerateRenderMethod.visitIncludeTag���s����������!�!�$�+�+�.����"�"�6�*����L�L�"�"��)�)�&�1�4�9� � � �L�L�"�"�C��)�)�&�1�3� r#���c������������������������y�r&���r,���r����s��� r!���rg���z'_GenerateRenderMethod.visitNamespaceTag����������r#���c������������������������y�r&���r,���r����s��� r!���r����z!_GenerateRenderMethod.visitDefTag���r9��r#���c����������������������|j�������������������r)|�j������������������j������������������d|j������������������z����������y�|j ������������������d��������}|dgz ��}|�j������������������j������������������d|j������������������z����������|�j������������������j������������������d|j�������������������ddj������������������|��������d ���������|�j������������������j������������������d ��������y�)Nz%s()Tr����r2���zOif 'parent' not in context._data or not hasattr(context._data['parent'], '%s'):zcontext['self'].r����r����r����rq���)rC���r ���r|���r:���r;���r}���)r'���r���r����s��� r!���r����z#_GenerateRenderMethod.visitBlockTag���s�����������L�L�"�"�6�D�M�M�#9�:��4�4�T�4�B�H����&�H��L�L�"�"�>�@D� � �N� �� �L�L�"�"�,0�M�M�3�8�8�H�;M�N� �� �L�L�"�"�4�(r#���c������������������&�����|�j������������������|��������y�r&�����visitCallTagr����s��� r!����visitCallNamespaceTagz+_GenerateRenderMethod.visitCallNamespaceTag���s������� ���$�r#���c�������������������������� ����j�������������������j������������������d��������dg� ��j������������������j������������������|d����������j������������������|d����������j ������������������d����������j ������������������j ����������������������������G���� ��fd�d�������}�|��������}|j������������������D�]��}|j������������������|������������j ������������������j���������������������������|j������������������j��������������������������}��j�������������������j������������������d d j������������������|�������z����������d}|r��j�������������������j������������������dd����������j�����������������������������j ������������������j ���������������������������|j������������������D�]��}|j��������������������������������j ������������������j�����������������������������j������������������||ddd� ����������j�������������������j������������������d�dd j������������������� �������z��d�����������j�������������������j������������������dd����������j�������������������j!������������������|j"����������������������������j�������������������j������������������d��j%������������������g�|j&������������������d�������z��ddd���������y�)Nzdef ccall(caller):�bodyTr����F�callerc��������������������*������e�Zd�Zd��Zd��Z�����fd�Zy)�6_GenerateRenderMethod.visitCallTag.<locals>.DefVisitorc������������������&�����|�j������������������|��������y�r&���r����r����s��� r!���r����zB_GenerateRenderMethod.visitCallTag.<locals>.DefVisitor.visitDefTag����������� � ��&r#���c������������������&�����|�j������������������|��������y�r&���r����r����s��� r!���r����zD_GenerateRenderMethod.visitCallTag.<locals>.DefVisitor.visitBlockTag���rF��r#���c��������������������������j������������������|�d���������|j������������������s�j������������������|j��������������������������|j�������������������j������������������v�r�j������������������|j������������������=�y�y�)NFr����)r����rC���r`���r:���r����)ra���r����body_identifiers�callable_identifiersr����r'���s��� ����r!���r����zE_GenerateRenderMethod.visitCallTag.<locals>.DefVisitor.visitDefOrBase���s_��������%�%�d�,@��%�O��(�(��M�M�$�-�-�0���=�=�$4�$@�$@�@�(�4�4�T�]�]�C��Ar#���Nr����)rI��rJ��r����r'���s�������r!���� DefVisitorrD�����s������� '� '� D�� Dr#���rK��z def body(%s):r����r����r����)r����r����zccontext.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))r����r����z&context.caller_stack.nextcaller = None)r ���r|���r[���r�����add_declaredr5���r`���ru���rv���r����rF���r;���r}���rT���r����r����r����rS���r����� expression) r'���r���rK��r����r�����bodyargsr/���rI��rJ��r����s ���` @@@r!���r>��z"_GenerateRenderMethod.visitCallTag���s�����������3�4����#�/�/�6�6�t�D�6�I��/�6�6�t�E�6�J�� � �%�%�h�/����$�$�%5�6� D�� D� ��l�����A� ���S�!������!�!�#��>�>�:�:�<�����������(�1C�C�D������L�L�#�#�$<�f�E��$�$�%5�6����$�$�%5�6����A� ���T�"������!�!�#����d�H�e�U�e��L�������m�s�x�x��7G�&H�$�O������ +�� � �� ���!�!�$�+�+�.��������)�)�"�d�o�o�t�D� E��4�� r#���)FN)T)FF)r)���r*���r+����__doc__r(���rI����propertyr[���rD���rH���r����r����r����r����r����r����r����r����r����r��r/��r2��r4��rm���r7��rg���r����r����r?��r>��r,���r#���r!���r���r���c���s�������� /)�b �"��)���)�k<�Z7�rP� �[%�z|@�|%�&,�^�;?�1K�t���Q�f�@A�"+/�ZF��&�*� � � )� �B r#���r���c�������������������������e�Zd�ZdZdd�Zd��Zed����������Zd��Zd��Z d��Z d ��Zd ��Zd��Z d��Zd ��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zy)rz���zCtracks the status of identifier names as template code is rendered.Nc������������������@����|�� t��������|t��������j�������������������������r*t����������������|�_��������t��������j��������������������������|�_���������nt��������|j�������������������������j������������������|j������������������j��������������������������D��cg�c]��}|j���������������������c}�������j������������������|j�������������������������j������������������|j�������������������������|�_��������|r*|�j������������������j������������������|j�������������������������|�_��������t��������j������������������di�|j��������������������|�_��������n(t����������������|�_��������t��������j��������������������������|�_��������||�_��������t����������������|�_��������t����������������|�_��������t����������������|�_��������t����������������|�_ ��������t��������j��������������������������|�_ ��������||�_��������|�|j%������������������|���������|�j������������������j&������������������j)������������������|�j�������������������������}|r't+��������j,������������������ddj/������������������|�������z����������y�c�c}w�)Nz'Reserved words declared in template: %sro���r,���)r6���r����NamespaceTagrw���r{���r����SetLikeDictr����rx���r����r����rJ���r����r����r����r4���r����r���rv���r���r����r����NameConflictErrorr}���)r'���r4���r����parentr����r����� illegal_namess��� r!���r(���z_Identifiers.__init__��s����������$� � 6� 6�7� #��� �$(�$4�$4�$6��!� �����(��U�F�,>�,>�,E�,E�,G�H�,G�q�A�F�F�,G�H�I��U�6�2�2�3��U�6�3�3�4� �� ���$(�M�M�$7�$7��8I�8I�$J�D�M��%)�$4�$4�$K�v�7J�7J�$K��!��E�D�M� $� 0� 0� 2�D�� �� ���%��� �!$���� �!$�����"%����� �+�+�-����� �������%�� � �4�4�A�A��!�!� � ����.�.�9��)�)�M�*�+��� ����c�Is����Hc������������������2�����t��������|�j������������������||�fi�|��S�)zUcreate a new Identifiers for a new Node, with this Identifiers as the parent.)rz���r4���)r'���r���rG���s��� r!���r����z_Identifiers.branchH��s��������D�M�M�4��@��@�@r#���c������������������z�����t��������|�j������������������j������������������|�j�������������������������j ���������������������������������S�r&���)rw���r����rx���r����r����rZ���s��� r!���rL���z_Identifiers.defsN��s-�������4�$�$�*�*�4�+;�+;�<�C�C�E�F�Fr#���c����������� �����������dt��������|�j��������������������������dt��������|�j��������������������������dt��������|�j��������������������������d|�j������������������j��������������������������D��cg�c]��}|j���������������������c}�d|�j������������������j��������������������������D��cg�c]��}|j���������������������c}�d|�j�������������������d� S�c�c}w�c�c}w�)NzIdentifiers(declared=z, locally_declared=z , undeclared=z, topleveldefs=z, closuredefs=z, argumentdeclared=r����) r����r{���r����r����r����r����rJ���r����r����)r'���r����s��� r!����__repr__z_Identifiers.__repr__R��s���������T�]�]�#��T�*�*�+��T�_�_�%�!%�!2�!2�!9�!9�!;�<�!;�A����!;�<�!%�!1�!1�!8�!8�!:�;�!:�A����!:�;��&�&� � ���=��;s���� B9�B>c������������������ ����|j��������������������������D�]K��}|dk7��s� ||�j������������������j������������������|�j�������������������������vs�1|�j������������������j������������������|���������M�|j ��������������������������D�]��}|�j������������������j������������������|����������y)zlupdate the state of this Identifiers with the undeclared and declared identifiers of the given node.r���N)r ��r{���rx���r����r����r����ry����r'���r���r����s��� r!����check_declaredz_Identifiers.check_declareda��s}��������0�0�2�E�� �!�e�4�=�=�3F�3F��%�%�4��'�����#�#�E�*� �3� ��.�.�0�E��!�!�%�%�e�,��1r#���c�����������������������|�j�������������������j������������������|��������||�j������������������v�r|�j������������������j������������������|��������y�y�r&���)r{���r����r�����remove)r'���r����s��� r!���rL��z_Identifiers.add_declaredm��s7������� � ���%� ��D�O�O�#��O�O�"�"�5�)��$r#���c������������������&�����|�j������������������|��������y�r&����r^��r����s��� r!���r��z_Identifiers.visitExpressionr������������D�!r#���c������������������&�����|�j������������������|��������y�r&���rb��r����s��� r!���r/��z_Identifiers.visitControlLineu��rc��r#���c�����������������������|j�������������������s@|�j������������������|��������|�j������������������j������������������|j ���������������������������������|�_��������y�y�r&���)rk���r^��r����rx���ry���r����s��� r!���rm���z_Identifiers.visitCodex��sA�������}�}�����%�$(�$9�$9�$?�$?��)�)�+�%�D�!��r#���c������������������f�����|�j�������������������|u�r#|j������������������D�]��}|j������������������|�����������y�y�r&���)r���ru���rv����r'���r���r����s��� r!���rg���z_Identifiers.visitNamespaceTag��s1��������9�9����Z�Z��� � ��&�� ��r#���c������������������������|j������������������|j�������������������������}|||j������������������<���|�K||urF|j������������������s|j������������������r-t��������j������������������d|j������������������z��fi�|j ���������������������y�y�y�)Nz<%%def or %%block named '%s' already exists in this template.)rA���r:���rB���r���r����r����)r'���� collectionr����existings��� r!����_check_name_existsz_Identifiers._check_name_exists���s��������>�>�$�-�-�0��$(� �4�=�=�!�� ���$����(�"3�"3��-�-�+�-1�]�]�;����'�'��� ��#4��%�� !r#���c������������������H����|j��������������������������r)|j������������������s|�j������������������|�j������������������|��������n*||�j������������������ur|�j������������������|�j ������������������|��������|j ��������������������������D�]K��}|dk7��s� ||�j������������������j������������������|�j�������������������������vs�1|�j������������������j������������������|���������M�||�j������������������u�rS|j��������������������������D�]��}|�j������������������j������������������|����������|j������������������D�]��}|j������������������|�����������y�y��Nr���)r����rC���rk��r����r���r����r ��r{���rx���r����r����r����ry���r����ru���rv����r'���r���r����r����s��� r!���r����z_Identifiers.visitDefTag���s��������<�<�>�$�"3�"3��#�#�D�$5�$5�t�<� ���� "��#�#�D�$4�$4�d�;��0�0�2�E�� �!�e�4�=�=�3F�3F��%�%�4��'�����#�#�E�*� �3���4�9�9���2�2�4���&�&�*�*�5�1��5���Z�Z��� � ��&�� � �r#���c����������������������||�j�������������������ur�|j������������������s�t��������|�j�������������������t��������j�������������������������rEt��������j������������������d|j�������������������d|�j�������������������j�������������������d�fi�|j���������������������t��������|�j�������������������t��������j������������������t��������j������������������f�������r.t��������j������������������d|j�������������������d�fi�|j���������������������|j��������������������������D�]K��}|dk7��s� ||�j������������������j������������������|�j�������������������������vs�1|�j������������������j!������������������|���������M�|j������������������sB|�j#������������������|�j$������������������|��������|�j������������������j!������������������|j&��������������������������n*||�j�������������������ur|�j#������������������|�j(������������������|��������|j+��������������������������D�]��}|�j,������������������j!������������������|����������|j.������������������D�]��}|j1������������������|�����������y�)Nz Named block 'z' not allowed inside of def '�'z#' not allowed inside of <%call> tagr���)r���rC���r6���r���r7���r���r����rJ���r�����CallTag�CallNamespaceTagr ��r{���rx���r����r����r����rk��r����r:���r����ry���r����ru���rv���rn��s��� r!���r����z_Identifiers.visitBlockTag���s�������t�y�y� ��):�):��$�)�)�Y�%5�%5�6� �1�1��y�y�$�)�)�.�.�2����+�+���� ��� � �I�-�-�y�/I�/I�J���!�1�1��y�y�#����+�+������0�0�2�E�� �!�e�4�=�=�3F�3F��%�%�4��'�����#�#�E�*� �3��� � ��#�#�D�$5�$5�t�<��O�O���� � �.� ���� "��#�#�D�$4�$4�d�;��.�.�0�E��"�"�&�&�u�-��1����A� ���T�"��r#���c�����������������������|j��������������������������D�]K��}|dk7��s� ||�j������������������j������������������|�j�������������������������vs�1|�j������������������j������������������|���������M�y�rm��)r ��r{���rx���r����r����r����r]��s��� r!���r4��z_Identifiers.visitTextTag���sR�������0�0�2�E�� �!�e�4�=�=�3F�3F��%�%�4��'�����#�#�E�*� �3r#���c������������������&�����|�j������������������|��������y�r&���rb��r����s��� r!���r7��z_Identifiers.visitIncludeTag���rc��r#���c�����������������������|j��������������������������D�]��}|�j������������������j������������������|����������|�j������������������|��������y�r&���)ry���r����r����r^��r]��s��� r!���ri���z_Identifiers.visitPageTag���s7�������.�.�0�E��"�"�&�&�u�-��1����D�!r#���c������������������&�����|�j������������������|��������y�r&���r=��r����s��� r!���r?��z"_Identifiers.visitCallNamespaceTag���s���������$�r#���c������������������>����||�j�������������������u�r�|j��������������������������D�]K��}|dk7��s� ||�j������������������j������������������|�j�������������������������vs�1|�j ������������������j ������������������|���������M�|j��������������������������D�]��}|�j������������������j ������������������|����������|j������������������D�]��}|j������������������|�����������y�|j��������������������������D�]K��}|dk7��s� ||�j������������������j������������������|�j�������������������������vs�1|�j ������������������j ������������������|���������M�y�rm��)r���r ��r{���rx���r����r����r����ry���r����ru���rv���rn��s��� r!���r>��z_Identifiers.visitCallTag���s��������4�9�9���4�4�6���I�%�%�t�}�}�7J�7J��)�)�8��+���O�O�'�'��.� �7� ��2�2�4���&�&�*�*�5�1��5��Z�Z��� � ��&�� ���4�4�6���I�%�%�t�}�}�7J�7J��)�)�8��+���O�O�'�'��.� �7r#���)NNF)r)���r*���r+���rO��r(���r����rP��rL���r[��r^��rL��r��r/��rm���rg���rk��r����r����r4��r7��ri���r?��r>��r,���r#���r!���rz���rz�����st������M�A�FA���G���G� � -�*� "�"��'��'�(#�B+�"�"� �/r#���rz���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������������������z����t����������������}|�j������������������|��������|j������������������r�d|�j������������������d���_��������t ��������j ������������������|�j�������������������������}|r:|j������������������d|j������������������d�������z��d��������d|j������������������d�������z��}|S�t��������d|�j������������������z����������|�j������������������}|S�) z�converts 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 TrY���zloop = __M_loop._enter(%s)rt���r����zfor %s in loop:r����zCouldn't apply loop context: %s)�LoopVariablerv����detectedru���r+��� _FOR_LOOPr��r����rT���r���SyntaxError)r���r ���� loop_variabler��r����s��� r!���r,��r,�����s��������!�N�M���� �&����*.�� � �2��'����� � �*������,�u�{�{�1�~�=�� � �%�u�{�{�1�~�5�D� ��K���?�$�)�)�K�L�L��y�y���Kr#���c��������������������.�����e�Zd�ZdZd��Zd��Zd��Zd��Zd��Zy)ry��zQA node visitor which looks for the name 'loop' within undeclared identifiers.c�����������������������d|�_���������y�)NF)rz��rZ���s��� r!���r(���zLoopVariable.__init__��s �������� r#���c�����������������������d|j��������������������������v�rd|�_��������y�|j��������������������������D�]��}|j������������������|�����������y�)Nr ���T)r ��rz��r-��rv���rg��s��� r!����_loop_reference_detectedz%LoopVariable._loop_reference_detected��s;�������T�0�0�2�2� �D�M��&�&�(��� � ��&��)r#���c������������������&�����|�j������������������|��������y�r&����r���r����s��� r!���r/��zLoopVariable.visitControlLine ����������%�%�d�+r#���c������������������&�����|�j������������������|��������y�r&���r���r����s��� r!���rm���zLoopVariable.visitCode#��r���r#���c������������������&�����|�j������������������|��������y�r&���r���r����s��� r!���r��zLoopVariable.visitExpression&��r���r#���N) r)���r*���r+���rO��r(���r���r/��rm���r��r,���r#���r!���ry��ry����s ��������'�,�,�,r#���ry��)rO��rU���r����r����makor���r���r���r���r���� mako.pygenr���r~���r����rx����RESERVED_NAMES� frozensetr"���r���r���rz���r{��r,��ry��r,���r#���r!����<module>r������s���������� ��������������$���� �!�"2�3����V�$�*�*�+<�=�������������;�%�P-��-�8[ ��[ �|k/��k/�\� �B�J�J�&� � ��.,��,r#���