Ë
    êmxi&“  ã                   óî  — d Z ddlZddlmZ ddlZddlZddlZddlZddl	Z	ddl
mZ ddlmZ ddlmZmZmZ ddlmZmZmZmZmZmZmZmZ ddlZej6                  rddlmZmZ d	Z G d
„ d«      Z e«       Z de!de!de!fd„Z" G d„ d«      Z# G d„ d«      Z$ G d„ de$«      Z% G d„ de$«      Z& G d„ d«      Z' G d„ de'«      Z( G d„ de'«      Z) G d„ de'«      Z* G d „ d!e'«      Z+ G d"„ d#e'«      Z, G d$„ d%e'«      Z- G d&„ d'e'«      Z. G d(„ d)e'«      Z/ G d*„ d+e'«      Z0 G d,„ d-e'«      Z1 G d.„ d/e1«      Z2 G d0„ d1e'«      Z3 G d2„ d3e4«      Z5 G d4„ d5«      Z6 G d6„ d7«      Z7d8e!de!fd9„Z8	 	 d?d:e7d;e#d<ee!   d=ee!   de)f
d>„Z9y)@aŒ  A simple template system that compiles templates to Python code.

Basic usage looks like::

    t = template.Template("<html>{{ myvalue }}</html>")
    print(t.generate(myvalue="XXX"))

`Loader` is a class that loads templates from a root directory and caches
the compiled templates::

    loader = template.Loader("/home/btaylor")
    print(loader.load("test.html").generate(myvalue="XXX"))

We compile all templates to raw Python. Error-reporting is currently... uh,
interesting. Syntax for the templates::

    ### base.html
    <html>
      <head>
        <title>{% block title %}Default title{% end %}</title>
      </head>
      <body>
        <ul>
          {% for student in students %}
            {% block student %}
              <li>{{ escape(student.name) }}</li>
            {% end %}
          {% end %}
        </ul>
      </body>
    </html>

    ### bold.html
    {% extends "base.html" %}

    {% block title %}A bolder title{% end %}

    {% block student %}
      <li><span style="bold">{{ escape(student.name) }}</span></li>
    {% end %}

Unlike most other template systems, we do not put any restrictions on the
expressions you can include in your statements. ``if`` and ``for`` blocks get
translated exactly into Python, so you can do complex expressions like::

   {% for student in [p for p in people if p.student and p.age > 23] %}
     <li>{{ escape(student.name) }}</li>
   {% end %}

Translating directly to Python means you can apply functions to expressions
easily, like the ``escape()`` function in the examples above. You can pass
functions in to your template just like any other variable
(In a `.RequestHandler`, override `.RequestHandler.get_template_namespace`)::

   ### Python code
   def add(x, y):
      return x + y
   template.execute(add=add)

   ### The template
   {{ add(1, 2) }}

We provide the functions `escape() <.xhtml_escape>`, `.url_escape()`,
`.json_encode()`, and `.squeeze()` to all templates by default.

Typical applications do not create `Template` or `Loader` instances by
hand, but instead use the `~.RequestHandler.render` and
`~.RequestHandler.render_string` methods of
`tornado.web.RequestHandler`, which load templates automatically based
on the ``template_path`` `.Application` setting.

Variable names beginning with ``_tt_`` are reserved by the template
system and should not be used by application code.

Syntax Reference
----------------

Template expressions are surrounded by double curly braces: ``{{ ... }}``.
The contents may be any python expression, which will be escaped according
to the current autoescape setting and inserted into the output.  Other
template directives use ``{% %}``.

To comment out a section so that it is omitted from the output, surround it
with ``{# ... #}``.


To include a literal ``{{``, ``{%``, or ``{#`` in the output, escape them as
``{{!``, ``{%!``, and ``{#!``, respectively.


``{% apply *function* %}...{% end %}``
    Applies a function to the output of all template code between ``apply``
    and ``end``::

        {% apply linkify %}{{name}} said: {{message}}{% end %}

    Note that as an implementation detail apply blocks are implemented
    as nested functions and thus may interact strangely with variables
    set via ``{% set %}``, or the use of ``{% break %}`` or ``{% continue %}``
    within loops.

``{% autoescape *function* %}``
    Sets the autoescape mode for the current file.  This does not affect
    other files, even those referenced by ``{% include %}``.  Note that
    autoescaping can also be configured globally, at the `.Application`
    or `Loader`.::

        {% autoescape xhtml_escape %}
        {% autoescape None %}

``{% block *name* %}...{% end %}``
    Indicates a named, replaceable block for use with ``{% extends %}``.
    Blocks in the parent template will be replaced with the contents of
    the same-named block in a child template.::

        <!-- base.html -->
        <title>{% block title %}Default title{% end %}</title>

        <!-- mypage.html -->
        {% extends "base.html" %}
        {% block title %}My page title{% end %}

``{% comment ... %}``
    A comment which will be removed from the template output.  Note that
    there is no ``{% end %}`` tag; the comment goes from the word ``comment``
    to the closing ``%}`` tag.

``{% extends *filename* %}``
    Inherit from another template.  Templates that use ``extends`` should
    contain one or more ``block`` tags to replace content from the parent
    template.  Anything in the child template not contained in a ``block``
    tag will be ignored.  For an example, see the ``{% block %}`` tag.

``{% for *var* in *expr* %}...{% end %}``
    Same as the python ``for`` statement.  ``{% break %}`` and
    ``{% continue %}`` may be used inside the loop.

``{% from *x* import *y* %}``
    Same as the python ``import`` statement.

``{% if *condition* %}...{% elif *condition* %}...{% else %}...{% end %}``
    Conditional statement - outputs the first section whose condition is
    true.  (The ``elif`` and ``else`` sections are optional)

``{% import *module* %}``
    Same as the python ``import`` statement.

``{% include *filename* %}``
    Includes another template file.  The included file can see all the local
    variables as if it were copied directly to the point of the ``include``
    directive (the ``{% autoescape %}`` directive is an exception).
    Alternately, ``{% module Template(filename, **kwargs) %}`` may be used
    to include another template with an isolated namespace.

``{% module *expr* %}``
    Renders a `~tornado.web.UIModule`.  The output of the ``UIModule`` is
    not escaped::

        {% module Template("foo.html", arg=42) %}

    ``UIModules`` are a feature of the `tornado.web.RequestHandler`
    class (and specifically its ``render`` method) and will not work
    when the template system is used on its own in other contexts.

``{% raw *expr* %}``
    Outputs the result of the given expression without autoescaping.

``{% set *x* = *y* %}``
    Sets a local variable.

``{% try %}...{% except %}...{% else %}...{% finally %}...{% end %}``
    Same as the python ``try`` statement.

``{% while *condition* %}... {% end %}``
    Same as the python ``while`` statement.  ``{% break %}`` and
    ``{% continue %}`` may be used inside the loop.

``{% whitespace *mode* %}``
    Sets the whitespace mode for the remainder of the current file
    (or until the next ``{% whitespace %}`` directive). See
    `filter_whitespace` for available options. New in Tornado 4.3.
é    N)ÚStringIO)Úescape)Úapp_log)Ú
ObjectDictÚexec_inÚunicode_type)ÚAnyÚUnionÚCallableÚListÚDictÚIterableÚOptionalÚTextIO)ÚTupleÚContextManagerÚxhtml_escapec                   ó   — e Zd Zy)Ú_UnsetMarkerN)Ú__name__Ú
__module__Ú__qualname__© ó    úG/home/htdocs/ttos/venv/lib/python3.12/site-packages/tornado/template.pyr   r   Ü   s   „ Ør   r   ÚmodeÚtextÚreturnc                 óÎ   — | dk(  r|S | dk(  r0t        j                  dd|«      }t        j                  dd|«      }|S | dk(  rt        j                  dd|«      S t        d	| z  «      ‚)
a’  Transform whitespace in ``text`` according to ``mode``.

    Available modes are:

    * ``all``: Return all whitespace unmodified.
    * ``single``: Collapse consecutive whitespace with a single whitespace
      character, preserving newlines.
    * ``oneline``: Collapse all runs of whitespace into a single space
      character, removing all newlines in the process.

    .. versionadded:: 4.3
    ÚallÚsinglez([\t ]+)ú z
(\s*\n\s*)ú
Úonelinez(\s+)zinvalid whitespace mode %s)ÚreÚsubÚ	Exception)r   r   s     r   Úfilter_whitespacer(   ã   sm   € ð ˆu‚}ØˆØ	�Ò	Ü�v‰v�k 3¨Ó-ˆÜ�v‰v�m T¨4Ó0ˆØˆØ	�Ò	Ü�v‰v�h  TÓ*Ð*äÐ4°tÑ;Ó<Ð<r   c                   ó²   — e Zd ZdZddeedfdeeef   deded   dee	e
f   d	eeee
f      d
ee   ddfd„Zdedefd„Zded   defd„Zded   ded   fd„Zy)ÚTemplatez—A compiled template.

    We compile into Python from the given template_string. You can generate
    the template from variables with generate().
    z<string>NÚtemplate_stringÚnameÚloaderÚ
BaseLoaderÚcompress_whitespaceÚ
autoescapeÚ
whitespacer   c                 ó   — t        j                  |«      | _        |t        ur|�t	        d«      ‚|rdnd}|€B|r|j
                  r|j
                  }n'|j                  d«      s|j                  d«      rd}nd}|€J ‚t        |d«       t        |t        «      s|| _
        n|r|j                  | _
        nt        | _
        |r|j                  ni | _        t        |t        j                  |«      |«      }t        | t        || «      «      | _        | j#                  |«      | _        || _        	 t)        t        j*                  | j$                  «      d| j                  j-                  d	d
«      z  dd¬«      | _        y# t        $ rF t1        | j$                  «      j3                  «       }t5        j6                  d| j                  |«       ‚ w xY w)a³  Construct a Template.

        :arg str template_string: the contents of the template file.
        :arg str name: the filename from which the template was loaded
            (used for error message).
        :arg tornado.template.BaseLoader loader: the `~tornado.template.BaseLoader` responsible
            for this template, used to resolve ``{% include %}`` and ``{% extend %}`` directives.
        :arg bool compress_whitespace: Deprecated since Tornado 4.3.
            Equivalent to ``whitespace="single"`` if true and
            ``whitespace="all"`` if false.
        :arg str autoescape: The name of a function in the template
            namespace, or ``None`` to disable escaping by default.
        :arg str whitespace: A string specifying treatment of whitespace;
            see `filter_whitespace` for options.

        .. versionchanged:: 4.3
           Added ``whitespace`` parameter; deprecated ``compress_whitespace``.
        Nz2cannot set both whitespace and compress_whitespacer!   r    z.htmlz.jsÚ z%s.generated.pyú.Ú_ÚexecT)Údont_inheritz%s code:
%s)r   Ú
native_strr,   Ú_UNSETr'   r1   Úendswithr(   Ú
isinstancer   r0   Ú_DEFAULT_AUTOESCAPEÚ	namespaceÚ_TemplateReaderÚ_FileÚ_parseÚfileÚ_generate_pythonÚcoder-   ÚcompileÚ
to_unicodeÚreplaceÚcompiledÚ_format_codeÚrstripr   Úerror)	Úselfr+   r,   r-   r/   r0   r1   ÚreaderÚformatted_codes	            r   Ú__init__zTemplate.__init__  s‘  € ô6 ×%Ñ% dÓ+ˆŒ	à¤fÑ,àÐ%ÜÐ TÓUÐUÙ%8™¸eˆJØÐÙ˜&×+Ò+Ø#×.Ñ.‘
ð —=‘= Ô)¨T¯]©]¸5Ô-AØ!)‘Jà!&�JàÐ%Ð%Ð%Ü˜* bÔ)ä˜*¤lÔ3Ø(ˆD�OÙØ$×/Ñ/ˆD�Oä1ˆDŒOá-3˜×)Ò)¸ˆŒÜ  ¤v×'8Ñ'8¸Ó'IÈ:ÓVˆÜ˜$¤ v¨tÓ 4Ó5ˆŒ	Ø×)Ñ)¨&Ó1ˆŒ	ØˆŒð	ô
 $Ü×!Ñ! $§)¡)Ó,Ø! D§I¡I×$5Ñ$5°c¸3Ó$?Ñ?ØØ!ô	ˆD�Møô ò 	Ü)¨$¯)©)Ó4×;Ñ;Ó=ˆNÜ�M‰M˜.¨$¯)©)°^ÔDØð	ús   Ä/AE> Å>AGÚkwargsc                 óT  ‡ — t         j                  t         j                  t         j                  t         j                  t         j                  t         j
                  t        t         j                  t        t        f‰ j                  j                  dd«      t        ˆ fd„¬«      dœ}|j                  ‰ j                  «       |j                  |«       t        ‰ j                   |«       t#        j$                  t&        g t        f   |d   «      }t)        j*                  «         |«       S )z0Generate this template with the given arguments.r4   r5   c                 ó   •— ‰j                   S ©N)rC   )r,   rK   s    €r   ú<lambda>z#Template.generate.<locals>.<lambda>`  s   ø€ ¸T¿Y¹Y€ r   )Ú
get_source)r   r   Ú
url_escapeÚjson_encodeÚsqueezeÚlinkifyÚdatetimeÚ_tt_utf8Ú_tt_string_typesr   Ú
__loader__Ú_tt_execute)r   r   rU   rV   rW   rX   rY   Úutf8r   Úbytesr,   rF   r   Úupdater=   r   rG   ÚtypingÚcastr   Ú	linecacheÚ
clearcache)rK   rO   r=   Úexecutes   `   r   ÚgeneratezTemplate.generateQ  sÓ   ø€ ô ×)Ñ)Ü"×/Ñ/Ü ×+Ñ+Ü!×-Ñ-Ü—~‘~Ü—~‘~Ü ÜŸ™Ü!-¬uÐ 5ð Ÿ	™	×)Ñ)¨#¨sÓ3Ü$Ó0FÔGñ
ˆ	ð 	×Ñ˜Ÿ™Ô(Ø×Ñ˜Ô Ü�—‘˜yÔ)Ü—+‘+œh r¬5 yÑ1°9¸]Ñ3KÓLˆô 	×ÑÔÙ‹yÐr   c                 óX  — t        «       }	 i }| j                  |«      }|j                  «        |D ]  }|j                  ||«       Œ t	        ||||d   j
                  «      }|d   j                  |«       |j                  «       |j                  «        S # |j                  «        w xY w©Nr   )	r   Ú_get_ancestorsÚreverseÚfind_named_blocksÚ_CodeWriterÚtemplaterf   ÚgetvalueÚclose)rK   r-   ÚbufferÚnamed_blocksÚ	ancestorsÚancestorÚwriters          r   rB   zTemplate._generate_pythonl  s™   € Ü“ˆð	àˆLØ×+Ñ+¨FÓ3ˆIØ×ÑÔØ%ò A�Ø×*Ñ*¨6°<Õ@ðAä  ¨°v¸yÈ¹|×?TÑ?TÓUˆFØ�a‰L×!Ñ! &Ô)Ø—?‘?Ó$à�L‰L�NøˆF�L‰L�Nús   ŒA:B ÂB)r?   c                 ó2  — | j                   g}| j                   j                  j                  D ]f  }t        |t        «      sŒ|st        d«      ‚|j                  |j                  | j                  «      }|j                  |j                  |«      «       Œh |S )Nz1{% extends %} block found, but no template loader)
rA   ÚbodyÚchunksr;   Ú_ExtendsBlockÚ
ParseErrorÚloadr,   Úextendri   )rK   r-   rr   Úchunkrm   s        r   ri   zTemplate._get_ancestors{  s„   € Ø—Y‘Y�Kˆ	Ø—Y‘Y—^‘^×*Ñ*ò 	BˆEÜ˜%¤Õ/ÙÜ$ØNóð ð "Ÿ;™; u§z¡z°4·9±9Ó=�Ø× Ñ  ×!8Ñ!8¸Ó!@ÕAð	Bð Ðr   )r   r   r   Ú__doc__r9   r
   Ústrr_   r   Úboolr   rN   r	   rf   rB   r   ri   r   r   r   r*   r*   ü   sÜ   „ ñð Ø)-Ø9?Ø9?Ø$(ñIà˜s E˜zÑ*ðIð ðIð ˜Ñ&ð	Ið
 # 4¨Ð#5Ñ6ðIð ˜U 3¨Ð#4Ñ5Ñ6ðIð ˜S‘MðIð 
óIðV ð ¨ó ð6 x°Ñ'=ð À#ó ð
 X¨lÑ%;ð 
ÀÀWÁô 
r   r*   c            	       óœ   — e Zd ZdZeddfdee   deeeef      dee   ddfd„Z	dd„Z
dd	ed
ee   defd„Zdd	ed
ee   defd„Zd	edefd„Zy)r.   zàBase class for template loaders.

    You must use a template loader to use template constructs like
    ``{% extends %}`` and ``{% include %}``. The loader caches all
    templates after they are loaded the first time.
    Nr0   r=   r1   r   c                 óv   — || _         |xs i | _        || _        i | _        t	        j
                  «       | _        y)a�  Construct a template loader.

        :arg str autoescape: The name of a function in the template
            namespace, such as "xhtml_escape", or ``None`` to disable
            autoescaping by default.
        :arg dict namespace: A dictionary to be added to the default template
            namespace, or ``None``.
        :arg str whitespace: A string specifying default behavior for
            whitespace in templates; see `filter_whitespace` for options.
            Default is "single" for files ending in ".html" and ".js" and
            "all" for other files.

        .. versionchanged:: 4.3
           Added ``whitespace`` parameter.
        N)r0   r=   r1   Ú	templatesÚ	threadingÚRLockÚlock)rK   r0   r=   r1   s       r   rN   zBaseLoader.__init__�  s4   € ð* %ˆŒØ"š bˆŒØ$ˆŒØˆŒô —O‘OÓ%ˆ�	r   c                 óT   — | j                   5  i | _        ddd«       y# 1 sw Y   yxY w)z'Resets the cache of compiled templates.N)r…   r‚   ©rK   s    r   ÚresetzBaseLoader.reset°  s%   € à�Y‰Yñ 	 ØˆDŒN÷	 ÷ 	 ñ 	 ús   �ž'r,   Úparent_pathc                 ó   — t        «       ‚)z@Converts a possibly-relative path to absolute (used internally).©ÚNotImplementedError©rK   r,   r‰   s      r   Úresolve_pathzBaseLoader.resolve_pathµ  s   € ä!Ó#Ð#r   c                 óâ   — | j                  ||¬«      }| j                  5  || j                  vr| j                  |«      | j                  |<   | j                  |   cddd«       S # 1 sw Y   yxY w)zLoads a template.)r‰   N)rŽ   r…   r‚   Ú_create_templater�   s      r   rz   zBaseLoader.load¹  sd   € à× Ñ  °;Ð Ó?ˆØ�Y‰Yñ 	(Ø˜4Ÿ>™>Ñ)Ø'+×'<Ñ'<¸TÓ'B�—‘˜tÑ$Ø—>‘> $Ñ'÷	(÷ 	(ò 	(ús    ;A%Á%A.c                 ó   — t        «       ‚rR   r‹   ©rK   r,   s     r   r�   zBaseLoader._create_templateÁ  ó   € Ü!Ó#Ð#r   )r   NrR   )r   r   r   r}   r<   r   r~   r   r	   rN   rˆ   rŽ   r*   rz   r�   r   r   r   r.   r.   ˆ  s§   „ ñð %8Ø.2Ø$(ñ	&à˜S‘Mð&ð ˜D  c ™NÑ+ð&ð ˜S‘Mð	&ð
 
ó&ó@ ñ
$ ð $°8¸C±=ð $ÈCó $ñ(˜ð (¨8°C©=ð (ÀHó (ð$ Sð $¨Xô $r   r.   c                   ó\   ‡ — e Zd ZdZdededdfˆ fd„Zddedee   defd	„Zdede	fd
„Z
ˆ xZS )ÚLoaderz:A template loader that loads from a single root directory.Úroot_directoryrO   r   Nc                 ól   •— t        ‰| �  di |¤Ž t        j                  j	                  |«      | _        y ©Nr   )ÚsuperrN   ÚosÚpathÚabspathÚroot)rK   r–   rO   Ú	__class__s      €r   rN   zLoader.__init__È  s'   ø€ Ü‰ÑÑ"˜6Ò"Ü—G‘G—O‘O NÓ3ˆ�	r   r,   r‰   c                 ó$  — |�r|j                  d«      sû|j                  d«      sê|j                  d«      sÙt        j                  j                  | j                  |«      }t        j                  j                  t        j                  j                  |«      «      }t        j                  j                  t        j                  j                  ||«      «      }|j                  | j                  «      r|t        | j                  «      dz   d  }|S )Nú<ú/é   )Ú
startswithrš   r›   Újoinr�   Údirnamerœ   Úlen)rK   r,   r‰   Úcurrent_pathÚfile_dirÚrelative_paths         r   rŽ   zLoader.resolve_pathÌ  s¶   € âØ×*Ñ*¨3Ô/Ø×*Ñ*¨3Ô/Ø—O‘O CÔ(äŸ7™7Ÿ<™<¨¯	©	°;Ó?ˆLÜ—w‘w—‘¤r§w¡w§¡°|Ó'DÓEˆHÜŸG™GŸO™O¬B¯G©G¯L©L¸À4Ó,HÓIˆMØ×'Ñ'¨¯	©	Ô2Ø$¤S¨¯©£^°aÑ%7Ð%9Ð:�Øˆr   c                 óÖ   — t         j                  j                  | j                  |«      }t	        |d«      5 }t        |j                  «       || ¬«      }|cd d d «       S # 1 sw Y   y xY w)NÚrb©r,   r-   )rš   r›   r¤   r�   Úopenr*   Úread)rK   r,   r›   Úfrm   s        r   r�   zLoader._create_templateÚ  sR   € Ü�w‰w�|‰|˜DŸI™I tÓ,ˆÜ�$˜Óð 	 Ü §¡£¨t¸DÔAˆHØ÷	÷ 	ò 	ús   ·AÁA(rR   )r   r   r   r}   r~   r	   rN   r   rŽ   r*   r�   Ú__classcell__©rž   s   @r   r•   r•   Å  sQ   ø„ ÙDð4 sð 4°cð 4¸dõ 4ñ ð °8¸C±=ð ÈCó ð Sð ¨X÷ r   r•   c                   óf   ‡ — e Zd ZdZdeeef   deddfˆ fd„Zddedee   defd	„Z	dede
fd
„Zˆ xZS )Ú
DictLoaderz/A template loader that loads from a dictionary.ÚdictrO   r   Nc                 ó2   •— t        ‰| �  di |¤Ž || _        y r˜   )r™   rN   r´   )rK   r´   rO   rž   s      €r   rN   zDictLoader.__init__ä  s   ø€ Ü‰ÑÑ"˜6Ò"Øˆ�	r   r,   r‰   c                 óì   — |rq|j                  d«      s`|j                  d«      sO|j                  d«      s>t        j                  |«      }t        j                  t        j                  ||«      «      }|S )Nr    r¡   )r£   Ú	posixpathr¥   Únormpathr¤   )rK   r,   r‰   r¨   s       r   rŽ   zDictLoader.resolve_pathè  s]   € áØ×*Ñ*¨3Ô/Ø×*Ñ*¨3Ô/Ø—O‘O CÔ(ä ×(Ñ(¨Ó5ˆHÜ×%Ñ%¤i§n¡n°X¸tÓ&DÓEˆDØˆr   c                 ó8   — t        | j                  |   || ¬«      S )Nr¬   )r*   r´   r’   s     r   r�   zDictLoader._create_templateó  s   € Ü˜Ÿ	™	 $™¨d¸4Ô@Ð@r   rR   )r   r   r   r}   r   r~   r	   rN   r   rŽ   r*   r�   r°   r±   s   @r   r³   r³   á  s\   ø„ Ù9ð˜T # s (™^ð °sð ¸tõ ñ	 ð 	°8¸C±=ð 	ÈCó 	ðA Sð A¨X÷ Ar   r³   c                   óJ   — e Zd Zded    fd„Zd	d„Zdee   dee	df   ddfd„Z
y)
Ú_Noder   c                  ó   — yr˜   r   r‡   s    r   Ú
each_childz_Node.each_childø  s   € Ør   Nc                 ó   — t        «       ‚rR   r‹   ©rK   rt   s     r   rf   z_Node.generateû  r“   r   r-   rq   Ú_NamedBlockc                 óR   — | j                  «       D ]  }|j                  ||«       Œ y rR   )r½   rk   )rK   r-   rq   Úchilds       r   rk   z_Node.find_named_blocksþ  s*   € ð —_‘_Ó&ò 	:ˆEØ×#Ñ# F¨LÕ9ñ	:r   ©rt   rl   r   N)r   r   r   r   r½   rf   r   r.   r   r~   rk   r   r   r   r»   r»   ÷  sD   „ ð˜H WÑ-ó ó$ð:Ø˜zÑ*ð:Ø:>¸sÀMÐ?QÑ:Rð:à	ô:r   r»   c                   ó:   — e Zd Zdeddddfd„Zd
d„Zded   fd	„Zy)r?   rm   rv   Ú
_ChunkListr   Nc                 ó.   — || _         || _        d| _        y rh   )rm   rv   Úline)rK   rm   rv   s      r   rN   z_File.__init__  s   € Ø ˆŒØˆŒ	Øˆ�	r   c                 ód  — |j                  d| j                  «       |j                  «       5  |j                  d| j                  «       |j                  d| j                  «       | j                  j	                  |«       |j                  d| j                  «       d d d «       y # 1 sw Y   y xY w)Nzdef _tt_execute():ú_tt_buffer = []ú_tt_append = _tt_buffer.appendú$return _tt_utf8('').join(_tt_buffer))Ú
write_linerÇ   Úindentrv   rf   r¿   s     r   rf   z_File.generate  sŠ   € Ø×ÑÐ.°·	±	Ô:Ø�]‰]‹_ñ 	QØ×ÑÐ/°·±Ô;Ø×ÑÐ>ÀÇ	Á	ÔJØ�I‰I×Ñ˜vÔ&Ø×ÑÐDÀdÇiÁiÔP÷		Q÷ 	Qñ 	Qús   ­A0B&Â&B/r»   c                 ó   — | j                   fS rR   ©rv   r‡   s    r   r½   z_File.each_child  ó   € Ø—	‘	ˆ|Ðr   rÃ   )r   r   r   r*   rN   rf   r   r½   r   r   r   r?   r?     s3   „ ð ð °ð À$ó ó
Qð˜H WÑ-ô r   r?   c                   ó<   — e Zd Zdee   ddfd„Zdd„Zded   fd„Zy)	rÅ   rw   r   Nc                 ó   — || _         y rR   ©rw   )rK   rw   s     r   rN   z_ChunkList.__init__  s	   € Øˆ�r   c                 óH   — | j                   D ]  }|j                  |«       Œ y rR   )rw   rf   )rK   rt   r|   s      r   rf   z_ChunkList.generate  s!   € Ø—[‘[ò 	#ˆEØ�N‰N˜6Õ"ñ	#r   r»   c                 ó   — | j                   S rR   rÓ   r‡   s    r   r½   z_ChunkList.each_child  s   € Ø�{‰{Ðr   rÃ   )	r   r   r   r   r»   rN   rf   r   r½   r   r   r   rÅ   rÅ     s/   „ ð˜t E™{ð ¨tó ó#ð˜H WÑ-ô r   rÅ   c            
       óf   — e Zd Zdededededdf
d„Zded   fd	„Z	dd
„Z
dee   deed f   ddfd„Zy)rÀ   r,   rv   rm   rÇ   r   Nc                 ó<   — || _         || _        || _        || _        y rR   )r,   rv   rm   rÇ   )rK   r,   rv   rm   rÇ   s        r   rN   z_NamedBlock.__init__$  s   € ØˆŒ	ØˆŒ	Ø ˆŒØˆ�	r   r»   c                 ó   — | j                   fS rR   rÏ   r‡   s    r   r½   z_NamedBlock.each_child*  rÐ   r   c                 óâ   — |j                   | j                     }|j                  |j                  | j                  «      5  |j
                  j                  |«       d d d «       y # 1 sw Y   y xY wrR   )rq   r,   Úincluderm   rÇ   rv   rf   )rK   rt   Úblocks      r   rf   z_NamedBlock.generate-  sS   € Ø×#Ñ# D§I¡IÑ.ˆØ�^‰^˜EŸN™N¨D¯I©IÓ6ñ 	(Ø�J‰J×Ñ Ô'÷	(÷ 	(ñ 	(ús   Á A%Á%A.r-   rq   c                 óP   — | || j                   <   t        j                  | ||«       y rR   )r,   r»   rk   )rK   r-   rq   s      r   rk   z_NamedBlock.find_named_blocks2  s$   € ð #'ˆ�T—Y‘YÑÜ×Ñ  f¨lÕ;r   rÃ   )r   r   r   r~   r»   r*   ÚintrN   r   r½   rf   r   r.   r   rk   r   r   r   rÀ   rÀ   #  sm   „ ð˜Sð ¨ð ¸ð Èð ÐQUó ð˜H WÑ-ó ó(ð
<Ø˜zÑ*ð<Ø:>¸sÀMÐ?QÑ:Rð<à	ô<r   rÀ   c                   ó   — e Zd Zdeddfd„Zy)rx   r,   r   Nc                 ó   — || _         y rR   )r,   r’   s     r   rN   z_ExtendsBlock.__init__:  s	   € Øˆ�	r   )r   r   r   r~   rN   r   r   r   rx   rx   9  s   „ ð˜Sð  Tô r   rx   c                   óP   — e Zd Zdedddeddfd„Zdee   d	eee	f   ddfd
„Z
dd„Zy)Ú_IncludeBlockr,   rL   r>   rÇ   r   Nc                 óB   — || _         |j                   | _        || _        y rR   )r,   Útemplate_namerÇ   )rK   r,   rL   rÇ   s       r   rN   z_IncludeBlock.__init__?  s   € ØˆŒ	Ø#Ÿ[™[ˆÔØˆ�	r   r-   rq   c                 ó�   — |€J ‚|j                  | j                  | j                  «      }|j                  j	                  ||«       y rR   )rz   r,   rã   rA   rk   )rK   r-   rq   Úincludeds       r   rk   z_IncludeBlock.find_named_blocksD  s>   € ð Ð!Ð!Ð!Ø—;‘;˜tŸy™y¨$×*<Ñ*<Ó=ˆØ�‰×'Ñ'¨°Õ=r   c                 ó,  — |j                   €J ‚|j                   j                  | j                  | j                  «      }|j	                  || j
                  «      5  |j                  j                  j                  |«       d d d «       y # 1 sw Y   y xY wrR   )	r-   rz   r,   rã   rÚ   rÇ   rA   rv   rf   )rK   rt   rå   s      r   rf   z_IncludeBlock.generateK  sq   € Ø�}‰}Ð(Ð(Ð(Ø—=‘=×%Ñ% d§i¡i°×1CÑ1CÓDˆØ�^‰^˜H d§i¡iÓ0ñ 	0Ø�M‰M×Ñ×'Ñ'¨Ô/÷	0÷ 	0ñ 	0ús   Á&B
Â
BrÃ   )r   r   r   r~   rÝ   rN   r   r.   r   rÀ   rk   rf   r   r   r   rá   rá   >  sU   „ ð˜Sð Ð*;ð À3ð È4ó ð
>Ø˜zÑ*ð>Ø:>¸sÀKÐ?OÑ:Pð>à	ó>ô0r   rá   c                   ó>   — e Zd Zdedededdfd„Zded   fd„Zd
d	„Z	y)Ú_ApplyBlockÚmethodrÇ   rv   r   Nc                 ó.   — || _         || _        || _        y rR   )ré   rÇ   rv   )rK   ré   rÇ   rv   s       r   rN   z_ApplyBlock.__init__S  s   € ØˆŒØˆŒ	Øˆ�	r   r»   c                 ó   — | j                   fS rR   rÏ   r‡   s    r   r½   z_ApplyBlock.each_childX  rÐ   r   c                 ó  — d|j                   z  }|xj                   dz  c_         |j                  d|z  | j                  «       |j                  «       5  |j                  d| j                  «       |j                  d| j                  «       | j                  j                  |«       |j                  d| j                  «       d d d «       |j                  d| j                  › d|› d	�| j                  «       y # 1 sw Y   Œ7xY w)
Nz_tt_apply%dr¢   z	def %s():rÉ   rÊ   rË   z_tt_append(_tt_utf8(ú(z()))))Úapply_counterrÌ   rÇ   rÍ   rv   rf   ré   )rK   rt   Úmethod_names      r   rf   z_ApplyBlock.generate[  sÛ   € Ø# f×&:Ñ&:Ñ:ˆØ×Ò Ñ!ÕØ×Ñ˜+¨Ñ3°T·Y±YÔ?Ø�]‰]‹_ñ 	QØ×ÑÐ/°·±Ô;Ø×ÑÐ>ÀÇ	Á	ÔJØ�I‰I×Ñ˜vÔ&Ø×ÑÐDÀdÇiÁiÔP÷		Qð
 	×ÑØ" 4§;¡; -¨q°°¸UÐCÀTÇYÁYõ	
÷	Qð 	Qús   ÁA0C:Ã:DrÃ   ©
r   r   r   r~   rÝ   r»   rN   r   r½   rf   r   r   r   rè   rè   R  s9   „ ð˜sð ¨#ð °Uð ¸tó ð
˜H WÑ-ó ô
r   rè   c                   ó>   — e Zd Zdedededdfd„Zdee   fd„Zd	d„Z	y)
Ú_ControlBlockÚ	statementrÇ   rv   r   Nc                 ó.   — || _         || _        || _        y rR   )ró   rÇ   rv   )rK   ró   rÇ   rv   s       r   rN   z_ControlBlock.__init__j  s   € Ø"ˆŒØˆŒ	Øˆ�	r   c                 ó   — | j                   fS rR   rÏ   r‡   s    r   r½   z_ControlBlock.each_childo  rÐ   r   c                 ó  — |j                  d| j                  z  | j                  «       |j                  «       5  | j                  j                  |«       |j                  d| j                  «       d d d «       y # 1 sw Y   y xY w)Nú%s:Úpass)rÌ   ró   rÇ   rÍ   rv   rf   r¿   s     r   rf   z_ControlBlock.generater  sc   € Ø×Ñ˜% $§.¡.Ñ0°$·)±)Ô<Ø�]‰]‹_ñ 	1Ø�I‰I×Ñ˜vÔ&à×Ñ˜f d§i¡iÔ0÷	1÷ 	1ñ 	1ús   º8A;Á;BrÃ   rð   r   r   r   rò   rò   i  s8   „ ð #ð ¨Sð ¸ð À$ó ð
˜H U™Oó ô1r   rò   c                   ó(   — e Zd Zdededdfd„Zdd„Zy)Ú_IntermediateControlBlockró   rÇ   r   Nc                 ó    — || _         || _        y rR   ©ró   rÇ   ©rK   ró   rÇ   s      r   rN   z"_IntermediateControlBlock.__init__{  ó   € Ø"ˆŒØˆ�	r   c                 ó²   — |j                  d| j                  «       |j                  d| j                  z  | j                  |j                  «       dz
  «       y )Nrø   r÷   r¢   )rÌ   rÇ   ró   Úindent_sizer¿   s     r   rf   z"_IntermediateControlBlock.generate  sD   € à×Ñ˜& $§)¡)Ô,Ø×Ñ˜% $§.¡.Ñ0°$·)±)¸V×=OÑ=OÓ=QÐTUÑ=UÕVr   rÃ   ©r   r   r   r~   rÝ   rN   rf   r   r   r   rú   rú   z  s"   „ ð #ð ¨Sð °Tó ôWr   rú   c                   ó(   — e Zd Zdededdfd„Zdd„Zy)Ú
_Statementró   rÇ   r   Nc                 ó    — || _         || _        y rR   rü   rý   s      r   rN   z_Statement.__init__†  rþ   r   c                 óP   — |j                  | j                  | j                  «       y rR   )rÌ   ró   rÇ   r¿   s     r   rf   z_Statement.generateŠ  s   € Ø×Ñ˜$Ÿ.™.¨$¯)©)Õ4r   rÃ   r  r   r   r   r  r  …  s!   „ ð #ð ¨Sð °Tó ô5r   r  c            	       ó.   — e Zd Zddedededdfd„Zd	d„Zy)
Ú_ExpressionÚ
expressionrÇ   Úrawr   Nc                 ó.   — || _         || _        || _        y rR   )r  rÇ   r	  )rK   r  rÇ   r	  s       r   rN   z_Expression.__init__�  s   € Ø$ˆŒØˆŒ	Øˆ�r   c                 ó¨  — |j                  d| j                  z  | j                  «       |j                  d| j                  «       |j                  d| j                  «       | j                  sI|j                  j
                  �3|j                  d|j                  j
                  z  | j                  «       |j                  d| j                  «       y )Nz_tt_tmp = %szEif isinstance(_tt_tmp, _tt_string_types): _tt_tmp = _tt_utf8(_tt_tmp)z&else: _tt_tmp = _tt_utf8(str(_tt_tmp))z_tt_tmp = _tt_utf8(%s(_tt_tmp))z_tt_append(_tt_tmp))rÌ   r  rÇ   r	  Úcurrent_templater0   r¿   s     r   rf   z_Expression.generate”  s¨   € Ø×Ñ˜.¨4¯?©?Ñ:¸D¿I¹IÔFØ×ÑØVØ�I‰Iô	
ð 	×ÑÐBÀDÇIÁIÔNØ�xŠx˜F×3Ñ3×>Ñ>ÐJð ×ÑØ1°F×4KÑ4K×4VÑ4VÑVØ—	‘	ôð 	×ÑÐ/°·±Õ;r   )FrÃ   )r   r   r   r~   rÝ   r   rN   rf   r   r   r   r  r  Ž  s(   „ ñ 3ð ¨cð ¸ð Èó ô
<r   r  c                   ó,   ‡ — e Zd Zdededdfˆ fd„Zˆ xZS )Ú_Moduler  rÇ   r   Nc                 ó0   •— t         ‰| �  d|z   |d¬«       y )Nz_tt_modules.T©r	  )r™   rN   )rK   r  rÇ   rž   s      €r   rN   z_Module.__init__¦  s   ø€ Ü‰Ñ˜¨*Ñ4°dÀÐÕEr   )r   r   r   r~   rÝ   rN   r°   r±   s   @r   r  r  ¥  s'   ø„ ðF 3ð F¨cð F°d÷ Fñ Fr   r  c                   ó,   — e Zd Zdedededdfd„Zdd„Zy)	Ú_TextÚvaluerÇ   r1   r   Nc                 ó.   — || _         || _        || _        y rR   )r  rÇ   r1   )rK   r  rÇ   r1   s       r   rN   z_Text.__init__«  s   € ØˆŒ
ØˆŒ	Ø$ˆ�r   c                 óº   — | j                   }d|vrt        | j                  |«      }|r3|j                  dt	        j
                  |«      z  | j                  «       y y )Nz<pre>z_tt_append(%r))r  r(   r1   rÌ   r   r^   rÇ   )rK   rt   r  s      r   rf   z_Text.generate°  sP   € Ø—
‘
ˆð ˜%ÑÜ% d§o¡o°uÓ=ˆEáØ×ÑÐ.´·±¸UÓ1CÑCÀTÇYÁYÕOð r   rÃ   r  r   r   r   r  r  ª  s)   „ ð%˜cð %¨ð %¸#ð %À$ó %ô
	Pr   r  c            	       ó>   — e Zd ZdZ	 d	dedee   deddfd„Zdefd„Zy)
ry   zíRaised for template syntax errors.

    ``ParseError`` instances have ``filename`` and ``lineno`` attributes
    indicating the position of the error.

    .. versionchanged:: 4.3
       Added ``filename`` and ``lineno`` attributes.
    NÚmessageÚfilenameÚlinenor   c                 ó.   — || _         || _        || _        y rR   ©r  r  r  )rK   r  r  r  s       r   rN   zParseError.__init__Æ  s   € ð ˆŒð !ˆŒØˆ�r   c                 óN   — d| j                   | j                  | j                  fz  S )Nz%s at %s:%dr  r‡   s    r   Ú__str__zParseError.__str__Ï  s    € Ø §¡¨d¯m©m¸T¿[¹[ÐIÑIÐIr   rh   )	r   r   r   r}   r~   r   rÝ   rN   r  r   r   r   ry   ry   ¼  sE   „ ñð KLñØðØ&.¨s¡mðØDGðà	óðJ˜ô Jr   ry   c            
       ó‚   — e Zd Zdedeeef   dee   de	ddf
d„Z
defd„Zdd
„Zde	dedd	fd„Z	 ddededee   ddfd„Zy)rl   rA   rq   r-   r  r   Nc                 óf   — || _         || _        || _        || _        d| _        g | _        d| _        y rh   )rA   rq   r-   r  rî   Úinclude_stackÚ_indent)rK   rA   rq   r-   r  s        r   rN   z_CodeWriter.__init__Ô  s9   € ð ˆŒ	Ø(ˆÔØˆŒØ 0ˆÔØˆÔØˆÔØˆ�r   c                 ó   — | j                   S rR   ©r!  r‡   s    r   r   z_CodeWriter.indent_sizeã  s   € Ø�|‰|Ðr   r   c                 ó*   ‡ —  G ˆ fd„d«      } |«       S )Nc                   ó.   •— e Zd Zdˆ fd„Zdeddfˆ fd„Zy)ú$_CodeWriter.indent.<locals>.Indenterr   c                 ó2   •— ‰xj                   dz  c_         ‰S )Nr¢   r#  ©r5   rK   s    €r   Ú	__enter__z._CodeWriter.indent.<locals>.Indenter.__enter__è  s   ø€ Ø—’ Ñ!•Ø�r   ÚargsNc                 óR   •— ‰j                   dkD  sJ ‚‰xj                   dz  c_         y )Nr   r¢   r#  ©r5   r*  rK   s     €r   Ú__exit__z-_CodeWriter.indent.<locals>.Indenter.__exit__ì  s#   ø€ Ø—|‘| aÒ'Ð'Ð'Ø—’ Ñ!–r   ©r   rl   ©r   r   r   r)  r	   r-  r‡   s   €r   ÚIndenterr&  ç  s   ø„ õð" 3ð "¨4ö "r   r0  r   )rK   r0  s   ` r   rÍ   z_CodeWriter.indentæ  s   ø€ ÷	"ó 	"ñ ‹zÐr   rm   rÇ   c                 ó†   ‡ — ‰ j                   j                  ‰ j                  |f«       |‰ _         G ˆ fd„d«      } |«       S )Nc                   ó.   •— e Zd Zdˆ fd„Zdeddfˆ fd„Zy)ú,_CodeWriter.include.<locals>.IncludeTemplater   c                 ó   •— ‰S rR   r   r(  s    €r   r)  z6_CodeWriter.include.<locals>.IncludeTemplate.__enter__÷  s   ø€ Ø�r   r*  Nc                 óJ   •— ‰j                   j                  «       d   ‰_        y rh   )r   Úpopr  r,  s     €r   r-  z5_CodeWriter.include.<locals>.IncludeTemplate.__exit__ú  s   ø€ Ø(,×(:Ñ(:×(>Ñ(>Ó(@ÀÑ(C�Õ%r   r.  r/  r‡   s   €r   ÚIncludeTemplater3  ö  s   ø„ õðD 3ð D¨4ö Dr   r7  )r   Úappendr  )rK   rm   rÇ   r7  s   `   r   rÚ   z_CodeWriter.includeò  sA   ø€ Ø×Ñ×!Ñ! 4×#8Ñ#8¸$Ð"?Ô@Ø (ˆÔ÷	Dó 	Dñ Ó Ð r   Úline_numberrÍ   c                 óT  — |€| j                   }d| j                  j                  |fz  }| j                  rM| j                  D ��cg c]  \  }}d|j                  |fz  ‘Œ }}}|ddj	                  t        |«      «      z  z  }t        d|z  |z   |z   | j                  ¬«       y c c}}w )Nz	  # %s:%dz%s:%dz	 (via %s)z, z    )rA   )r!  r  r,   r   r¤   ÚreversedÚprintrA   )rK   rÇ   r9  rÍ   Úline_commentÚtmplr  rr   s           r   rÌ   z_CodeWriter.write_lineÿ  s¨   € ð ˆ>Ø—\‘\ˆFØ" d×&;Ñ&;×&@Ñ&@À+Ð%NÑNˆØ×ÒàDH×DVÑDV÷Ù2@°4¸�˜4Ÿ9™9 fÐ-Ó-ðˆIñ ð ˜K¨$¯)©)´H¸YÓ4GÓ*HÑHÑHˆLÜˆf�v‰o Ñ$ |Ñ3¸$¿)¹)ÖDùó	s   ÁB$)r   r   rR   )r   r   r   r   r   r~   rÀ   r   r.   r*   rN   rÝ   r   rÍ   rÚ   rÌ   r   r   r   rl   rl   Ó  s§   „ ðàðð ˜3 Ð+Ñ,ðð ˜Ñ$ð	ð
 #ðð 
óð˜Só ó
ð! ð !°ð !Ð8Hó !ð DHñEØðEØ&)ðEØ3;¸C±=ðEà	ôEr   rl   c            	       óª   — e Zd Zdedededdfd„Zddeded	ee   defd
„Zddee   defd„Zdefd„Z	defd„Z
deeef   defd„Zdefd„Zdeddfd„Zy)r>   r,   r   r1   r   Nc                 óJ   — || _         || _        || _        d| _        d| _        y )Nr¢   r   )r,   r   r1   rÇ   Úpos)rK   r,   r   r1   s       r   rN   z_TemplateReader.__init__  s%   € ØˆŒ	ØˆŒ	Ø$ˆŒØˆŒ	Øˆ�r   ÚneedleÚstartÚendc                 óä   — |dk\  sJ |«       ‚| j                   }||z  }|€| j                  j                  ||«      }n)||z  }||k\  sJ ‚| j                  j                  |||«      }|dk7  r||z  }|S )Nr   éÿÿÿÿ)rA  r   Úfind)rK   rB  rC  rD  rA  Úindexs         r   rG  z_TemplateReader.find  s~   € Ø˜ŠzÐ ˜5Ó ˆzØ�h‰hˆØ�‰ˆØˆ;Ø—I‘I—N‘N 6¨5Ó1‰Eà�3‰JˆCØ˜%’<Ð�<Ø—I‘I—N‘N 6¨5°#Ó6ˆEØ�BŠ;Ø�S‰LˆEØˆr   Úcountc                 ó   — |€"t        | j                  «      | j                  z
  }| j                  |z   }| xj                  | j                  j	                  d| j                  |«      z  c_        | j                  | j                  | }|| _        |S )Nr#   )r¦   r   rA  rÇ   rI  )rK   rI  ÚnewposÚss       r   Úconsumez_TemplateReader.consume#  sn   € Øˆ=Ü˜Ÿ	™	“N T§X¡XÑ-ˆEØ—‘˜EÑ!ˆØ�	Š	�T—Y‘Y—_‘_ T¨4¯8©8°VÓ<Ñ<�	Ø�I‰I�d—h‘h Ð(ˆØˆŒØˆr   c                 óF   — t        | j                  «      | j                  z
  S rR   )r¦   r   rA  r‡   s    r   Ú	remainingz_TemplateReader.remaining,  s   € Ü�4—9‘9‹~ §¡Ñ(Ð(r   c                 ó"   — | j                  «       S rR   )rO  r‡   s    r   Ú__len__z_TemplateReader.__len__/  s   € Ø�~‰~ÓÐr   Úkeyc                 óT  — t        |t        «      rit        | «      }|j                  |«      \  }}}|€| j                  }n|| j                  z  }|�|| j                  z  }| j
                  t        |||«         S |dk  r| j
                  |   S | j
                  | j                  |z      S rh   )r;   Úslicer¦   ÚindicesrA  r   )rK   rR  ÚsizerC  ÚstopÚsteps         r   Ú__getitem__z_TemplateReader.__getitem__2  sž   € Ü�cœ5Ô!Ü�t“9ˆDØ #§¡¨DÓ 1ÑˆE�4˜Øˆ}ØŸ™‘à˜Ÿ™Ñ!�ØÐØ˜Ÿ™Ñ �Ø—9‘9œU 5¨$°Ó5Ñ6Ð6Ø�1ŠWØ—9‘9˜S‘>Ð!à—9‘9˜TŸX™X¨™^Ñ,Ð,r   c                 ó4   — | j                   | j                  d  S rR   )r   rA  r‡   s    r   r  z_TemplateReader.__str__B  s   € Ø�y‰y˜Ÿ™˜Ð$Ð$r   Úmsgc                 óD   — t        || j                  | j                  «      ‚rR   )ry   r,   rÇ   )rK   r[  s     r   Úraise_parse_errorz!_TemplateReader.raise_parse_errorE  s   € Ü˜˜dŸi™i¨¯©Ó3Ð3r   )r   NrR   )r   r   r   r~   rN   rÝ   r   rG  rM  rO  rQ  r
   rT  rY  r  r]  r   r   r   r>   r>     s²   „ ð˜Sð ¨ð ¸ð Àó ñ˜3ð  sð °X¸c±]ð Ècó ñ˜X c™]ð °có ð)˜3ó )ð ˜ó  ð-˜u S¨% ZÑ0ð -°Só -ð %˜ó %ð4 Sð 4¨Tô 4r   r>   rC   c           	      óÞ   — | j                  «       }dt        t        t        |«      dz   «      «      z  }dj                  t	        |«      D ��cg c]  \  }}||dz   |fz  ‘Œ c}}«      S c c}}w )Nz%%%dd  %%s
r¢   r3   )Ú
splitlinesr¦   Úreprr¤   Ú	enumerate)rC   ÚlinesÚformatÚirÇ   s        r   rH   rH   I  s]   € Ø�O‰OÓ€EØœc¤$¤s¨5£z°A¡~Ó"6Ó7Ñ7€FØ�7‰7¼IÀeÓ<L×M©y°°4�F˜a !™e T˜]Ó*ÓMÓNÐNùÓMs   ÁA)
rL   rm   Úin_blockÚin_loopc                 ó¤  — t        g «      }	 d}	 | j                  d|«      }|dk(  s|dz   | j                  «       k(  r`|r| j                  d|z  «       |j                  j                  t        | j                  «       | j                  | j                  «      «       |S | |dz      dvr|dz  }Œž|dz   | j                  «       k  r| |dz      dk(  r| |dz      dk(  r|dz  }ŒÐ	 |dkD  rK| j                  |«      }|j                  j                  t        || j                  | j                  «      «       | j                  d«      }| j                  }| j                  «       rK| d   d	k(  rC| j                  d«       |j                  j                  t        ||| j                  «      «       �Œœ|d
k(  rY| j                  d«      }	|	dk(  r| j                  d«       | j                  |	«      j                  «       }
| j                  d«       �Œú|dk(  r‘| j                  d«      }	|	dk(  r| j                  d«       | j                  |	«      j                  «       }
| j                  d«       |
s| j                  d«       |j                  j                  t        |
|«      «       �Œ�|dk(  sJ |«       ‚| j                  d«      }	|	dk(  r| j                  d«       | j                  |	«      j                  «       }
| j                  d«       |
s| j                  d«       |
j                  d«      \  }}}|j                  «       }h d£dhdhdhdœ}|j                  |«      }|�[|s| j                  |› d|› d�«       ||vr| j                  |› d|› d�«       |j                  j                  t        |
|«      «       �Œ¥|dk(  r|s| j                  d«       |S |dv �rl|d k(  r�ŒË|d!k(  r@|j                  d"«      j                  d#«      }|s| j                  d$«       t        |«      }�n|d%v r |s| j                  d&«       t!        |
|«      }nß|d'k(  rA|j                  d"«      j                  d#«      }|s| j                  d(«       t#        || |«      }n™|d)k(  r |s| j                  d*«       t!        ||«      }nt|d+k(  r |j                  «       }|d,k(  rd }||_        �ŒÄ|d-k(  r%|j                  «       }t'        |d.«       || _	        �Œî|d/k(  rt        ||d¬0«      }n|d1k(  rt)        ||«      }|j                  j                  «       �Œ0|d2v r¬|d3v rt+        | |||«      }n"|d4k(  rt+        | ||d «      }nt+        | |||«      }|d4k(  r!|s| j                  d5«       t-        |||«      }n4|d6k(  r"|s| j                  d7«       t/        ||||«      }nt1        |
||«      }|j                  j                  |«       �Œà|d8v rL|s#| j                  d9j3                  |d:d;h«      «       |j                  j                  t!        |
|«      «       �Œ0| j                  d<|z  «       �ŒE)=NTr   ú{rF  r¢   z Missing {%% end %%} block for %s)rh  ú%ú#é   ú!z{#z#}zMissing end comment #}z{{z}}zMissing end expression }}zEmpty expressionz{%z%}zMissing end block %}zEmpty block tag ({% %})r"   >   ÚifÚforÚtryÚwhilerm  ro  )ÚelseÚelifÚexceptÚfinallyz	 outside z blockz block cannot be attached to rD  zExtra {% end %} block)
ÚextendsrÚ   ÚsetÚimportÚfromÚcommentr0   r1   r	  Úmodulery  ru  ú"ú'zextends missing file path)rw  rx  zimport missing statementrÚ   zinclude missing file pathrv  zset missing statementr0   ÚNoner1   r3   r	  r  rz  )ÚapplyrÛ   ro  rm  rn  rp  )rn  rp  r~  zapply missing method namerÛ   zblock missing name)ÚbreakÚcontinuez{} outside {} blockrn  rp  zunknown operator: %r)rÅ   rG  rO  r]  rw   r8  r  rM  rÇ   r1   Ústripr  Ú	partitionÚgetrú   rx   r  rá   r0   r(   r  r@   rè   rÀ   rò   rc  )rL   rm   re  rf  rv   ÚcurlyÚconsÚstart_bracerÇ   rD  ÚcontentsÚoperatorÚspaceÚsuffixÚintermediate_blocksÚallowed_parentsrÛ   Úfnr   Ú
block_bodys                       r   r@   r@   O  sT  € ô �b‹>€DØ
àˆØØ—K‘K  UÓ+ˆEØ˜Š{˜e a™i¨6×+;Ñ+;Ó+=Ò=áØ×,Ñ,Ø:¸XÑEôð —‘×"Ñ"Ü˜&Ÿ.™.Ó*¨F¯K©K¸×9JÑ9JÓKôð �ð �e˜a‘iÑ ¨Ñ7Ø˜‘
�Øð
 ˜‘	˜F×,Ñ,Ó.Ò.Ø˜5 1™9Ñ%¨Ò,Ø˜5 1™9Ñ%¨Ò,à˜‘
�ØØð �1Š9Ø—>‘> %Ó(ˆDØ�K‰K×Ñœu T¨6¯;©;¸×8IÑ8IÓJÔKà—n‘n QÓ'ˆØ�{‰{ˆð ×ÑÔ &¨¡)¨sÒ"2Ø�N‰N˜1ÔØ�K‰K×Ñœu [°$¸×8IÑ8IÓJÔKÙð ˜$ÒØ—+‘+˜dÓ#ˆCØ�bŠyØ×(Ñ(Ð)AÔBØ—~‘~ cÓ*×0Ñ0Ó2ˆHØ�N‰N˜1ÔÙð ˜$ÒØ—+‘+˜dÓ#ˆCØ�bŠyØ×(Ñ(Ð)DÔEØ—~‘~ cÓ*×0Ñ0Ó2ˆHØ�N‰N˜1ÔÙØ×(Ñ(Ð);Ô<Ø�K‰K×Ñœ{¨8°TÓ:Ô;Ùð ˜dÒ"Ð/ KÓ/Ð"Ø�k‰k˜$ÓˆØ�"Š9Ø×$Ñ$Ð%;Ô<Ø—>‘> #Ó&×,Ñ,Ó.ˆØ�‰�qÔÙØ×$Ñ$Ð%>Ô?à"*×"4Ñ"4°SÓ"9Ñˆ�%˜Ø—‘“ˆò 2Ø�FØ�gØ�wñ	
Ðð .×1Ñ1°(Ó;ˆØÐ&ÙØ×(Ñ(¨H¨:°Y¸Ð>OÈvÐ)VÔWØ˜Ñ.Ø×(Ñ(Ø�jÐ =¸h¸ZÀvÐNôð �K‰K×ÑÔ8¸À4ÓHÔIÙð ˜ÒÙØ×(Ñ(Ð)@ÔAØˆKàð 
ò 
ð ˜9Ò$ÙØ˜9Ò$ØŸ™ cÓ*×0Ñ0°Ó5�ÙØ×,Ñ,Ð-HÔIÜ% fÓ-’ØÐ/Ñ/ÙØ×,Ñ,Ð-GÔHÜ" 8¨TÓ2‘Ø˜YÒ&ØŸ™ cÓ*×0Ñ0°Ó5�ÙØ×,Ñ,Ð-HÔIÜ% f¨f°dÓ;‘Ø˜UÒ"ÙØ×,Ñ,Ð-DÔEÜ" 6¨4Ó0‘Ø˜\Ò)Ø—\‘\“^�Ø˜’<Ø�BØ&(�Ô#ÙØ˜\Ò)Ø—|‘|“~�ä! $¨Ô+Ø$(�Ô!ÙØ˜UÒ"Ü# F¨D°dÔ;‘Ø˜XÒ%Ü ¨Ó-�Ø�K‰K×Ñ˜uÔ%ÙàÐHÑHàÐ+Ñ+Ü# F¨H°hÀÓI‘
Ø˜WÒ$ô $ F¨H°hÀÓE‘
ä# F¨H°hÀÓH�
à˜7Ò"ÙØ×,Ñ,Ð-HÔIÜ# F¨D°*Ó=‘Ø˜WÒ$ÙØ×,Ñ,Ð-AÔBÜ# F¨J¸À$ÓG‘ä% h°°jÓA�Ø�K‰K×Ñ˜uÔ%ÙàÐ.Ñ.ÙØ×(Ñ(Ø)×0Ñ0°¸EÀ7Ð;KÓLôð �K‰K×Ñœz¨(°DÓ9Ô:Ùð ×$Ñ$Ð%;¸hÑ%FÔGñ r   )NN):r}   rY   Úior   rc   Úos.pathrš   r·   r%   rƒ   Útornador   Útornado.logr   Útornado.utilr   r   r   ra   r	   r
   r   r   r   r   r   r   ÚTYPE_CHECKINGr   r   r<   r   r9   r~   r(   r*   r.   r•   r³   r»   r?   rÅ   rÀ   rx   rá   rè   rò   rú   r  r  r  r  r'   ry   rl   r>   rH   r@   r   r   r   ú<module>r•     s×  ðñ uón Ý Û Û Û Û 	Û å Ý ß :Ñ :ç O× OÓ OÛ à	×Òß,à$Ð ÷	ñ 	ñ 
‹€ð=˜Cð = sð =¨só =÷2Iñ I÷X:$ñ :$ôzˆZô ô8A�ô A÷,:ñ :ôˆEô ô$	�ô 	ô<�%ô <ô,�Eô ô
0�Eô 0ô(
�%ô 
ô.1�Eô 1ô"W ô Wô5�ô 5ô<�%ô <ô.Fˆkô Fô
PˆEô Pô$J�ô J÷.7Eñ 7E÷t94ñ 94ðxO�sð O˜só Oð #Ø!ñ	FHØðFHàðFHð �s‰mðFHð �c‰]ð	FHð
 ôFHr   