U
    ç¥¡ca  ã                   @   s    d dl mZ G dd„ deƒZdS )é    )Úunicode_literalsc                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚRendererc                 C   s`   |  ¡ }d| _d| _| ¡ }|dk	rZ|d j}t| |ƒrPt| |ƒ|d |d ƒ | ¡ }q| jS )z„Walks the AST and calls member methods for each Node type.

        @param ast {Node} The root of the abstract syntax tree.
        Ú Ú
NÚnodeZentering)ÚwalkerÚbufÚlast_outZnxtÚtÚhasattrÚgetattr)ÚselfÚastr   ÚeventÚtype_© r   ú>/tmp/pip-unpacked-wheel-4s07asnf/commonmark/render/renderer.pyÚrender   s    


zRenderer.renderc                 C   s   |  j |7  _ || _dS )zlConcatenate a literal string to the buffer.

        @param str {String} The string to concatenate.
        N)r   r	   ©r   Úsr   r   r   Úlit   s    zRenderer.litc                 C   s   | j dkr|  d¡ d S )Nr   )r	   r   )r   r   r   r   Úcr    s    
zRenderer.crc                 C   s   |   |¡ dS )zÊConcatenate a string to the buffer possibly escaping the content.

        Concrete renderer implementations should override this method.

        @param str {String} The string to concatenate.
        N)r   r   r   r   r   Úout$   s    zRenderer.outN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r      s   r   N)Ú
__future__r   Úobjectr   r   r   r   r   Ú<module>   s   