o
    r|a¢  ã                   @   s   d Z G dd„ deƒZdS )zC
Exposes a class that represents a parsed (or compiled) template.

c                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚParsedTemplatea  
    Represents a parsed or compiled template.

    An instance wraps a list of unicode strings and node objects.  A node
    object must have a `render(engine, stack)` method that accepts a
    RenderEngine instance and a ContextStack instance and returns a unicode
    string.

    c                 C   s
   g | _ d S ©N)Ú_parse_tree©Úself© r   ú1/usr/lib/python3/dist-packages/pystache/parsed.pyÚ__init__   ó   
zParsedTemplate.__init__c                 C   s
   t | jƒS r   )Úreprr   r   r   r   r   Ú__repr__   r	   zParsedTemplate.__repr__c                 C   s   | j  |¡ dS )zŽ
        Arguments:

          node: a unicode string or node object instance.  See the class
            docstring for information.

        N)r   Úappend)r   Únoder   r   r   Úadd   s   zParsedTemplate.addc                    s0   ‡ ‡fdd„}t t|| jƒƒ}d |¡}t|ƒS )z5
        Returns: a string of type unicode.

        c                    s   t | ƒtu r| S |  ˆˆ ¡S r   )ÚtypeÚstrÚrender)r   ©ÚcontextÚenginer   r   Úget_unicode+   s   z*ParsedTemplate.render.<locals>.get_unicodeÚ )ÚlistÚmapr   Újoinr   )r   r   r   r   ÚpartsÚsr   r   r   r   %   s   
zParsedTemplate.renderN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   	   s    

r   N)r   Úobjectr   r   r   r   r   Ú<module>   s   