3
.ßL]ÿ ã            ?   @   s²  d Z ddlZddlmZmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZmZ dd
lmZ ddlmZmZmZmZmZmZ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'm(Z(m)Z)m*Z*m+Z+ ddl,m-Z-m.Z. ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLg?Z/G dMd„ deƒZ0G dNd„ deƒZ1G dOd<„ d<eƒZ2G dPd=„ d=eƒZ3G dQd>„ d>eƒZ4G dRd„ deƒZ5G dSd&„ d&eƒZ6G dTd'„ d'eƒZ7G dUd(„ d(eƒZ8G dVd*„ d*eƒZ9G dWd)„ d)eƒZ:G dXd+„ d+eƒZ;G dYd,„ d,eƒZ<G dZd-„ d-eƒZ=G d[d.„ d.eƒZ>G d\d/„ d/eƒZ?G d]d0„ d0eƒZ@G d^d_„ d_eƒZAG d`d2„ d2eƒZBG dad3„ d3eƒZCG dbd4„ d4eƒZDG dcd5„ d5eƒZEG ddd#„ d#eƒZFG dedf„ dfeƒZGG dgd"„ d"eƒZHG dhd!„ d!eƒZIG did%„ d%eƒZJG djd$„ d$eƒZKG dkd„ deƒZLG dld„ deƒZMG dmd„ deƒZNG dnd„ deƒZOG dod„ deƒZPG dpd„ deƒZQG dqd„ deƒZRG drd„ deƒZSG dsd„ deƒZTG dtd„ deƒZUG dud„ deƒZVG dvd„ deƒZWG dwd„ deƒZXG dxd„ deƒZYG dyd„ deƒZZG dzd „ d eƒZ[G d{d|„ d|eƒZ\G d}d1„ d1eƒZ]G d~d6„ d6eƒZ^G dd7„ d7eƒZ_G d€d8„ d8eƒZ`G d�d9„ d9eƒZaG d‚dƒ„ dƒeƒZbG d„d:„ d:eƒZcG d…d;„ d;eƒZdG d†d?„ d?eƒZeG d‡dˆ„ dˆeƒZfG d‰d@„ d@eƒZgG dŠdA„ dAeƒZhG d‹dB„ dBeƒZiG dŒdC„ dCeƒZjG d�dD„ dDeƒZkG dŽdE„ dEeƒZlG d�dF„ dFeƒZmG d�dG„ dGeƒZnG d‘dH„ dHeƒZoG d’dI„ dIeƒZpG d“dJ„ dJeƒZqG d”dK„ dKeƒZrG d•dL„ dLeƒZsdS )–zã
    pygments.lexers.templates
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for various template engines' markup.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú	HtmlLexerÚXmlLexer)ÚJavascriptLexerÚ
LassoLexer)ÚCssLexer)ÚPhpLexer)ÚPythonLexer)Ú	PerlLexer)Ú	JavaLexerÚTeaLangLexer)Ú	YamlLexer)	ÚLexerÚDelegatingLexerÚ
RegexLexerÚbygroupsÚincludeÚusingÚthisÚdefaultÚcombined)ÚErrorÚPunctuationÚ
WhitespaceÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚOtherÚToken)Úhtml_doctype_matchesÚlooks_like_xmlÚHtmlPhpLexerÚXmlPhpLexerÚCssPhpLexerÚJavascriptPhpLexerÚErbLexerÚ
RhtmlLexerÚXmlErbLexerÚCssErbLexerÚJavascriptErbLexerÚSmartyLexerÚHtmlSmartyLexerÚXmlSmartyLexerÚCssSmartyLexerÚJavascriptSmartyLexerÚDjangoLexerÚHtmlDjangoLexerÚCssDjangoLexerÚXmlDjangoLexerÚJavascriptDjangoLexerÚGenshiLexerÚHtmlGenshiLexerÚGenshiTextLexerÚCssGenshiLexerÚJavascriptGenshiLexerÚMyghtyLexerÚMyghtyHtmlLexerÚMyghtyXmlLexerÚMyghtyCssLexerÚMyghtyJavascriptLexerÚ
MasonLexerÚ	MakoLexerÚMakoHtmlLexerÚMakoXmlLexerÚMakoJavascriptLexerÚMakoCssLexerÚJspLexerÚCheetahLexerÚCheetahHtmlLexerÚCheetahXmlLexerÚCheetahJavascriptLexerÚEvoqueLexerÚEvoqueHtmlLexerÚEvoqueXmlLexerÚColdfusionLexerÚColdfusionHtmlLexerÚColdfusionCFCLexerÚVelocityLexerÚVelocityHtmlLexerÚVelocityXmlLexerÚSspLexerÚTeaTemplateLexerÚLassoHtmlLexerÚLassoXmlLexerÚLassoCssLexerÚLassoJavascriptLexerÚHandlebarsLexerÚHandlebarsHtmlLexerÚYamlJinjaLexerÚLiquidLexerÚ	TwigLexerÚTwigHtmlLexerÚAngular2LexerÚAngular2HtmlLexerc               @   sF   e Zd ZdZdZdgZdgZejdej	ƒZ
dd„ Zdd	„ Zd
d„ ZdS )r(   a  
    Generic `ERB <http://ruby-doc.org/core/classes/ERB.html>`_ (Ruby Templating)
    lexer.

    Just highlights ruby code between the preprocessor directives, other data
    is left untouched by the lexer.

    All options are also forwarded to the `RubyLexer`.
    ZERBZerbzapplication/x-ruby-templatingz*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)c             K   s*   ddl m} |f |Ž| _tj| f|Ž d S )Nr   )Ú	RubyLexer)Zpygments.lexers.rubyrc   Ú
ruby_lexerr   Ú__init__)ÚselfÚoptionsrc   © rh   ú?/tmp/pip-install-5sebvq2j/pygments/pygments/lexers/templates.pyre   C   s    zErbLexer.__init__c             c   s0  | j j|ƒ}|jƒ  d }}�yö�xî|dkrR|jƒ }|t|fV  |t|ƒ7 }d}q$|dk�rÈ|jƒ }|dkrˆ|t|fV  |d7 }d}�q|dkrÎ|tj|fV  |jƒ }|d t|fV  |dt|ƒ 7 }d}�q|dk�r>|tj|fV  |t|ƒ7 }|jƒ }d}x,| jj	|ƒD ]\}}	}
|| |	|
fV  �qW |t|ƒ7 }d}nˆ|dk�rf|t
|fV  |t|ƒ7 }d}n`|tj|d fV  d}x8| jj	|dd… ƒD ] \}}	}
|d | |	|
fV  �q’W |t|ƒ7 }d}q$|dkr$|jƒ }|dk�rð|t|fV  n|tj|fV  |t|ƒ7 }d}q$W W n tk
�r*   dS X dS )z¡
        Since ERB doesn't allow "<%" and other tags inside of ruby
        blocks we have to use a split approach here that fails for
        that too.
        r   é   ú<%%ú%%>é   z<%#é   ú<%ú<%=ú<%-ú%>ú-%>N)rk   rl   )ro   rp   rq   )rr   rs   )rr   rs   )Ú	_block_reÚsplitÚreverseÚpopr    Úlenr   ÚPreprocrd   Úget_tokens_unprocessedr   Ú
IndexError)rf   ÚtextÚtokensÚstateÚidxÚvalÚtagÚdataZr_idxZr_tokenZr_valuerh   rh   ri   rz   H   sh    



zErbLexer.get_tokens_unprocessedc             C   s   d| krd| krdS d S )Nz<%z%>gš™™™™™Ù?rh   )r|   rh   rh   ri   Úanalyse_textŒ   s    zErbLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	mimetypesÚreÚcompileÚMrt   re   rz   rƒ   rh   rh   rh   ri   r(   2   s   	Dc               @   sê   e Zd ZdZdZdgZdgZdgZej	ej
B Zdefdeejeejƒfdeejeed	d
�ejƒfdeejejeƒdfdejdfgdefdejdfdejdfdejfdejfdefdejfdefdejfdejfdejfgdœZdd„ ZdS )r-   z¹
    Generic `Smarty <http://smarty.php.net/>`_ template lexer.

    Just highlights smarty code between the preprocessor directives, other
    data is left untouched by the lexer.
    ZSmartyÚsmartyz*.tplzapplication/x-smartyz[^{]+z(\{)(\*.*?\*)(\})z(\{php\})(.*?)(\{/php\})T)Zstartinlinez(\{)(/?[a-zA-Z_]\w*)(\s*)z\{z\s+z#pushz\}z#popz#[a-zA-Z_]\w*#z\$[a-zA-Z_]\w*(\.\w+)*z[~!%^&*()+=|\[\]:;,.<>/?@-]z(true|false|null)\bz>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?z"(\\\\|\\"|[^"])*"z'(\\\\|\\'|[^'])*'z[a-zA-Z_]\w*)ÚrootrŽ   c             C   sX   d}t jd| ƒr|d7 }t jd| ƒr,|d7 }t jd| ƒr@|d7 }t jd| ƒrT|d7 }|S )Ng        z\{if\s+.*?\}.*?\{/if\}g333333Ã?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}g{®Gáz„?)r‹   Úsearch)r|   Úrvrh   rh   ri   rƒ   ¼   s    zSmartyLexer.analyse_textN) r„   r…   r†   r‡   rˆ   r‰   Ú	filenamesrŠ   r‹   Ú	MULTILINEÚDOTALLÚflagsr    r   r   ry   r   r   r   ÚFunctionr   ÚVariabler   r   ÚConstantr   r   ÚDoubleÚSingleÚ	Attributer}   rƒ   rh   rh   rh   ri   r-   ‘   s8   

c               @   sŠ  e Zd ZdZdZdgZddgZejej	B Z
dZdefdeejeejƒfd	eejeƒfd
e d eejejejeƒdfd
e d eejejejƒfdedfgeejfdedfde d eeejƒdfdedfedƒgdefdedfde d ejfedƒgdefedƒdedfgdedfdefdefdejfd ejfd!efd"efd#ejfdedfd$edfd%edfdedfdedfdedfgd&œZd'd(„ Zd)S )*rR   z¼
    Generic `Velocity <http://velocity.apache.org/>`_ template lexer.

    Just highlights velocity directives and variable references, other
    data is left untouched by the lexer.
    ZVelocityZvelocityz*.vmz*.fhtmlz[a-zA-Z_]\w*z[^{#$]+z(#)(\*.*?\*)(#)z
(##)(.*?$)z(#\{?)(z)(\}?)(\s?\()Údirectiveparamsz)(\}|\b)z\$\{?Úvariablez\(Ú
funcparamsz(\.)(ú)z#pushz\}z#popz=(&&|\|\||==?|!=?|[-<>+*%&|^/])|\b(eq|ne|gt|lt|ge|le|not|in)\bz\[Úrangeoperatorz\bz\.\.z\]z\s+z[,:]z"(\\\\|\\"|[^"])*"z'(\\\\|\\'|[^'])*'z0[xX][0-9a-fA-F]+[Ll]?z
\b[0-9]+\bz(true|false|null)\bz\)z\{)r�   r�   rœ   r    rž   c             C   sX   d}t jd| ƒr|d7 }t jd| ƒr,|d7 }t jd| ƒr@|d7 }t jd| ƒrT|d7 }|S )	Ng        z #\{?macro\}?\(.*?\).*?#\{?end\}?g      Ð?z#\{?if\}?\(.+?\).*?#\{?end\}?g333333Ã?z"#\{?foreach\}?\(.+?\).*?#\{?end\}?z4\$\{?[a-zA-Z_]\w*(\([^)]*\))?(\.\w+(\([^)]*\))?)*\}?g{®Gáz„?)r‹   r�   )r|   r‘   rh   rh   ri   rƒ     s    zVelocityLexer.analyse_textN) r„   r…   r†   r‡   rˆ   r‰   r’   r‹   r“   r”   r•   Ú
identifierr    r   r   ry   r   r–   r   r—   r   r   r   r   r   r™   rš   r   r   r˜   r}   rƒ   rh   rh   rh   ri   rR   É   s\   




c                   s8   e Zd ZdZdZdgZddgZdgZ‡ fdd„Z‡  Z	S )	rS   za
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `HtmlLexer`.

    zHTML+Velocityzhtml+velocityz*.htmlz*.fhtmlztext/html+velocityc                s   t t| ƒjttf|Ž d S )N)ÚsuperrS   re   r   rR   )rf   rg   )Ú	__class__rh   ri   re   '  s    zVelocityHtmlLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   Úalias_filenamesrŠ   re   Ú__classcell__rh   rh   )r£   ri   rS     s   c                   s@   e Zd ZdZdZdgZddgZdgZ‡ fdd„Zd	d
„ Z	‡  Z
S )rT   z`
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `XmlLexer`.

    zXML+Velocityzxml+velocityz*.xmlz*.vmzapplication/xml+velocityc                s   t t| ƒjttf|Ž d S )N)r¢   rT   re   r   rR   )rf   rg   )r£   rh   ri   re   8  s    zVelocityXmlLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?)rR   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ   <  s    zVelocityXmlLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rT   ,  s   c               @   s|  e Zd ZdZdZddgZddgZejej	B Z
defdejd	fd
efdeejeeeejeejeeeejƒfdeejeeeejeejeeeejƒfdeejeeeejƒdfdeejeeƒdfdefgdeeeejƒfdeeeeeejƒfdejfdefdejfdejfdejfdejfdejfdefdefgdefdeeejƒdfedƒgdefd eeejƒdfedƒd!efgd"œZd#d$„ Zd%S )&r2   a  
    Generic `django <http://www.djangoproject.com/documentation/templates/>`_
    and `jinja <http://wsgiarea.pocoo.org/jinja/>`_ template lexer.

    It just highlights django/jinja code between the preprocessor directives,
    other data is left untouched by the lexer.
    zDjango/JinjaZdjangoZjinjazapplication/x-django-templatingzapplication/x-jinjaz[^{]+z\{\{Úvarz\{[*#].*?[*#]\}zJ(\{%)(-?\s*)(comment)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endcomment)(\s*-?)(%\})zB(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})z'(\{%)(-?\s*)(filter)(\s+)([a-zA-Z_]\w*)Úblockz(\{%)(-?\s*)([a-zA-Z_]\w*)z\{z(\|)(\s*)([a-zA-Z_]\w*)z#(is)(\s+)(not)?(\s+)?([a-zA-Z_]\w*)z%(_|true|false|none|True|False|None)\bzm(in|as|reversed|recursive|not|and|or|is|if|else|import|with(?:(?:out)?\s*context)?|scoped|ignore\s+missing)\bz(loop|block|super|forloop)\bz[a-zA-Z_][\w-]*z\.\w+z:?"(\\\\|\\"|[^"])*"z:?'(\\\\|\\'|[^'])*'z ([{}()\[\]+\-*/%,:~]|[><=]=?|!=)z>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?z\s+z
(-?)(\}\})z#popÚvarnamesz	(-?)(%\})Ú.)r�   r¨   r¦   r§   c             C   sP   d}t jd| ƒd k	r|d7 }t jd| ƒd k	r4|d7 }t jd| ƒd k	rL|d7 }|S )Ng        z\{%\s*(block|extends)gš™™™™™Ù?z\{%\s*if\s*.*?%\}gš™™™™™¹?z\{\{.*?\}\})r‹   r�   )r|   r‘   rh   rh   ri   rƒ   ‹  s    zDjangoLexer.analyse_textN)r„   r…   r†   r‡   rˆ   r‰   rŠ   r‹   r�   ÚSr•   r    r   ry   r   r   r   r   r–   r   ÚPseudoÚBuiltinr—   r   r™   rš   r   r   r   r}   rƒ   rh   rh   rh   ri   r2   C  sZ   
c               @   sì   e Zd ZdZdZdgZddgZdgZddefd	e	e
jee
je
jeeƒe
jƒfd
e	e
je
je
jeeƒe
jƒfde	e
je
jeeƒe
jƒfde	e
je
jeeƒe
jƒfde
jfde	e
jeeƒe
jƒfdefde	e
jeeƒeƒfde	eeƒfg
iZdS )r<   z¸
    Generic `myghty templates`_ lexer. Code that isn't Myghty
    markup is yielded as `Token.Other`.

    .. versionadded:: 0.6

    .. _myghty templates: http://www.myghty.org/
    ZMyghtyZmyghtyz*.mytZautodelegatezapplication/x-myghtyr�   z\s+z3(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)z#(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)z(<&[^|])(.*?)(,.*?)?(&>)z(?s)(<&\|)(.*?)(,.*?)?(&>)z</&>z(?s)(<%!?)(.*?)(%>)z(?<=^)#[^\n]*(\n|\Z)z(?<=^)(%)([^\n]*)(\n|\Z)aË  (?sx)
                 (.+?)               # anything, followed by:
                 (?:
                  (?<=\n)(?=[%#]) |  # an eval or comment line
                  (?=</?[%&]) |      # a substitution or block or
                                     # call start or end
                                     # - don't consume
                  (\\\n) |           # an escaped newline
                  \Z                 # end of string
                 )N)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r   r   r   ÚTagr–   r   r   r   r   r    r   r}   rh   rh   rh   ri   r<   –  s0   
c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )r=   zy
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `HtmlLexer`.

    .. versionadded:: 0.6
    zHTML+Myghtyzhtml+myghtyztext/html+myghtyc                s   t t| ƒjttf|Ž d S )N)r¢   r=   re   r   r<   )rf   rg   )r£   rh   ri   re   Ò  s    zMyghtyHtmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   r=   Æ  s
   c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )r>   zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.6
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtyc                s   t t| ƒjttf|Ž d S )N)r¢   r>   re   r   r<   )rf   rg   )r£   rh   ri   re   ã  s    zMyghtyXmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   r>   ×  s
   c                   s6   e Zd ZdZdZddgZdddgZ‡ fdd	„Z‡  ZS )
r@   z
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `JavascriptLexer`.

    .. versionadded:: 0.6
    zJavaScript+Myghtyz	js+myghtyzjavascript+myghtyzapplication/x-javascript+myghtyztext/x-javascript+myghtyztext/javascript+mygthyc                s   t t| ƒjttf|Ž d S )N)r¢   r@   re   r   r<   )rf   rg   )r£   rh   ri   re   ö  s    zMyghtyJavascriptLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   r@   è  s   c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )r?   zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.6
    z
CSS+Myghtyz
css+myghtyztext/css+myghtyc                s   t t| ƒjttf|Ž d S )N)r¢   r?   re   r   r<   )rf   rg   )r£   rh   ri   re     s    zMyghtyCssLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   r?   û  s
   c               @   s  e Zd ZdZdZdgZdddddd	gZd
gZddefde	e
jeje
jƒfde	e
jee
je
jeeƒe
jƒfde	e
je
je
jeeƒe
jƒfde	e
je
jeeƒe
jƒfde	e
je
jeeƒe
jƒfde
jfde	e
jeeƒe
jƒfdefde	e
jeeƒeƒfde	eeƒeƒfgiZdd„ ZdS )rA   z¼
    Generic `mason templates`_ lexer. Stolen from Myghty lexer. Code that isn't
    Mason markup is HTML.

    .. _mason templates: http://www.masonhq.com/

    .. versionadded:: 1.4
    ZMasonZmasonz*.mz*.mhtmlz*.mcz*.miZautohandlerZdhandlerzapplication/x-masonr�   z\s+z(?s)(<%doc>)(.*?)(</%doc>)z3(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)z#(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)z(?s)(<&[^|])(.*?)(,.*?)?(&>)z(?s)(<&\|)(.*?)(,.*?)?(&>)z</&>z(?s)(<%!?)(.*?)(%>)z(?<=^)#[^\n]*(\n|\Z)z(?<=^)(%)([^\n]*)(\n|\Z)aË  (?sx)
                 (.+?)               # anything, followed by:
                 (?:
                  (?<=\n)(?=[%#]) |  # an eval or comment line
                  (?=</?[%&]) |      # a substitution or block or
                                     # call start or end
                                     # - don't consume
                  (\\\n) |           # an escaped newline
                  \Z                 # end of string
                 )c             C   s6   d}t jd| ƒd k	rd}nt jd| t jƒd k	r2d}|S )Ng        z</%(class|doc|init)%>g      ð?z<&.+&>g)\�Âõ(¼?)r‹   r�   r”   )r|   Úresultrh   rh   ri   rƒ   <  s    zMasonLexer.analyse_textN)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r   r   r   r­   r   Ú	Multiliner–   r   r   r	   r    r   r   r}   rƒ   rh   rh   rh   ri   rA     s6   
c               @   s0  e Zd ZdZdZdgZdgZdgZdee	e
jeeƒfdee	e
jeeƒeƒfdee	e
jeƒfd	e
jfd
ee
jejƒdfdee
jeje
jƒfde
jdfdee
jeeƒe
jƒfdee
jeeƒe
jƒfdeeeƒfde	fgde
jfdejfedƒgdeeje	eƒfde
jdfde	fgdedfdedfdedfgdœZdS )rB   z¹
    Generic `mako templates`_ lexer. Code that isn't Mako
    markup is yielded as `Token.Other`.

    .. versionadded:: 0.7

    .. _mako templates: http://www.makotemplates.org/
    ZMakoZmakoz*.maozapplication/x-makoz(\s*)(%)(\s*end(?:\w+))(\n|\Z)z(\s*)(%)([^\n]*)(\n|\Z)z(\s*)(##[^\n]*)(\n|\Z)z(?s)<%doc>.*?</%doc>z(<%)([\w.:]+)r�   z(</%)([\w.:]+)(>)z<%(?=([\w.:]+))Ú	ondeftagsz(?s)(<%(?:!?))(.*?)(%>)z(\$\{)(.*?)(\})a\  (?sx)
                (.+?)                # anything, followed by:
                (?:
                 (?<=\n)(?=%|\#\#) | # an eval or comment line
                 (?=\#\*) |          # multiline comment
                 (?=</?%) |          # a python block
                                     # call start or end
                 (?=\$\{) |          # a substitution
                 (?<=\n)(?=\s*%) |
                                     # - don't consume
                 (\\\n) |            # an escaped newline
                 \Z                  # end of string
                )
            z\s+z<%z'(?<=<%)(include|inherit|namespace|page)z((?:\w+)\s*=)(\s*)(".*?")z/?\s*>z#popz".*?"z'.*?'z[^\s>]+)r�   r°   r�   ÚattrN)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r   r   r   ry   r   r    r   r   r   r¬   r   r   r›   r   r}   rh   rh   rh   ri   rB   E  sB   

c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )rC   zw
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.

    .. versionadded:: 0.7
    z	HTML+Makoz	html+makoztext/html+makoc                s   t t| ƒjttf|Ž d S )N)r¢   rC   re   r   rB   )rf   rg   )r£   rh   ri   re   •  s    zMakoHtmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rC   ‰  s
   c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )rD   zv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.7
    zXML+Makozxml+makozapplication/xml+makoc                s   t t| ƒjttf|Ž d S )N)r¢   rD   re   r   rB   )rf   rg   )r£   rh   ri   re   ¦  s    zMakoXmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rD   š  s
   c                   s6   e Zd ZdZdZddgZdddgZ‡ fdd	„Z‡  ZS )
rE   z}
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `JavascriptLexer`.

    .. versionadded:: 0.7
    zJavaScript+Makozjs+makozjavascript+makozapplication/x-javascript+makoztext/x-javascript+makoztext/javascript+makoc                s   t t| ƒjttf|Ž d S )N)r¢   rE   re   r   rB   )rf   rg   )r£   rh   ri   re   ¹  s    zMakoJavascriptLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rE   «  s   c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )rF   zv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.7
    zCSS+Makozcss+makoztext/css+makoc                s   t t| ƒjttf|Ž d S )N)r¢   rF   re   r   rB   )rf   rg   )r£   rh   ri   re   Ê  s    zMakoCssLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rF   ¾  s
   c               @   s   e Zd ZdZdd„ ZdS )ÚCheetahPythonLexerzI
    Lexer for handling Cheetah's special $ tokens in Python syntax.
    c             c   sN   t f | jŽ}x<|j|ƒD ].\}}}|tjkr:|dkr:tj}|||fV  qW d S )Nú$)r   rg   rz   r!   r   r   ry   )rf   r|   ZpylexerÚposÚtype_Úvaluerh   rh   ri   rz   Ö  s
    z)CheetahPythonLexer.get_tokens_unprocessedN)r„   r…   r†   r‡   rz   rh   rh   rh   ri   r²   Ñ  s   r²   c               @   sž   e Zd ZdZdZddgZddgZddgZd	d
ee	ƒfde	fde	j
fde	j
fdee	j
eeƒe	j
ƒfdee	j
eeƒƒfdee	j
eeƒe	j
ƒfdefdefg	iZdS )rH   a2  
    Generic `cheetah templates`_ lexer. Code that isn't Cheetah
    markup is yielded as `Token.Other`.  This also works for
    `spitfire templates`_ which use the same syntax.

    .. _cheetah templates: http://www.cheetahtemplate.org/
    .. _spitfire templates: http://code.google.com/p/spitfire/
    ZCheetahZcheetahZspitfirez*.tmplz*.sptzapplication/x-cheetahzapplication/x-spitfirer�   z(##[^\n]*)$z#[*](.|\n)*?[*]#z#end[^#\n]*(?:#|$)z#slurp$z(#[a-zA-Z]+)([^#\n]*)(#|$)z(\$)([a-zA-Z_][\w.]*\w)z(?s)(\$\{!?)(.*?)(\})a  (?sx)
                (.+?)               # anything, followed by:
                (?:
                 (?=\#[#a-zA-Z]*) | # an eval comment
                 (?=\$[a-zA-Z_{]) | # a substitution
                 \Z                 # end of string
                )
            z\s+N)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r   r   ry   r   r²   r    r   r}   rh   rh   rh   ri   rH   Þ  s*   c                   s6   e Zd ZdZdZdddgZddgZ‡ fdd	„Z‡  ZS )
rI   z_
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `HtmlLexer`.
    zHTML+Cheetahzhtml+cheetahzhtml+spitfireZhtmlcheetahztext/html+cheetahztext/html+spitfirec                s   t t| ƒjttf|Ž d S )N)r¢   rI   re   r   rH   )rf   rg   )r£   rh   ri   re     s    zCheetahHtmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rI   
  s
   
c                   s4   e Zd ZdZdZddgZddgZ‡ fdd„Z‡  ZS )	rJ   z^
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Cheetahzxml+cheetahzxml+spitfirezapplication/xml+cheetahzapplication/xml+spitfirec                s   t t| ƒjttf|Ž d S )N)r¢   rJ   re   r   rH   )rf   rg   )r£   rh   ri   re   #  s    zCheetahXmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rJ     s
   c                   s@   e Zd ZdZdZddddgZddd	d
ddgZ‡ fdd„Z‡  ZS )rK   ze
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Cheetahz
js+cheetahzjavascript+cheetahzjs+spitfirezjavascript+spitfirez application/x-javascript+cheetahztext/x-javascript+cheetahztext/javascript+cheetahz!application/x-javascript+spitfireztext/x-javascript+spitfireztext/javascript+spitfirec                s   t t| ƒjttf|Ž d S )N)r¢   rK   re   r   rH   )rf   rg   )r£   rh   ri   re   8  s    zCheetahJavascriptLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   rŠ   re   r¥   rh   rh   )r£   ri   rK   (  s   c            
   @   sº   e Zd ZdZdZdgZddgZdefdee	e
ƒfdee	e
jƒd	fed
ƒdefgde	dfdeeƒdfdeee	eeƒƒdfdedfdeee	e
ƒdfgdee
jeeƒe
jƒfdejfgdœZdS )r9   z]
    A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ text
    templates.
    zGenshi TextZ
genshitextzapplication/x-genshi-textztext/x-genshiz[^#$\s]+z^(\s*)(##.*)$z	^(\s*)(#)Ú	directiver�   z[#$\s]z\nz#popz(?:def|for|if)\s+.*z (choose|when|with)([^\S\n]+)(.*)z(choose|otherwise)\bz(end\w*)([^\S\n]*)(.*)z(?<!\$)(\$\{)(.+?)(\})z(?<!\$)(\$)([a-zA-Z_][\w.]*))r�   r·   r�   N)r„   r…   r†   r‡   rˆ   r‰   rŠ   r    r   r   r   ry   r   r   r   r   r   r—   r}   rh   rh   rh   ri   r9   =  s&   c               @   sH  e Zd ZdZejZdefdee	j
eeƒe	j
ƒfdefdejdfdejdfed	ƒd
efgdefdejdfdejdfgdeeeeƒeƒdfdeeeeƒeƒdfdedfgdefdejdfdejdfdejdfgdedfdedfdedfgdedfedƒdefgdedfedƒdefgdefed	ƒgdee	j
eeƒe	j
ƒfdejfgdœ	ZdS ) ÚGenshiMarkupLexerzX
    Base lexer for Genshi markup, used by `HtmlGenshiLexer` and
    `GenshiLexer`.
    z[^<$]+z(<\?python)(.*?)(\?>)z'<\s*(script|style)\s*.*?>.*?<\s*/\1\s*>z<\s*py:[a-zA-Z0-9]+Úpytagz<\s*[a-zA-Z0-9:.]+r�   r�   z[<$]z\s+z[\w:-]+\s*=Úpyattrz/?\s*>z#popz(")(.*?)(")z(')(.*?)(')z[^\s>]+zpy:[\w-]+\s*=r±   ú"zattr-dstringú'zattr-sstringz[^\s>]*Ústringsz[^"'$]+z(?<!\$)(\$\{)(.+?)(\})z(?<!\$)(\$)([a-zA-Z_][\w\.]*))	r�   r¹   rº   r�   r±   zattr-dstringzattr-sstringr½   r�   N)r„   r…   r†   r‡   r‹   r”   r•   r    r   r   ry   r   r   r   r­   r   r   r›   r   r—   r}   rh   rh   rh   ri   r¸   `  sF   






r¸   c                   sD   e Zd ZdZdZddgZdddgZdgZ‡ fd	d
„Zdd„ Z	‡  Z
S )r8   z‰
    A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid HTML templates.
    zHTML+Genshizhtml+genshizhtml+kidz*.htmlz*.htmz*.xhtmlztext/html+genshic                s   t t| ƒjttf|Ž d S )N)r¢   r8   re   r   r¸   )rf   rg   )r£   rh   ri   re   «  s    zHtmlGenshiLexer.__init__c             C   sF   d}t jd| ƒd k	r|d7 }t jd| ƒd k	r4|d7 }|tj| ƒ d S )Ng        z	\$\{.*?\}gš™™™™™É?zpy:(.*?)=["\']g{®Gáz„?)r‹   r�   r   rƒ   )r|   r‘   rh   rh   ri   rƒ   ¯  s    zHtmlGenshiLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r8      s   
c                   sL   e Zd ZdZdZddddgZdgZdgZd	d
gZ‡ fdd„Z	dd„ Z
‡  ZS )r7   zˆ
    A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid XML templates.
    ZGenshiÚgenshiZkidz
xml+genshizxml+kidz*.kidz*.xmlzapplication/x-genshizapplication/x-kidc                s   t t| ƒjttf|Ž d S )N)r¢   r7   re   r   r¸   )rf   rg   )r£   rh   ri   re   Ä  s    zGenshiLexer.__init__c             C   sF   d}t jd| ƒd k	r|d7 }t jd| ƒd k	r4|d7 }|tj| ƒ d S )Ng        z	\$\{.*?\}gš™™™™™É?zpy:(.*?)=["\']g{®Gáz„?)r‹   r�   r   rƒ   )r|   r‘   rh   rh   ri   rƒ   È  s    zGenshiLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r’   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r7   ¸  s   c                   sH   e Zd ZdZdZddddgZdgZdd	d
gZ‡ fdd„Zdd„ Z	‡  Z
S )r;   zK
    A lexer that highlights javascript code in genshi text templates.
    zJavaScript+Genshi Textzjs+genshitextz	js+genshizjavascript+genshitextzjavascript+genshiz*.jszapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshic                s   t t| ƒjttf|Ž d S )N)r¢   r;   re   r   r9   )rf   rg   )r£   rh   ri   re   Þ  s    zJavascriptGenshiLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r7   rƒ   )r|   rh   rh   ri   rƒ   ã  s    z"JavascriptGenshiLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r;   Ñ  s   c                   s@   e Zd ZdZdZddgZdgZdgZ‡ fdd„Zd	d
„ Z	‡  Z
S )r:   zK
    A lexer that highlights CSS definitions in genshi text templates.
    zCSS+Genshi Textzcss+genshitextz
css+genshiz*.cssztext/css+genshic                s   t t| ƒjttf|Ž d S )N)r¢   r:   re   r   r9   )rf   rg   )r£   rh   ri   re   ñ  s    zCssGenshiLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r7   rƒ   )r|   rh   rh   ri   rƒ   õ  s    zCssGenshiLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r:   ç  s   c                   sL   e Zd ZdZdZdddgZdgZddd	gZd
gZ‡ fdd„Z	dd„ Z
‡  ZS )r)   z�
    Subclass of the ERB lexer that highlights the unlexed data with the
    html lexer.

    Nested Javascript and CSS is highlighted too.
    ZRHTMLZrhtmlzhtml+erbz	html+rubyz*.rhtmlz*.htmlz*.htmz*.xhtmlztext/html+rubyc                s   t t| ƒjttf|Ž d S )N)r¢   r)   re   r   r(   )rf   rg   )r£   rh   ri   re     s    zRhtmlLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?g      à?)r(   rƒ   r"   )r|   r‘   rh   rh   ri   rƒ   
  s    zRhtmlLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r’   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r)   ù  s   

c                   s@   e Zd ZdZdZddgZdgZdgZ‡ fdd„Zd	d
„ Z	‡  Z
S )r*   zo
    Subclass of `ErbLexer` which highlights data outside preprocessor
    directives with the `XmlLexer`.
    zXML+Rubyzxml+erbzxml+rubyz*.xmlzapplication/xml+rubyc                s   t t| ƒjttf|Ž d S )N)r¢   r*   re   r   r(   )rf   rg   )r£   rh   ri   re     s    zXmlErbLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?)r(   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ      s    zXmlErbLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r*     s   c                   s@   e Zd ZdZdZddgZdgZdgZ‡ fdd„Zd	d
„ Z	‡  Z
S )r+   zS
    Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
    zCSS+Rubyzcss+erbzcss+rubyz*.cssztext/css+rubyc                s   t t| ƒjttf|Ž d S )N)r¢   r+   re   r   r(   )rf   rg   )r£   rh   ri   re   1  s    zCssErbLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r(   rƒ   )r|   rh   rh   ri   rƒ   4  s    zCssErbLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r+   '  s   c                   sH   e Zd ZdZdZddddgZdgZdd	d
gZ‡ fdd„Zdd„ Z	‡  Z
S )r,   z^
    Subclass of `ErbLexer` which highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Rubyzjs+erbzjavascript+erbzjs+rubyzjavascript+rubyz*.jszapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyc                s   t t| ƒjttf|Ž d S )N)r¢   r,   re   r   r(   )rf   rg   )r£   rh   ri   re   E  s    zJavascriptErbLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r(   rƒ   )r|   rh   rh   ri   rƒ   I  s    zJavascriptErbLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r,   8  s   c                   sT   e Zd ZdZdZdgZdgZddddd	gZd
ddddgZ‡ fdd„Z	dd„ Z
‡  ZS )r$   zˆ
    Subclass of `PhpLexer` that highlights unhandled data with the `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+PHPzhtml+phpz*.phtmlz*.phpz*.htmlz*.htmz*.xhtmlz
*.php[345]zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5c                s   t t| ƒjttf|Ž d S )N)r¢   r$   re   r   r   )rf   rg   )r£   rh   ri   re   ]  s    zHtmlPhpLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?g      à?)r   rƒ   r"   )r|   r‘   rh   rh   ri   rƒ   `  s    zHtmlPhpLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r’   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r$   M  s   c                   sB   e Zd ZdZdZdgZdddgZdgZ‡ fdd	„Zd
d„ Z	‡  Z
S )r%   zT
    Subclass of `PhpLexer` that highlights unhandled data with the `XmlLexer`.
    zXML+PHPzxml+phpz*.xmlz*.phpz
*.php[345]zapplication/xml+phpc                s   t t| ƒjttf|Ž d S )N)r¢   r%   re   r   r   )rf   rg   )r£   rh   ri   re   q  s    zXmlPhpLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?)r   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ   t  s    zXmlPhpLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r%   g  s   
c                   s>   e Zd ZdZdZdgZdgZdgZ‡ fdd„Zdd	„ Z	‡  Z
S )
r&   zU
    Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
    zCSS+PHPzcss+phpz*.cssztext/css+phpc                s   t t| ƒjttf|Ž d S )N)r¢   r&   re   r   r   )rf   rg   )r£   rh   ri   re   …  s    zCssPhpLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r   rƒ   )r|   rh   rh   ri   rƒ   ˆ  s    zCssPhpLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r&   {  s   c                   sD   e Zd ZdZdZddgZdgZdddgZ‡ fd	d
„Zdd„ Z	‡  Z
S )r'   z`
    Subclass of `PhpLexer` which highlights unmatched data with the
    `JavascriptLexer`.
    zJavaScript+PHPzjs+phpzjavascript+phpz*.jszapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpc                s   t t| ƒjttf|Ž d S )N)r¢   r'   re   r   r   )rf   rg   )r£   rh   ri   re   ™  s    zJavascriptPhpLexer.__init__c             C   s
   t j| ƒS )N)r   rƒ   )r|   rh   rh   ri   rƒ   �  s    zJavascriptPhpLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r'   Œ  s   c                   sD   e Zd ZdZdZdgZddddgZdgZ‡ fd	d
„Zdd„ Z	‡  Z
S )r.   z‘
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Smartyzhtml+smartyz*.htmlz*.htmz*.xhtmlz*.tplztext/html+smartyc                s   t t| ƒjttf|Ž d S )N)r¢   r.   re   r   r-   )rf   rg   )r£   rh   ri   re   ®  s    zHtmlSmartyLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?g      à?)r-   rƒ   r"   )r|   r‘   rh   rh   ri   rƒ   ±  s    zHtmlSmartyLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r.   ¡  s   c                   s@   e Zd ZdZdZdgZddgZdgZ‡ fdd„Zd	d
„ Z	‡  Z
S )r/   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Smartyz
xml+smartyz*.xmlz*.tplzapplication/xml+smartyc                s   t t| ƒjttf|Ž d S )N)r¢   r/   re   r   r-   )rf   rg   )r£   rh   ri   re   Ã  s    zXmlSmartyLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?)r-   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ   Æ  s    zXmlSmartyLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r/   ¸  s   c                   s@   e Zd ZdZdZdgZddgZdgZ‡ fdd„Zd	d
„ Z	‡  Z
S )r0   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `CssLexer`.
    z
CSS+Smartyz
css+smartyz*.cssz*.tplztext/css+smartyc                s   t t| ƒjttf|Ž d S )N)r¢   r0   re   r   r-   )rf   rg   )r£   rh   ri   re   Ø  s    zCssSmartyLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r-   rƒ   )r|   rh   rh   ri   rƒ   Û  s    zCssSmartyLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r0   Í  s   c                   sF   e Zd ZdZdZddgZddgZddd	gZ‡ fd
d„Zdd„ Z	‡  Z
S )r1   zd
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Smartyz	js+smartyzjavascript+smartyz*.jsz*.tplzapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartyc                s   t t| ƒjttf|Ž d S )N)r¢   r1   re   r   r-   )rf   rg   )r£   rh   ri   re   ì  s    zJavascriptSmartyLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r-   rƒ   )r|   rh   rh   ri   rƒ   ð  s    z"JavascriptSmartyLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r1   ß  s   c                   sH   e Zd ZdZdZdddgZdddgZd	d
gZ‡ fdd„Zdd„ Z	‡  Z
S )r3   z‘
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Django/Jinjazhtml+djangoz
html+jinjaZ
htmldjangoz*.htmlz*.htmz*.xhtmlztext/html+djangoztext/html+jinjac                s   t t| ƒjttf|Ž d S )N)r¢   r3   re   r   r2   )rf   rg   )r£   rh   ri   re     s    zHtmlDjangoLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?g      à?)r2   rƒ   r"   )r|   r‘   rh   rh   ri   rƒ     s    zHtmlDjangoLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r3   ô  s   

c                   sB   e Zd ZdZdZddgZdgZddgZ‡ fdd	„Zd
d„ Z	‡  Z
S )r5   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `XmlLexer`.
    zXML+Django/Jinjaz
xml+djangoz	xml+jinjaz*.xmlzapplication/xml+djangozapplication/xml+jinjac                s   t t| ƒjttf|Ž d S )N)r¢   r5   re   r   r2   )rf   rg   )r£   rh   ri   re     s    zXmlDjangoLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?)r2   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ     s    zXmlDjangoLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r5     s   c                   sB   e Zd ZdZdZddgZdgZddgZ‡ fdd	„Zd
d„ Z	‡  Z
S )r4   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `CssLexer`.
    zCSS+Django/Jinjaz
css+djangoz	css+jinjaz*.cssztext/css+djangoztext/css+jinjac                s   t t| ƒjttf|Ž d S )N)r¢   r4   re   r   r2   )rf   rg   )r£   rh   ri   re   +  s    zCssDjangoLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r2   rƒ   )r|   rh   rh   ri   rƒ   .  s    zCssDjangoLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r4      s   c                   sN   e Zd ZdZdZddddgZdgZdd	d
dddgZ‡ fdd„Zdd„ Z	‡  Z
S )r6   zd
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Django/Jinjaz	js+djangozjavascript+djangozjs+jinjazjavascript+jinjaz*.jszapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjac                s   t t| ƒjttf|Ž d S )N)r¢   r6   re   r   r2   )rf   rg   )r£   rh   ri   re   C  s    zJavascriptDjangoLexer.__init__c             C   s   t j| ƒd S )Ngš™™™™™©?)r2   rƒ   )r|   rh   rh   ri   rƒ   G  s    z"JavascriptDjangoLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   r6   2  s   c               @   sF   e Zd ZdZdedfdefdefdefgdedfd	eeƒfgd
œZdS )ÚJspRootLexerzt
    Base for the `JspLexer`. Yields `Token.Other` for area outside of
    JSP tags.

    .. versionadded:: 0.7
    z<%\S?ÚseczC</?jsp:(forward|getProperty|include|plugin|setProperty|useBean).*?>z[^<]+ú<z%>z#popz[\w\W]+?(?=%>|\Z))r�   rÀ   N)	r„   r…   r†   r‡   r   r    r   r
   r}   rh   rh   rh   ri   r¿   K  s   r¿   c                   s>   e Zd ZdZdZdgZdgZdgZ‡ fdd„Zdd	„ Z	‡  Z
S )
rG   zA
    Lexer for Java Server Pages.

    .. versionadded:: 0.7
    zJava Server PageZjspz*.jspzapplication/x-jspc                s   t t| ƒjttf|Ž d S )N)r¢   rG   re   r   r¿   )rf   rg   )r£   rh   ri   re   o  s    zJspLexer.__init__c             C   s:   t j| ƒd }t| ƒr|d7 }d| kr6d| kr6|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?z<%z%>gš™™™™™¹?)r
   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ   r  s    zJspLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rG   d  s   c               @   sô   e Zd ZdZdZdgZdgZdgZej	Z
defdejdfd	efd
ejfdeeejedeeƒfdeeejedeeeƒeƒfdeeejedeeƒeƒfdeeejƒfdeedeeƒejddeƒfdefg
dejfdejdfdejdfdejfgdœZdS )rL   zR
    For files using the Evoque templating system.

    .. versionadded:: 1.1
    ZEvoqueZevoquez*.evoquezapplication/x-evoquez[^#$]+z#\[Úcommentz\$\$z\$\w+:[^$\n]*\$z'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})NzG(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?(.*?)((?(4)%)\})z!(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})z(\$)(else|rof|fi)z%(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})ú#z[^\]#]z#pushz\]#z#popz[\]#])r�   rÂ   )r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r‹   r”   r•   r    r   r¯   r   r   r   r¬   r   r   r   r}   rh   rh   rh   ri   rL   {  s8   


c                   s6   e Zd ZdZdZdgZdgZdgZ‡ fdd„Z‡  Z	S )rM   zy
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 1.1
    zHTML+Evoquezhtml+evoquez*.htmlztext/html+evoquec                s   t t| ƒjttf|Ž d S )N)r¢   rM   re   r   rL   )rf   rg   )r£   rh   ri   re   ¼  s    zEvoqueHtmlLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   rM   °  s   c                   s6   e Zd ZdZdZdgZdgZdgZ‡ fdd„Z‡  Z	S )rN   zx
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.

    .. versionadded:: 1.1
    z
XML+Evoquez
xml+evoquez*.xmlzapplication/xml+evoquec                s   t t| ƒjttf|Ž d S )N)r¢   rN   re   r   rL   )rf   rg   )r£   rh   ri   re   Í  s    zEvoqueXmlLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   rN   Á  s   c               @   sè   e Zd ZdZdZdgZg Zg Zej	Z
dejfdejfdefdefdefd	efd
efdefdefdejdfdejfdefdefdejfdejfdeejeeƒfdejfdefdefgdejfdejfdejfdejfdejdfgdœZdS )rO   z
    Coldfusion statements
    ZcfstatementZcfsz//.*?\nz/\*(?:.|\n)*?\*/z\+\+|--z
[-+*/^&=!]z<=|>=|<|>|==zmod\bz"(eq|lt|gt|lte|gte|not|is|and|or)\bz\|\||&&z\?r»   Ústringz'.*?'z\d+zÎ(if|else|len|var|xml|default|break|switch|component|property|function|do|try|catch|in|continue|for|return|while|required|any|array|binary|boolean|component|date|guid|numeric|query|string|struct|uuid|case)\bz(true|false|null)\bzD(application|session|client|cookie|super|this|variables|arguments)\bz([a-z_$][\w.]*)(\s*)(\()z[a-z_$][\w.]*z[()\[\]{};:,.\\]z\s+z""z#.+?#z[^"#]+rÃ   z#pop)r�   rÄ   N)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r‹   Ú
IGNORECASEr•   r   rš   r¯   r   r   r™   r   r   r˜   r   r   r–   r   r   r—   ZInterpr}   rh   rh   rh   ri   rO   Ò  sB   
c            
   @   sØ   e Zd ZdZdZdgZg Zg Zdefe	dƒdefgde
jdfd	e
fd
ejdfdeejeeƒejƒfdeejeeƒejƒfgdefdeeeeƒeƒfdejdfe	dƒdefdefgde
jdfde
jdfde
jfgdœZdS )ÚColdfusionMarkupLexerz 
    Coldfusion markup only
    Z
ColdfusionZcfz[^<]+Útagsz<[^<>]*z<!---Ú	cfcommentz(?s)<!--.*?-->z<cfoutput.*?>Úcfoutputz((?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)zì(?s)(</?cf(?:component|include|if|else|elseif|loop|return|dbinfo|dump|abort|location|invoke|throw|file|savecontent|mailpart|mail|header|content|zip|image|lock|argument|try|catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)z[^#<]+z(#)(.*?)(#)z</cfoutput.*?>z#popz(?s)<[^<>]*rÃ   z#pushz--->z([^<-]|<(?!!---)|-(?!-->))+)r�   rÇ   rÉ   rÈ   N)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   r    r   r   r¯   r   r¬   r   r   rO   r   r}   rh   rh   rh   ri   rÆ     s2   




rÆ   c                   s8   e Zd ZdZdZdgZddgZdgZ‡ fdd„Z‡  Z	S )	rP   z#
    Coldfusion markup in html
    zColdfusion HTMLZcfmz*.cfmz*.cfmlzapplication/x-coldfusionc                s   t t| ƒjttf|Ž d S )N)r¢   rP   re   r   rÆ   )rf   rg   )r£   rh   ri   re   9  s    zColdfusionHtmlLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   rP   0  s   c                   s4   e Zd ZdZdZdgZdgZg Z‡ fdd„Z‡  Z	S )rQ   zH
    Coldfusion markup/script components

    .. versionadded:: 2.0
    zColdfusion CFCZcfcz*.cfcc                s   t t| ƒjttf|Ž d S )N)r¢   rQ   re   rP   rO   )rf   rg   )r£   rh   ri   re   I  s    zColdfusionCFCLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   rQ   >  s   c                   s>   e Zd ZdZdZdgZdgZdgZ‡ fdd„Zdd	„ Z	‡  Z
S )
rU   zD
    Lexer for Scalate Server Pages.

    .. versionadded:: 1.4
    zScalate Server PageZsspz*.sspzapplication/x-sspc                s   t t| ƒjttf|Ž d S )N)r¢   rU   re   r   r¿   )rf   rg   )r£   rh   ri   re   Y  s    zSspLexer.__init__c             C   sD   d}t jd| ƒr|d7 }t| ƒr(|d7 }d| kr@d| kr@|d7 }|S )Ng        zval \w+\s*:g333333ã?gš™™™™™É?z<%z%>gš™™™™™¹?)r‹   r�   r#   )r|   r‘   rh   rh   ri   rƒ   \  s    zSspLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rU   N  s   c               @   s@   e Zd ZdZdedfdefdefgdedfdeeƒfgd	œZd
S )ÚTeaTemplateRootLexerz
    Base for the `TeaTemplateLexer`. Yields `Token.Other` for area outside of
    code blocks.

    .. versionadded:: 1.5
    z<%\S?rÀ   z[^<]+rÁ   z%>z#popz[\w\W]+?(?=%>|\Z))r�   rÀ   N)	r„   r…   r†   r‡   r   r    r   r   r}   rh   rh   rh   ri   rÊ   g  s   rÊ   c                   s>   e Zd ZdZdZdgZdgZdgZ‡ fdd„Zdd	„ Z	‡  Z
S )
rV   zW
    Lexer for `Tea Templates <http://teatrove.org/>`_.

    .. versionadded:: 1.5
    ZTeaZteaz*.teaz
text/x-teac                s   t t| ƒjttf|Ž d S )N)r¢   rV   re   r   rÊ   )rf   rg   )r£   rh   ri   re   ˆ  s    zTeaTemplateLexer.__init__c             C   s:   t j| ƒd }t| ƒr|d7 }d| kr6d| kr6|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?z<%z%>gš™™™™™¹?)r   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ   Œ  s    zTeaTemplateLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rV   }  s   c                   sP   e Zd ZdZdZdgZdddddd	d
dgZdddgZ‡ fdd„Zdd„ Z	‡  Z
S )rW   z¯
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `HtmlLexer`.

    Nested JavaScript and CSS is also highlighted.

    .. versionadded:: 1.6
    z
HTML+Lassoz
html+lassoz*.htmlz*.htmz*.xhtmlz*.lassoz*.lasso[89]z*.inclz*.incz*.lasztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]c                s   t t| ƒjttf|Ž d S )N)r¢   rW   re   r   r   )rf   rg   )r£   rh   ri   re   §  s    zLassoHtmlLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?g      à?)r   rƒ   r"   )r|   r‘   rh   rh   ri   rƒ   ª  s    zLassoHtmlLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rW   •  s   

c                   sH   e Zd ZdZdZdgZdddddd	gZd
gZ‡ fdd„Zdd„ Z	‡  Z
S )rX   zz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.

    .. versionadded:: 1.6
    z	XML+Lassoz	xml+lassoz*.xmlz*.lassoz*.lasso[89]z*.inclz*.incz*.laszapplication/xml+lassoc                s   t t| ƒjttf|Ž d S )N)r¢   rX   re   r   r   )rf   rg   )r£   rh   ri   re   ¿  s    zLassoXmlLexer.__init__c             C   s"   t j| ƒd }t| ƒr|d7 }|S )Ng{®Gáz„?gš™™™™™Ù?)r   rƒ   r#   )r|   r‘   rh   rh   ri   rƒ   Â  s    zLassoXmlLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rX   ±  s   
c                   s>   e Zd ZdZdZdgZdgZdgZ‡ fdd„Zdd	„ Z	‡  Z
S )
rY   zz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.

    .. versionadded:: 1.6
    z	CSS+Lassoz	css+lassoz*.cssztext/css+lassoc                s"   d|d< t t| ƒjttf|Ž d S )NTÚrequiredelimiters)r¢   rY   re   r   r   )rf   rg   )r£   rh   ri   re   Ö  s    zLassoCssLexer.__init__c             C   s6   t j| ƒd }tjd| ƒr"|d7 }d| kr2|d7 }|S )Ngš™™™™™©?z\w+:.+?;gš™™™™™¹?zpadding:)r   rƒ   r‹   r�   )r|   r‘   rh   rh   ri   rƒ   Ú  s    zLassoCssLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rY   É  s   c                   sD   e Zd ZdZdZddgZdgZdddgZ‡ fd	d
„Zdd„ Z	‡  Z
S )rZ   z�
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.

    .. versionadded:: 1.6
    zJavaScript+Lassozjs+lassozjavascript+lassoz*.jszapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassoc                s"   d|d< t t| ƒjttf|Ž d S )NTrË   )r¢   rZ   re   r   r   )rf   rg   )r£   rh   ri   re   ò  s    zLassoJavascriptLexer.__init__c             C   s   t j| ƒd }|S )Ngš™™™™™©?)r   rƒ   )r|   r‘   rh   rh   ri   rƒ   ÷  s    z!LassoJavascriptLexer.analyse_text)r„   r…   r†   r‡   rˆ   r‰   r¤   rŠ   re   rƒ   r¥   rh   rh   )r£   ri   rZ   ã  s   c               @   sL  e Zd ZdZdZdgZdefdefdeej	e
ƒdfdeeje
ƒdfgd	e
fd
ej	dfdejdfdeeeƒfdefdeejejƒfdeejeƒfdeee
eƒfdeee
ejƒfdeee
eƒdfedƒgd	e
fdedfdeee
eje
ƒfdeee
eedd�ƒfdejfedƒgdejfdejfdejfgedƒdejfd ejfd!efgd"œZd#S )$r[   zé
    Generic `handlebars <http://handlebarsjs.com/>` template lexer.

    Highlights only the Handlebars template tags (stuff between `{{` and `}}`).
    Everything else is left for a delegating lexer.

    .. versionadded:: 2.0
    Z
HandlebarsZ
handlebarsz[^{]+z\{\{!.*\}\}z(\{\{\{)(\s*)r�   z(\{\{)(\s*)z\s+z\}\}\}z#popz\}\}z/([#/]*)(each|if|unless|else|with|log|in(line)?)z	#\*inlinez([#/])([\w-]+)z([\w-]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()zdynamic-partialÚgenericz\)z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)r�   )r~   z[\w-]+z[a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+z:?"(\\\\|\\"|[^"])*"z:?'(\\\\|\\'|[^'])*'z>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?)r�   r�   zdynamic-partialr�   rÌ   N)r„   r…   r†   r‡   rˆ   r‰   r    r   r   ÚSpecialr   ry   r   r   r–   r›   r   r—   r   r   r   r   r   r™   rš   r   r}   rh   rh   rh   ri   r[   ü  sH   



c                   s:   e Zd ZdZdZdgZddgZddgZ‡ fdd	„Z‡  Z	S )
r\   z}
    Subclass of the `HandlebarsLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML+Handlebarszhtml+handlebarsz*.handlebarsz*.hbsztext/html+handlebarsztext/x-handlebars-templatec                s   t t| ƒjttf|Ž d S )N)r¢   r\   re   r   r[   )rf   rg   )r£   rh   ri   re   U  s    zHandlebarsHtmlLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   r\   H  s   c                   s<   e Zd ZdZdZdddgZdgZddgZ‡ fd	d
„Z‡  Z	S )r]   z¦
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `YamlLexer`.

    Commonly used in Saltstack salt states.

    .. versionadded:: 2.0
    z
YAML+Jinjaz
yaml+jinjaZsaltZslsz*.slsztext/x-yaml+jinjaz
text/x-slsc                s   t t| ƒjttf|Ž d S )N)r¢   r]   re   r   r2   )rf   rg   )r£   rh   ri   re   h  s    zYamlJinjaLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   r]   Y  s   
c               @   sj  e Zd ZdZdZdgZdgZdefdee	e
ƒdfdee	e
eedd	�ƒd
fdefgdejdfdeeje
ƒedddƒfdeeje
e	ƒdfdeeje
eedd	�e
e	ƒdfdeeje
e	ƒdfdeeje
e	ƒdfdeejde
e	ƒdfdeejde
e	ƒdfdeeje
eedd	�e	e
ƒdfdeeje
ƒdfg
edƒd e	dfd!e	d"fgedƒd e	dDfd#eeje	e
ƒd$fgd!e	dfed%ƒed&ƒgedƒedƒd'eeedd	�e
ee
eedd	�e
e	ƒfd(efd)ejfd*eeedd	�e
eje
eedd	�ƒfedƒedƒgedƒed+ƒgd,ee
ede
ƒdfd-ee
eje
ƒdfgd e	dfgd.e	dEfgd/e
dfgedƒd0eeje
eƒfd1ee	e
eedd	�e
e	ƒfed2ƒed3ƒed4ƒd5e	fged6ƒd7efged6ƒedƒd7efgd.e	dFfed&ƒgd.e	dGfed8ƒgd9ejfgd:ejfd;e	fgd<ejfd=ejfgd>ejfd?ejfged4ƒed2ƒed3ƒedƒgd@e
fgdAee	e
eje
e	ƒdHfd7efgdefdBee	e
eje
e	ƒdfdefgdCœZ dS )Ir^   zw
    Lexer for `Liquid templates
    <http://www.rubydoc.info/github/Shopify/liquid>`_.

    .. versionadded:: 2.0
    Zliquidz*.liquidz[^{]+z
(\{%)(\s*)ztag-or-blockz(\{\{)(\s*)([^\s}]+)rÌ   )r~   Úoutputz\{z(if|unless|elsif|case)(?=\s+)Ú	conditionz(when)(\s+)zend-of-blockÚ
whitespacez(else)(\s*)(%\})ú#popz!(capture)(\s+)([^\s%]+)(\s*)(%\})r�   z(comment)(\s*)(%\})rÂ   z(raw)(\s*)(%\})Úrawz(end(case|unless|if))(\s*)(%\})Nz(end([^\s%]+))(\s*)(%\})z"(cycle)(\s+)(?:([^\s:]*)(:))?(\s*)zvariable-tag-markupz([^\s%]+)(\s*)z
tag-markupz\}\}z\|Úfiltersz([^\s|:]+)(:?)(\s*)zfilter-markupz
end-of-tagzdefault-param-markupz/([^\s=!><]+)(\s*)([=!><]=?)(\s*)(\S+)(\s*)(%\})z\b!z\bnot\bz*([\w.\'"]+)(\s+)(contains)(\s+)([\w.\'"]+)zend-at-whitespacez(\s*)((=|!|>|<)=?)(\s*)z(\s*)(\bcontains\b)(\s*)z%\}z\s+z([^\s=:]+)(\s*)(=|:)z(\{\{)(\s*)([^\s}])(\s*)(\}\})rÄ   ÚnumberÚkeywordú,zparam-markupr©   zvariable-param-markupz\b(false|true)\bz[a-zA-Z_]\w*z(?<=\w)\.(?=\w)z'[^']*'z"[^"]*"z\d+\.\d+z\d+z[ \t]+z (\{%)(\s*)(endcomment)(\s*)(%\})z(\{%)(\s*)(endraw)(\s*)(%\}))r�   ztag-or-blockrÎ   rÓ   zfilter-markuprÏ   zgeneric-valueÚoperatorz
end-of-tagzend-of-blockzend-at-whitespacezparam-markupzdefault-param-markupzvariable-param-markupz
tag-markupzvariable-tag-markuprÕ   r�   rÄ   rÔ   rÌ   rÐ   rÂ   rÒ   )rÑ   rÑ   )rÑ   rÑ   )rÑ   rÑ   )rÑ   rÑ   )rÑ   rÑ   )!r„   r…   r†   r‡   rˆ   r‰   r’   r   r   r   r   r   r   r   ZReservedr   r   r­   r   r–   r   ÚWordr›   r˜   r—   r   rš   r™   r   ZFloatZIntegerr   r}   rh   rh   rh   ri   r^   l  sÎ   








c               @   s¢  e Zd ZdZdZdgZdgZejej	B Z
dZdZde d Zee Zd	efd
ejdfdefdeejeeeejeejeeeejƒfdeejeeeejeejeeeejƒfde eejeeeejƒdfdeejeeƒdfdefgde eeeejƒfde eeeeeejƒfdejfdefdejfeejfde ejfdefdejfdejfdefdefgdefdeeejƒd fed!ƒgdefd"eeejƒd fed!ƒd#e fgd$œZ!d%S )&r_   zÐ
    `Twig <http://twig.sensiolabs.org/>`_ template lexer.

    It just highlights Twig code between the preprocessor directives,
    other data is left untouched by the lexer.

    .. versionadded:: 2.0
    ZTwigZtwigzapplication/x-twigz[\\\w-]|[^\x00-\x7f]z(?:[\\_a-z]|[^\x00-\x7f])z(?:z)*z[^{]+z\{\{r¦   z\{\#.*?\#\}zB(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})zL(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})z(\{%%)(-?\s*)(filter)(\s+)(%s)r�   z(\{%)(-?\s*)([a-zA-Z_]\w*)z\{z(\|)(\s*)(%s)z(is)(\s+)(not)?(\s*)(%s)z(?i)(true|false|none|null)\bz–(in|not|and|b-and|or|b-or|b-xor|isif|elseif|else|importconstant|defined|divisibleby|empty|even|iterable|odd|sameasmatches|starts\s+with|ends\s+with)\bz(loop|block|parent)\bz\.z\.[0-9]+z:?"(\\\\|\\"|[^"])*"z:?'(\\\\|\\'|[^'])*'z4([{}()\[\]+\-*/,:~%]|\.\.|\?|:|\*\*|\/\/|!=|[><=]=?)z>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?z\s+z
(-?)(\}\})z#popr¨   z	(-?)(%\})r©   )r�   r¨   r¦   r�   N)"r„   r…   r†   r‡   rˆ   r‰   rŠ   r‹   r�   rª   r•   Z_ident_charZ_ident_beginZ
_ident_endZ_ident_innerr    r   ry   r   r   r   r   r–   r   r«   r¬   r—   r   r   r™   rš   r   r   r}   rh   rh   rh   ri   r_   :  sb   
c                   s6   e Zd ZdZdZdgZdgZdgZ‡ fdd„Z‡  Z	S )r`   zw
    Subclass of the `TwigLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    z	HTML+Twigz	html+twigz*.twigztext/html+twigc                s   t t| ƒjttf|Ž d S )N)r¢   r`   re   r   r_   )rf   rg   )r£   rh   ri   re   š  s    zTwigHtmlLexer.__init__)
r„   r…   r†   r‡   rˆ   r‰   r’   rŠ   re   r¥   rh   rh   )r£   ri   r`   �  s   c               @   sø   e Zd ZdZdZdgZdefdeej	e
ƒdfdeeejee
ee
ƒdfd	eeejee
ƒfd
eeejeeƒdfdeeejeƒfgde
fdej	dfdejfdejfdejfdefdejfdejfdeee
ee
ee
ee
ƒfg	dedfdedfdedfgdœZdS )ra   ad  
    Generic
    `angular2 <http://victorsavkin.com/post/119943127151/angular-2-template-syntax>`_
    template lexer.

    Highlights only the Angular template tags (stuff between `{{` and `}}` and
    special attributes: '(event)=', '[property]=', '[(twoWayBinding)]=').
    Everything else is left for a delegating lexer.

    .. versionadded:: 2.1
    ZAngular2Zng2z	[^{([*#]+z(\{\{)(\s*)ÚngExpressionz&([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)r±   z([([]+)([\w:.-]+)([\])]+)(\s*)z([*#])([\w:.-]+)(\s*)(=)(\s*)z([*#])([\w:.-]+)(\s*)z\s+(\|\s+)?z\}\}z#popz:?(true|false)z:?"(\\\\|\\"|[^"])*"z:?'(\\\\|\\'|[^'])*'z>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?z[a-zA-Z][\w-]*(\(.*\))?z\.[\w-]+(\(.*\))?z-(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)z".*?"z'.*?'z[^\s>]+)r�   rÙ   r±   N)r„   r…   r†   r‡   rˆ   r‰   r    r   r   ry   r   r   r   r›   r   r   ÚBooleanr™   rš   r   r—   r}   rh   rh   rh   ri   ra   ž  s8   
c                   s0   e Zd ZdZdZdgZdgZ‡ fdd„Z‡  ZS )rb   z{
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML + Angular2zhtml+ng2z*.ng2c                s   t t| ƒjttf|Ž d S )N)r¢   rb   re   r   ra   )rf   rg   )r£   rh   ri   re   ê  s    zAngular2HtmlLexer.__init__)	r„   r…   r†   r‡   rˆ   r‰   r’   re   r¥   rh   rh   )r£   ri   rb   Þ  s
   )tr‡   r‹   Zpygments.lexers.htmlr   r   Zpygments.lexers.javascriptr   r   Zpygments.lexers.cssr   Zpygments.lexers.phpr   Zpygments.lexers.pythonr   Zpygments.lexers.perlr	   Zpygments.lexers.jvmr
   r   Zpygments.lexers.datar   Zpygments.lexerr   r   r   r   r   r   r   r   r   Zpygments.tokenr   r   r   r   r   r   r   r   r   r   r    r!   Zpygments.utilr"   r#   Ú__all__r(   r-   rR   rS   rT   r2   r<   r=   r>   r@   r?   rA   rB   rC   rD   rE   rF   r²   rH   rI   rJ   rK   r9   r¸   r8   r7   r;   r:   r)   r*   r+   r,   r$   r%   r&   r'   r.   r/   r0   r1   r3   r5   r4   r6   r¿   rG   rL   rM   rN   rO   rÆ   rP   rQ   rU   rÊ   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rh   rh   rh   ri   Ú<module>
   sÊ   ,8_8RS09D,#@50.L OS@