HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pygments/lexers/__pycache__/templates.cpython-38.pyc
U

�a`��?@s�dZddlZddlmZmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZmZdd
lmZddlmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd
l,m-Z-m.Z.ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLg?Z/GdMd�de�Z0GdNd�de�Z1GdOd<�d<e�Z2GdPd=�d=e�Z3GdQd>�d>e�Z4GdRd�de�Z5GdSd&�d&e�Z6GdTd'�d'e�Z7GdUd(�d(e�Z8GdVd*�d*e�Z9GdWd)�d)e�Z:GdXd+�d+e�Z;GdYd,�d,e�Z<GdZd-�d-e�Z=Gd[d.�d.e�Z>Gd\d/�d/e�Z?Gd]d0�d0e�Z@Gd^d_�d_e�ZAGd`d2�d2e�ZBGdad3�d3e�ZCGdbd4�d4e�ZDGdcd5�d5e�ZEGddd#�d#e�ZFGdedf�dfe�ZGGdgd"�d"e�ZHGdhd!�d!e�ZIGdid%�d%e�ZJGdjd$�d$e�ZKGdkd�de�ZLGdld�de�ZMGdmd�de�ZNGdnd�de�ZOGdod�de�ZPGdpd�de�ZQGdqd�de�ZRGdrd�de�ZSGdsd�de�ZTGdtd�de�ZUGdud�de�ZVGdvd�de�ZWGdwd�de�ZXGdxd�de�ZYGdyd�de�ZZGdzd �d e�Z[Gd{d|�d|e�Z\Gd}d1�d1e�Z]Gd~d6�d6e�Z^Gdd7�d7e�Z_Gd�d8�d8e�Z`Gd�d9�d9e�ZaGd�d��d�e�ZbGd�d:�d:e�ZcGd�d;�d;e�ZdGd�d?�d?e�ZeGd�d��d�e�ZfGd�d@�d@e�ZgGd�dA�dAe�ZhGd�dB�dBe�ZiGd�dC�dCe�ZjGd�dD�dDe�ZkGd�dE�dEe�ZlGd�dF�dFe�ZmGd�dG�dGe�ZnGd�dH�dHe�ZoGd�dI�dIe�ZpGd�dJ�dJe�ZqGd�dK�dKe�ZrGd�dL�dLe�ZsdS)�z�
    pygments.lexers.templates
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for various template engines' markup.

    :copyright: Copyright 2006-2017 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@sFeZdZdZdZdgZdgZe�dej	�Z
dd�Zdd	�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`.
    ZERBZerbzapplication/x-ruby-templatingz*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)cKs*ddlm}|f|�|_tj|f|�dS)Nr)�	RubyLexer)Zpygments.lexers.rubyrc�
ruby_lexerr
�__init__)�self�optionsrc�rh�;/usr/lib/python3/dist-packages/pygments/lexers/templates.pyreCszErbLexer.__init__ccs"|j�|�}|��d}}�z�|dkrN|��}|t|fV|t|�7}d}q |dk�r�|��}|dkr�|t|fV|d7}d}�q|dkr�|tj|fV|��}|dt|fV|dt|�7}d}n�|dk�r4|tj|fV|t|�7}|��}d}|j�	|�D]\}}	}
|||	|
fV�q|t|�7}d}n�|dk�r\|t
|fV|t|�7}d}n\|tj|dfVd}|j�	|dd	��D] \}}	}
|d||	|
fV�q�|t|�7}d}q |dkr |��}|dk�r�|t|fVn|tj|fV|t|�7}d}q Wntk
�rYd	SXd	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<%%z%%>�z<%#�)�<%z<%=z<%-)�%>z-%>N)�	_block_re�split�reverse�popr �lenr�Preprocrd�get_tokens_unprocessedr�
IndexError)rf�text�tokens�state�idx�val�tag�dataZr_idxZr_tokenZr_valuerhrhriruHsf


�
�

zErbLexer.get_tokens_unprocessedcCsd|krd|krdSdS)Nrmrn皙�����?rh�rwrhrhri�analyse_text�szErbLexer.analyse_textN)�__name__�
__module__�__qualname__�__doc__�name�aliases�	mimetypes�re�compile�Mrorerur�rhrhrhrir(2s
Dc
@s�eZdZdZdZdgZdgZdgZej	ej
BZdefde
ejeej�fde
ejeed	d
�ej�fde
ejeje�dfdejdfgd
efdejdfdejdfdejfdejfdefdejfdefdejfdejfdejfgd�Zdd�ZdS)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.
    ZSmarty�smarty�*.tplzapplication/x-smarty�[^{]+z(\{)(\*.*?\*)(\})z(\{php\})(.*?)(\{/php\})T)Zstartinlinez(\{)(/?[a-zA-Z_]\w*)(\s*)�\{�\s+�#push�\}�#popz#[a-zA-Z_]\w*#z\$[a-zA-Z_]\w*(\.\w+)*z[~!%^&*()+=|\[\]:;,.<>/?@-]�(true|false|null)\b�>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?�"(\\\\|\\"|[^"])*"�'(\\\\|\\'|[^'])*'�[a-zA-Z_]\w*)�rootr�cCsXd}t�d|�r|d7}t�d|�r,|d7}t�d|�r@|d7}t�d|�rT|d7}|S)N�z\{if\s+.*?\}.*?\{/if\}�333333�?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}�{�G�z�?�r��search�rw�rvrhrhrir��szSmartyLexer.analyse_textN) r�r�r�r�r�r��	filenamesr�r��	MULTILINE�DOTALL�flagsr rrrtrrr�Functionr�Variablerr�Constantrr�Double�Single�	Attributerxr�rhrhrhrir-�sJ����
�

���c@s�eZdZdZdZdgZddgZejej	BZ
dZdefde
ejeej�fd	e
eje�fd
ede
ejejeje�dfd
ed
e
ejejej�fdedfgeejfdedfdede
eej�dfdedfed�gdefdedfdedejfed�gdefed�dedfgdedfdefdefdejfd ejfd!efd"efd#ejfdedfd$edfd%edfdedfdedfdedfgd&�Zd'd(�Zd)S)*rRz�
    Generic `Velocity <http://velocity.apache.org/>`_ template lexer.

    Just highlights velocity directives and variable references, other
    data is left untouched by the lexer.
    ZVelocityZvelocity�*.vm�*.fhtmlr�z[^{#$]+z(#)(\*.*?\*)(#)z
(##)(.*?$)z(#\{?)(z
)(\}?)(\s?\()�directiveparamsz)(\}|\b)z\$\{?�variablez\(�
funcparamsz(\.)(�)r�r�r�z=(&&|\|\||==?|!=?|[-<>+*%&|^/])|\b(eq|ne|gt|lt|ge|le|not|in)\bz\[�
rangeoperatorz\bz\.\.z\]r�z[,:]r�r�z0[xX][0-9a-fA-F]+[Ll]?z
\b[0-9]+\br��\)r�)r�r�r�r�r�cCsXd}t�d|�r|d7}t�d|�r,|d7}t�d|�r@|d7}t�d|�rT|d7}|S)	Nr�z #\{?macro\}?\(.*?\).*?#\{?end\}?g�?z#\{?if\}?\(.+?\).*?#\{?end\}?r�z"#\{?foreach\}?\(.+?\).*?#\{?end\}?z4\$\{?[a-zA-Z_]\w*(\([^)]*\))?(\.\w+(\([^)]*\))?)*\}?r�r�r�rhrhrir�
s�zVelocityLexer.analyse_textN) r�r�r�r�r�r�r�r�r�r�r�Z
identifierr rrrtrr�rr�rrrrrr�r�rrr�rxr�rhrhrhrirR�sv�
�
�
��

��	�����4cs8eZdZdZdZdgZddgZdgZ�fdd�Z�Z	S)	rSza
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `HtmlLexer`.

    z
HTML+Velocityz
html+velocity�*.htmlr�ztext/html+velocitycstt|�jttf|�dS�N)�superrSrerrR�rfrg��	__class__rhrire's�zVelocityHtmlLexer.__init__)
r�r�r�r�r�r��alias_filenamesr�re�
__classcell__rhrhr�rirSscs@eZdZdZdZdgZddgZdgZ�fdd�Zd	d
�Z	�Z
S)rTz`
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `XmlLexer`.

    zXML+Velocityzxml+velocity�*.xmlr�zapplication/xml+velocitycstt|�jttf|�dSr�)r�rTrerrRr�r�rhrire8s�zVelocityXmlLexer.__init__cCs"t�|�d}t|�r|d7}|S�Nr�r~)rRr�r#r�rhrhrir�<szVelocityXmlLexer.analyse_text�r�r�r�r�r�r�r�r�rer�r�rhrhr�rirT,sc@s|eZdZdZdZddgZddgZejej	BZ
defdej
d	fd
efdeej
eeeej
eej
eeeej
�fdeej
eeeej
eej
eeeej
�fd
eej
eeeej�dfdeej
ee�dfdefgdeeeej�fdeeeeeej�fdejfdefdejfdejfdejfdejfdejfdefdefgdefdeeej
�dfed�gdefd eeej
�dfed�d!efgd"�Zd#d$�Zd%S)&r2a
    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/JinjaZdjangoZjinjazapplication/x-django-templatingzapplication/x-jinjar��\{\{�varz\{[*#].*?[*#]\}zJ(\{%)(-?\s*)(comment)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endcomment)(\s*-?)(%\})�B(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})z'(\{%)(-?\s*)(filter)(\s+)([a-zA-Z_]\w*)�block�(\{%)(-?\s*)([a-zA-Z_]\w*)r�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([{}()\[\]+\-*/,:~]|[><=]=?)r�r��
(-?)(\}\})r��varnames�	(-?)(%\})�.)r�r�r�r�cCsPd}t�d|�dk	r|d7}t�d|�dk	r4|d7}t�d|�dk	rL|d7}|S)Nr�z\{%\s*(block|extends)r~z\{%\s*if\s*.*?%\}皙�����?z\{\{.*?\}\}r�r�rhrhrir��szDjangoLexer.analyse_textN)r�r�r�r�r�r�r�r�r��Sr�r rrtrrrrr�r�Pseudo�Builtinr�rr�r�rrrrxr�rhrhrhrir2Cs�
���������������9c@s�eZdZdZdZdgZddgZdgZddefd	e	e
jee
je
je
e�e
j�fd
e	e
je
je
je
e�e
j�fde	e
je
je
e�e
j�fde	e
je
je
e�e
j�fd
e
jfde	e
je
e�e
j�fdefde	e
je
e�e�fde	ee�fg
iZdS)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/
    ZMyghtyZmyghtyz*.mytZautodelegatezapplication/x-myghtyr�r��3(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)�#(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)z(<&[^|])(.*?)(,.*?)?(&>)�(?s)(<&\|)(.*?)(,.*?)?(&>)�</&>�(?s)(<%!?)(.*?)(%>)�(?<=^)#[^\n]*(\n|\Z)�(?<=^)(%)([^\n]*)(\n|\Z)��(?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�rrr�Tagr�rrrrr rrxrhrhrhrir<�sL	��������	���cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)r=zy
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `HtmlLexer`.

    .. versionadded:: 0.6
    zHTML+Myghtyzhtml+myghtyztext/html+myghtycstt|�jttf|�dSr�)r�r=rerr<r�r�rhrire�s�zMyghtyHtmlLexer.__init__�	r�r�r�r�r�r�r�rer�rhrhr�rir=�s
cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)r>zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.6
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtycstt|�jttf|�dSr�)r�r>rerr<r�r�rhrire�s�zMyghtyXmlLexer.__init__r�rhrhr�rir>�s
cs6eZdZdZdZddgZdddgZ�fdd	�Z�ZS)
r@z
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `JavascriptLexer`.

    .. versionadded:: 0.6
    zJavaScript+Myghtyz	js+myghtyzjavascript+myghtyzapplication/x-javascript+myghtyztext/x-javascript+myghtyztext/javascript+mygthycstt|�jttf|�dSr�)r�r@rerr<r�r�rhrire�s
��zMyghtyJavascriptLexer.__init__r�rhrhr�rir@�s�cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)r?zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.6
    z
CSS+Myghtyz
css+myghtyztext/css+myghtycstt|�jttf|�dSr�)r�r?rerr<r�r�rhrires�zMyghtyCssLexer.__init__r�rhrhr�rir?�s
c@seZdZdZdZdgZdddddd	gZd
gZddefd
e	e
jej
e
j�fde	e
jee
je
jee�e
j�fde	e
je
je
jee�e
j�fde	e
je
jee�e
j�fde	e
je
jee�e
j�fde
jfde	e
jee�e
j�fdefde	e
jee�e�fde	ee�e�fgiZdd�ZdS)rAz�
    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
    ZMasonZmasonz*.mz*.mhtmlz*.mcz*.miZautohandlerZdhandlerzapplication/x-masonr�r�z(?s)(<%doc>)(.*?)(</%doc>)r�r�z(?s)(<&[^|])(.*?)(,.*?)?(&>)r�r�r�r�r�r�cCs6d}t�d|�dk	rd}nt�d|tj�dk	r2d}|S)Nr�z</%(class|doc|init)%>g�?z<&.+&>g)\��(�?)r�r�r�)rw�resultrhrhrir�<szMasonLexer.analyse_textN)r�r�r�r�r�r�r�r�rrrr�r�	Multiliner�rrr	r rrrxr�rhrhrhrirAsT���������	���"c
@s0eZdZdZdZdgZdgZdgZdee	e
jee
�fdee	e
jee�e
�fdee	e
je
�fd	e
jfd
ee
jej�dfdee
jeje
j�fd
e
jdfdee
jee�e
j�fdee
jee�e
j�fdee
e�fde	fgde
jfdejfed�gdeeje	e�fde
jdfde	fgdedfdedfdedfgd�ZdS)rBz�
    Generic `mako templates`_ lexer. Code that isn't Mako
    markup is yielded as `Token.Other`.

    .. versionadded:: 0.7

    .. _mako templates: http://www.makotemplates.org/
    ZMakoZmakoz*.maozapplication/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
                )
            r�rmz'(?<=<%)(include|inherit|namespace|page)z((?:\w+)\s*=)(\s*)(".*?")�/?\s*>r��".*?"�'.*?'�[^\s>]+)r�r�r|�attrN)r�r�r�r�r�r�r�r�rrrrtrr rrrr�rrr�rrxrhrhrhrirBEsb	�����
��
��"��
���cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)rCzw
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.

    .. versionadded:: 0.7
    z	HTML+Makoz	html+makoztext/html+makocstt|�jttf|�dSr�)r�rCrerrBr�r�rhrire�s�zMakoHtmlLexer.__init__r�rhrhr�rirC�s
cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)rDzv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.7
    zXML+Makozxml+makozapplication/xml+makocstt|�jttf|�dSr�)r�rDrerrBr�r�rhrire�s�zMakoXmlLexer.__init__r�rhrhr�rirD�s
cs6eZdZdZdZddgZdddgZ�fdd	�Z�ZS)
rEz}
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `JavascriptLexer`.

    .. versionadded:: 0.7
    zJavaScript+Makozjs+makozjavascript+makozapplication/x-javascript+makoztext/x-javascript+makoztext/javascript+makocstt|�jttf|�dSr�)r�rErerrBr�r�rhrire�s
��zMakoJavascriptLexer.__init__r�rhrhr�rirE�s�cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)rFzv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.7
    zCSS+Makozcss+makoz
text/css+makocstt|�jttf|�dSr�)r�rFrerrBr�r�rhrire�s�zMakoCssLexer.__init__r�rhrhr�rirF�s
c@seZdZdZdd�ZdS)�CheetahPythonLexerzI
    Lexer for handling Cheetah's special $ tokens in Python syntax.
    ccsJtf|j�}|�|�D].\}}}|tjkr8|dkr8tj}|||fVqdS)N�$)rrgrur!rrrt)rfrwZpylexer�posZtype_�valuerhrhriru�s
z)CheetahPythonLexer.get_tokens_unprocessedN)r�r�r�r�rurhrhrhrir��sr�c@s�eZdZdZdZddgZddgZddgZd	d
ee	�fde	fde	j
fd
e	j
fdee	j
ee�e	j
�fdee	j
ee��fdee	j
ee�e	j
�fde
fdefg	iZdS)rHa2
    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/
    ZCheetahZcheetahZspitfirez*.tmplz*.sptzapplication/x-cheetahzapplication/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
                )
            r�N)r�r�r�r�r�r�r�r�rrrtrr�r rrxrhrhrhrirH�s>	���������cs6eZdZdZdZdddgZddgZ�fdd	�Z�ZS)
rIz_
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `HtmlLexer`.
    zHTML+Cheetahzhtml+cheetahz
html+spitfireZhtmlcheetahztext/html+cheetahztext/html+spitfirecstt|�jttf|�dSr�)r�rIrerrHr�r�rhrires�zCheetahHtmlLexer.__init__r�rhrhr�rirI
s

cs4eZdZdZdZddgZddgZ�fdd�Z�ZS)	rJz^
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Cheetahzxml+cheetahzxml+spitfirezapplication/xml+cheetahzapplication/xml+spitfirecstt|�jttf|�dSr�)r�rJrerrHr�r�rhrire#s�zCheetahXmlLexer.__init__r�rhrhr�rirJs
cs@eZdZdZdZddddgZddd	d
ddgZ�fd
d�Z�ZS)rKze
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Cheetahz
js+cheetahzjavascript+cheetahzjs+spitfirezjavascript+spitfirez application/x-javascript+cheetahztext/x-javascript+cheetahztext/javascript+cheetahz!application/x-javascript+spitfireztext/x-javascript+spitfireztext/javascript+spitfirecstt|�jttf|�dSr�)r�rKrerrHr�r�rhrire8s
��zCheetahJavascriptLexer.__init__r�rhrhr�rirK(s��c
@s�eZdZdZdZdgZddgZdefdee	e
�fdee	e
j�d	fed
�defgde	d
fde
e�d
fdeee	e
e��d
fded
fdeee	e
�d
fgdee
je
e�e
j�fdejfgd�ZdS)r9z]
    A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ text
    templates.
    zGenshi TextZ
genshitextzapplication/x-genshi-textz
text/x-genshiz[^#$\s]+z
^(\s*)(##.*)$z	^(\s*)(#)�	directiver�z[#$\s]z\nr�z(?:def|for|if)\s+.*z (choose|when|with)([^\S\n]+)(.*)z(choose|otherwise)\bz(end\w*)([^\S\n]*)(.*)�(?<!\$)(\$\{)(.+?)(\})z(?<!\$)(\$)([a-zA-Z_][\w.]*))r�r�r�N)r�r�r�r�r�r�r�r rrrrtrrrrrr�rxrhrhrhrir9=s6���	����c
@sHeZdZdZejZdefdee	j
ee�e	j
�fdefde
jdfde
jdfed	�d
efgdefde
jd
fde
jdfgdeeee�e�dfdeeee�e�dfdedfgdefde
jd
fde
jdfde
jdfgdedfdedfdedfgdedfed�defgdedfed�defgdefed	�gdee	j
ee�e	j
�fde
jfgd�	ZdS) �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[<$]r�z[\w:-]+\s*=�pyattrr�r�z(")(.*?)(")z(')(.*?)(')r�z
py:[\w-]+\s*=r��"�attr-dstring�'�attr-sstringz[^\s>]*�stringsz[^"'$]+r�z(?<!\$)(\$)([a-zA-Z_][\w\.]*))	r�r�r�r|r�r�r�r�r�N)r�r�r�r�r�r�r�r rrrtrrrr�rrr�rr�rxrhrhrhrir�`s`�

�

��


���������r�csDeZdZdZdZddgZdddgZdgZ�fd	d
�Zdd�Z	�Z
S)
r8z�
    A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid HTML templates.
    zHTML+Genshizhtml+genshizhtml+kidr��*.htm�*.xhtmlztext/html+genshicstt|�jttf|�dSr�)r�r8rerr�r�r�rhrire�s�zHtmlGenshiLexer.__init__cCsFd}t�d|�dk	r|d7}t�d|�dk	r4|d7}|t�|�dS�Nr�z	\$\{.*?\}皙�����?zpy:(.*?)=["\']r�)r�r�rr�r�rhrhrir��szHtmlGenshiLexer.analyse_textr�rhrhr�rir8�s
csLeZdZdZdZddddgZdgZdgZd	d
gZ�fdd�Z	d
d�Z
�ZS)r7z�
    A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid XML templates.
    ZGenshiZgenshiZkidz
xml+genshizxml+kidz*.kidr�zapplication/x-genshizapplication/x-kidcstt|�jttf|�dSr�)r�r7rerr�r�r�rhrire�s�zGenshiLexer.__init__cCsFd}t�d|�dk	r|d7}t�d|�dk	r4|d7}|t�|�dSr�)r�r�rr�r�rhrhrir��szGenshiLexer.analyse_text�r�r�r�r�r�r�r�r�r�rer�r�rhrhr�rir7�scsHeZdZdZdZddddgZdgZdd	d
gZ�fdd�Zd
d�Z	�Z
S)r;zK
    A lexer that highlights javascript code in genshi text templates.
    zJavaScript+Genshi Textz
js+genshitextz	js+genshizjavascript+genshitextzjavascript+genshi�*.jszapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshicstt|�jttf|�dSr�)r�r;rerr9r�r�rhrire�s
��zJavascriptGenshiLexer.__init__cCst�|�dS�N皙�����?�r7r�rrhrhrir��sz"JavascriptGenshiLexer.analyse_textr�rhrhr�rir;�s��cs@eZdZdZdZddgZdgZdgZ�fdd�Zd	d
�Z	�Z
S)r:zK
    A lexer that highlights CSS definitions in genshi text templates.
    zCSS+Genshi Textzcss+genshitextz
css+genshi�*.cssztext/css+genshicstt|�jttf|�dSr�)r�r:rerr9r�r�rhrire�s�zCssGenshiLexer.__init__cCst�|�dSr�r�rrhrhrir��szCssGenshiLexer.analyse_textr�rhrhr�rir:�scsLeZdZdZdZdddgZdgZddd	gZd
gZ�fdd�Z	d
d�Z
�ZS)r)z�
    Subclass of the ERB lexer that highlights the unlexed data with the
    html lexer.

    Nested Javascript and CSS is highlighted too.
    ZRHTMLZrhtmlzhtml+erbz	html+rubyz*.rhtmlr�r�r�ztext/html+rubycstt|�jttf|�dSr�)r�r)rerr(r�r�rhrireszRhtmlLexer.__init__cCs"t�|�d}t|�r|d7}|S�Nr�g�?)r(r�r"r�rhrhrir�
szRhtmlLexer.analyse_textr�rhrhr�rir)�s

cs@eZdZdZdZddgZdgZdgZ�fdd�Zd	d
�Z	�Z
S)r*zo
    Subclass of `ErbLexer` which highlights data outside preprocessor
    directives with the `XmlLexer`.
    zXML+Rubyzxml+erbzxml+rubyr�zapplication/xml+rubycstt|�jttf|�dSr�)r�r*rerr(r�r�rhrireszXmlErbLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)r(r�r#r�rhrhrir� szXmlErbLexer.analyse_textr�rhrhr�rir*scs@eZdZdZdZddgZdgZdgZ�fdd�Zd	d
�Z	�Z
S)r+zS
    Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
    zCSS+Rubyzcss+erbzcss+rubyr�z
text/css+rubycstt|�jttf|�dSr�)r�r+rerr(r�r�rhrire1szCssErbLexer.__init__cCst�|�dSr��r(r�rrhrhrir�4szCssErbLexer.analyse_textr�rhrhr�rir+'scsHeZdZdZdZddddgZdgZdd	d
gZ�fdd�Zd
d�Z	�Z
S)r,z^
    Subclass of `ErbLexer` which highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Rubyzjs+erbzjavascript+erbzjs+rubyzjavascript+rubyr�zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubycstt|�jttf|�dSr�)r�r,rerr(r�r�rhrireEs�zJavascriptErbLexer.__init__cCst�|�dSr�r�rrhrhrir�IszJavascriptErbLexer.analyse_textr�rhrhr�rir,8s�csTeZdZdZdZdgZdgZddddd	gZd
ddd
dgZ�fdd�Z	dd�Z
�ZS)r$z�
    Subclass of `PhpLexer` that highlights unhandled data with the `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+PHPzhtml+phpz*.phtml�*.phpr�r�r��
*.php[345]zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5cstt|�jttf|�dSr�)r�r$rerrr�r�rhrire]szHtmlPhpLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)rr�r"r�rhrhrir�`szHtmlPhpLexer.analyse_textr�rhrhr�rir$Ms��csBeZdZdZdZdgZdddgZdgZ�fdd	�Zd
d�Z	�Z
S)r%zT
    Subclass of `PhpLexer` that highlights unhandled data with the `XmlLexer`.
    zXML+PHPzxml+phpr�r�r�zapplication/xml+phpcstt|�jttf|�dSr�)r�r%rerrr�r�rhrireqszXmlPhpLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)rr�r#r�rhrhrir�tszXmlPhpLexer.analyse_textr�rhrhr�rir%gs
cs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
r&zU
    Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
    zCSS+PHPzcss+phpr�ztext/css+phpcstt|�jttf|�dSr�)r�r&rerrr�r�rhrire�szCssPhpLexer.__init__cCst�|�dSr��rr�rrhrhrir��szCssPhpLexer.analyse_textr�rhrhr�rir&{scsDeZdZdZdZddgZdgZdddgZ�fd	d
�Zdd�Z	�Z
S)
r'z`
    Subclass of `PhpLexer` which highlights unmatched data with the
    `JavascriptLexer`.
    zJavaScript+PHPzjs+phpzjavascript+phpr�zapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpcstt|�jttf|�dSr�)r�r'rerrr�r�rhrire�s�zJavascriptPhpLexer.__init__cCs
t�|�Sr�r�rrhrhrir��szJavascriptPhpLexer.analyse_textr�rhrhr�rir'�s�csDeZdZdZdZdgZddddgZdgZ�fd	d
�Zdd�Z	�Z
S)
r.z�
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Smartyzhtml+smartyr�r�r�r�ztext/html+smartycstt|�jttf|�dSr�)r�r.rerr-r�r�rhrire�szHtmlSmartyLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)r-r�r"r�rhrhrir��szHtmlSmartyLexer.analyse_textr�rhrhr�rir.�scs@eZdZdZdZdgZddgZdgZ�fdd�Zd	d
�Z	�Z
S)r/z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Smartyz
xml+smartyr�r�zapplication/xml+smartycstt|�jttf|�dSr�)r�r/rerr-r�r�rhrire�szXmlSmartyLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)r-r�r#r�rhrhrir��szXmlSmartyLexer.analyse_textr�rhrhr�rir/�scs@eZdZdZdZdgZddgZdgZ�fdd�Zd	d
�Z	�Z
S)r0z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `CssLexer`.
    z
CSS+Smartyz
css+smartyr�r�ztext/css+smartycstt|�jttf|�dSr�)r�r0rerr-r�r�rhrire�szCssSmartyLexer.__init__cCst�|�dSr��r-r�rrhrhrir��szCssSmartyLexer.analyse_textr�rhrhr�rir0�scsFeZdZdZdZddgZddgZddd	gZ�fd
d�Zdd
�Z	�Z
S)r1zd
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Smartyz	js+smartyzjavascript+smartyr�r�zapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartycstt|�jttf|�dSr�)r�r1rerr-r�r�rhrire�s�zJavascriptSmartyLexer.__init__cCst�|�dSr�r�rrhrhrir��sz"JavascriptSmartyLexer.analyse_textr�rhrhr�rir1�s�csHeZdZdZdZdddgZdddgZd	d
gZ�fdd�Zd
d�Z	�Z
S)r3z�
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Django/Jinjazhtml+djangoz
html+jinjaZ
htmldjangor�r�r�ztext/html+djangoztext/html+jinjacstt|�jttf|�dSr�)r�r3rerr2r�r�rhrireszHtmlDjangoLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)r2r�r"r�rhrhrir�szHtmlDjangoLexer.analyse_textr�rhrhr�rir3�s

csBeZdZdZdZddgZdgZddgZ�fdd	�Zd
d�Z	�Z
S)r5z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `XmlLexer`.
    zXML+Django/Jinjaz
xml+djangoz	xml+jinjar�zapplication/xml+djangozapplication/xml+jinjacstt|�jttf|�dSr�)r�r5rerr2r�r�rhrireszXmlDjangoLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)r2r�r#r�rhrhrir�szXmlDjangoLexer.analyse_textr�rhrhr�rir5scsBeZdZdZdZddgZdgZddgZ�fdd	�Zd
d�Z	�Z
S)r4z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `CssLexer`.
    zCSS+Django/Jinjaz
css+djangoz	css+jinjar�ztext/css+djangoztext/css+jinjacstt|�jttf|�dSr�)r�r4rerr2r�r�rhrire+szCssDjangoLexer.__init__cCst�|�dSr��r2r�rrhrhrir�.szCssDjangoLexer.analyse_textr�rhrhr�rir4 scsNeZdZdZdZddddgZdgZdd	d
ddd
gZ�fdd�Zdd�Z	�Z
S)r6zd
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Django/Jinjaz	js+djangozjavascript+djangozjs+jinjazjavascript+jinjar�zapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjacstt|�jttf|�dSr�)r�r6rerr2r�r�rhrireCs�zJavascriptDjangoLexer.__init__cCst�|�dSr�r�rrhrhrir�Gsz"JavascriptDjangoLexer.analyse_textr�rhrhr�rir62s ��c@sFeZdZdZdedfdefdefdefgdedfd	ee�fgd
�ZdS)�JspRootLexerzt
    Base for the `JspLexer`. Yields `Token.Other` for area outside of
    JSP tags.

    .. versionadded:: 0.7
    �<%\S?�seczC</?jsp:(forward|getProperty|include|plugin|setProperty|useBean).*?>�[^<]+�<rnr��[\w\W]+?(?=%>|\Z)�r�r�N)	r�r�r�r�rr rr
rxrhrhrhrir�Ks	��	
��r�cs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
rGzA
    Lexer for Java Server Pages.

    .. versionadded:: 0.7
    zJava Server PageZjspz*.jspzapplication/x-jspcstt|�jttf|�dSr�)r�rGrerr�r�r�rhrireoszJspLexer.__init__cCs:t�|�d}t|�r|d7}d|kr6d|kr6|d7}|S�Nr�r~rmrnr�)r
r�r#r�rhrhrir�rszJspLexer.analyse_text�r�r�r�r�r�r�r�r�rer�r�rhrhr�rirGdsc@s�eZdZdZdZdgZdgZdgZej	Z
defdej
dfd	efd
ej
fdeeejedee�fd
eeejedeee�e�fdeeejedee�e�fdeeej�fdeedee�ejdde�fdefg
dej
fdej
dfdej
dfdej
fgd�ZdS)rLzR
    For files using the Evoque templating system.

    .. versionadded:: 1.1
    ZEvoqueZevoquez*.evoquezapplication/x-evoquez[^#$]+z#\[�commentz\$\$z\$\w+:[^$\n]*\$z'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})Nz>(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+)?(.*?)((?(4)%)\})z!(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})z(\$)(else|rof|fi)z%(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})�#z[^\]#]r�z\]#r�z[\]#])r�r)r�r�r�r�r�r�r�r�r�r�r�r rr�rrrr�rrrrxrhrhrhrirL{s\
���������

��cs6eZdZdZdZdgZdgZdgZ�fdd�Z�Z	S)rMzy
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 1.1
    zHTML+Evoquezhtml+evoquer�ztext/html+evoquecstt|�jttf|�dSr�)r�rMrerrLr�r�rhrire�s�zEvoqueHtmlLexer.__init__�
r�r�r�r�r�r�r�r�rer�rhrhr�rirM�scs6eZdZdZdZdgZdgZdgZ�fdd�Z�Z	S)rNzx
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.

    .. versionadded:: 1.1
    z
XML+Evoquez
xml+evoquer�zapplication/xml+evoquecstt|�jttf|�dSr�)r�rNrerrLr�r�rhrire�s�zEvoqueXmlLexer.__init__rrhrhr�rirN�sc@s�eZdZdZdZdgZgZgZej	Z
dejfdej
fdefdefdefd	efd
efdefdefd
ejdfdejfdefdefdejfdejfdeejee�fdejfdefdefgdejfdejfdejfdejfd
ejdfgd�ZdS)rOz
    Coldfusion statements
    ZcfstatementZcfsz//.*?\nz/\*(?:.|\n)*?\*/z\+\+|--z
[-+*/^&=!]z<=|>=|<|>|==zmod\bz"(eq|lt|gt|lte|gte|not|is|and|or)\bz\|\||&&z\?r��stringr��\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)\br�zD(application|session|client|cookie|super|this|variables|arguments)\bz([a-z_$][\w.]*)(\s*)(\()z
[a-z_$][\w.]*z[()\[\]{};:,.\\]r�z""z#.+?#z[^"#]+rr�)r�r	N)r�r�r�r�r�r�r�r�r��
IGNORECASEr�rr�r�rrr�rrr�rrr�rrr�ZInterprxrhrhrhrirO�sN
����
��c
@s�eZdZdZdZdgZgZgZdefe	d�defgde
jdfd	e
fd
ej
dfdeej
ee�ej
�fd
eej
ee�ej
�fgdefdeeee�e�fdej
dfe	d�defdefgde
jdfde
jdfde
jfgd�ZdS)�ColdfusionMarkupLexerz 
    Coldfusion markup only
    Z
ColdfusionZcfr�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.*?>r�z(?s)<[^<>]*rr�z--->z([^<-]|<(?!!---)|-(?!-->))+)r�r
rrN)r�r�r�r�r�r�r�r�r rrr�rr�rrrOrrxrhrhrhrirsB�

����
�

��rcs8eZdZdZdZdgZddgZdgZ�fdd�Z�Z	S)	rPz#
    Coldfusion markup in html
    zColdfusion HTMLZcfmz*.cfmz*.cfmlzapplication/x-coldfusioncstt|�jttf|�dSr�)r�rPrerrr�r�rhrire9s�zColdfusionHtmlLexer.__init__rrhrhr�rirP0scs4eZdZdZdZdgZdgZgZ�fdd�Z�Z	S)rQzH
    Coldfusion markup/script components

    .. versionadded:: 2.0
    zColdfusion CFCZcfcz*.cfccstt|�jttf|�dSr�)r�rQrerPrOr�r�rhrireIs�zColdfusionCFCLexer.__init__rrhrhr�rirQ>scs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
rUzD
    Lexer for Scalate Server Pages.

    .. versionadded:: 1.4
    zScalate Server PageZsspz*.sspzapplication/x-sspcstt|�jttf|�dSr�)r�rUrerr�r�r�rhrireYszSspLexer.__init__cCsDd}t�d|�r|d7}t|�r(|d7}d|kr@d|kr@|d7}|S)Nr�zval \w+\s*:g333333�?r�rmrnr�)r�r�r#r�rhrhrir�\szSspLexer.analyse_textrrhrhr�rirUNsc@s@eZdZdZdedfdefdefgdedfdee�fgd	�Zd
S)�TeaTemplateRootLexerz
    Base for the `TeaTemplateLexer`. Yields `Token.Other` for area outside of
    code blocks.

    .. versionadded:: 1.5
    r�r�rrrnr�rrN)	r�r�r�r�rr rrrxrhrhrhrirgs	�
��rcs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
rVzW
    Lexer for `Tea Templates <http://teatrove.org/>`_.

    .. versionadded:: 1.5
    ZTeaZteaz*.teaz
text/x-teacstt|�jttf|�dSr�)r�rVrerrr�r�rhrire�s
��zTeaTemplateLexer.__init__cCs:t�|�d}t|�r|d7}d|kr6d|kr6|d7}|Sr)rr�r#r�rhrhrir��szTeaTemplateLexer.analyse_textrrhrhr�rirV}scsPeZdZdZdZdgZdddddd	d
dgZdd
dgZ�fdd�Zdd�Z	�Z
S)rWz�
    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+lassor�r�r��*.lasso�*.lasso[89]�*.incl�*.inc�*.lasztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]cstt|�jttf|�dSr�)r�rWrerrr�r�rhrire�szLassoHtmlLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)rr�r"r�rhrhrir��szLassoHtmlLexer.analyse_textr�rhrhr�rirW�s	
��csHeZdZdZdZdgZdddddd	gZd
gZ�fdd�Zd
d�Z	�Z
S)rXzz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.

    .. versionadded:: 1.6
    z	XML+Lassoz	xml+lassor�rrrrrzapplication/xml+lassocstt|�jttf|�dSr�)r�rXrerrr�r�rhrire�szLassoXmlLexer.__init__cCs"t�|�d}t|�r|d7}|Sr�)rr�r#r�rhrhrir��szLassoXmlLexer.analyse_textr�rhrhr�rirX�s�cs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
rYzz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.

    .. versionadded:: 1.6
    z	CSS+Lassoz	css+lassor�ztext/css+lassocs"d|d<tt|�jttf|�dS�NTZrequiredelimiters)r�rYrerrr�r�rhrire�szLassoCssLexer.__init__cCs6t�|�d}t�d|�r"|d7}d|kr2|d7}|S)Nr�z\w+:.+?;r�zpadding:)rr�r�r�r�rhrhrir��szLassoCssLexer.analyse_textr�rhrhr�rirY�scsDeZdZdZdZddgZdgZdddgZ�fd	d
�Zdd�Z	�Z
S)
rZz�
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.

    .. versionadded:: 1.6
    zJavaScript+Lassozjs+lassozjavascript+lassor�zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassocs"d|d<tt|�jttf|�dSr)r�rZrerrr�r�rhrire�s�zLassoJavascriptLexer.__init__cCst�|�d}|Sr�)rr�r�rhrhrir��sz!LassoJavascriptLexer.analyse_textr�rhrhr�rirZ�s�c@sLeZdZdZdZdgZdefdefdeej	e
�dfdeeje
�dfgd	e
fd
ej	dfdejdfd
eee�fdefdee
je
j�fdee
je�fdeee
e�fdeee
e
j�fdeee
e�dfed�gd	e
fdedfdeee
e
je
�fdeee
eedd��fde
jfed�gde
jfde
jfde
jfged�dejfd ejfd!efgd"�Zd#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
handlebarsr�z\{\{!.*\}\}z
(\{\{\{)(\s*)r|�(\{\{)(\s*)r�z\}\}\}r��\}\}z/([#/]*)(each|if|unless|else|with|log|in(line)?)z	#\*inlinez([#/])([\w-]+)z([\w-]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()�dynamic-partial�genericr�z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)r��ryz[\w-]+z[a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+r�r�r�)r�r|rr�rN)r�r�r�r�r�r�r rr�Specialrrtrrr�r�rr�rrrrrr�r�rrxrhrhrhrir[�s`	�


����
��
����cs:eZdZdZdZdgZddgZddgZ�fdd	�Z�Z	S)
r\z}
    Subclass of the `HandlebarsLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML+Handlebarszhtml+handlebarsz*.handlebarsz*.hbsztext/html+handlebarsztext/x-handlebars-templatecstt|�jttf|�dSr�)r�r\rerr[r�r�rhrireUszHandlebarsHtmlLexer.__init__rrhrhr�rir\Hscs<eZdZdZdZdddgZdgZddgZ�fd	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+jinjaZsaltZslsz*.slsztext/x-yaml+jinjaz
text/x-slscstt|�jttf|�dSr�)r�r]rerr2r�r�rhrirehszYamlJinjaLexer.__init__rrhrhr�rir]Ys	
c@sjeZdZdZdZdgZdgZdefdee	e
�dfdee	e
eedd	��d
fdefgde
jd
fdee
je
�eddd�fdee
je
e	�dfdeeje
eedd	�e
e	�dfdeeje
e	�dfdeeje
e	�dfdee
jde
e	�dfdeejde
e	�dfdeeje
eedd	�e	e
�dfdeeje
�dfg
ed�d e	dfd!e	d"fged�d e	d#fd$eeje	e
�d%fgd!e	dfed&�ed'�ged�ed�d(eeedd	�e
ee
eedd	�e
e	�fd)efd*ejfd+eeedd	�e
eje
eedd	��fed�ed�ged�ed,�gd-ee
ede
�dfd.ee
eje
�dfgd e	dfgd/e	d#fgd0e
dfged�d1eeje
e�fd2ee	e
eedd	�e
e	�fed3�ed4�ed5�d6e	fged7�d8efged7�ed�d8efgd/e	d#fed'�gd/e	d#fed9�gd:e
jfgd;ejfd<e	fgd=ejfd>ejfgd?ejfd@ejfged5�ed3�ed4�ed�gdAe
fgdBee	e
eje
e	�d#fd8efgdefdCee	e
eje
e	�dfdefgdD�Z dS)Er^zw
    Lexer for `Liquid templates
    <http://www.rubydoc.info/github/Shopify/liquid>`_.

    .. versionadded:: 2.0
    Zliquidz*.liquidr�z
(\{%)(\s*)�tag-or-blockz(\{\{)(\s*)([^\s}]+)rr�outputr�z(if|unless|elsif|case)(?=\s+)�	conditionz(when)(\s+)�end-of-block�
whitespacez(else)(\s*)(%\})r�z!(capture)(\s+)([^\s%]+)(\s*)(%\})r�z(comment)(\s*)(%\})rz(raw)(\s*)(%\})�rawz(end(case|unless|if))(\s*)(%\})Nz(end([^\s%]+))(\s*)(%\})z"(cycle)(\s+)(?:([^\s:]*)(:))?(\s*)�variable-tag-markupz([^\s%]+)(\s*)�
tag-markuprz\|�filters)r�r�z([^\s|:]+)(:?)(\s*)�
filter-markup�
end-of-tag�default-param-markupz/([^\s=!><]+)(\s*)([=!><]=?)(\s*)(\S+)(\s*)(%\})z\b!z\bnot\bz*([\w.\'"]+)(\s+)(contains)(\s+)([\w.\'"]+)�end-at-whitespacez(\s*)((=|!|>|<)=?)(\s*)z(\s*)(\bcontains\b)(\s*)z%\}r�z([^\s=:]+)(\s*)(=|:)z(\{\{)(\s*)([^\s}])(\s*)(\}\})r	�number�keyword�,�param-markupr��variable-param-markupz\b(false|true)\br�z(?<=\w)\.(?=\w)z'[^']*'z"[^"]*"z\d+\.\d+r
z[ \t]+z (\{%)(\s*)(endcomment)(\s*)(%\})z(\{%)(\s*)(endraw)(\s*)(%\}))r�rrr%r&rz
generic-value�operatorr'r r)r-r(r.r$r#r+r�r	r*rr!rr")!r�r�r�r�r�r�r�rrrrrrrZReservedrrr�rr�rZWordr�r�r�rr�r�rZFloatZIntegerrrxrhrhrhrir^lsX��

��������
���"���	�
��
��������������������������������c@s�eZdZdZdZdgZdgZejej	BZ
dZdZdedZ
ee
Zd	efd
ejdfdefd
eejeeeejeejeeeej�fdeejeeeejeejeeeej�fdeeejeeeej�dfdeejee�dfdefgdeeeeej�fdeeeeeeej�fdejfdefdejfeejfdeejfdefdejfdejfdefdefgdefdeeej�d fed!�gdefd"eeej�d fed!�d#e fgd$�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
    ZTwigZtwigzapplication/x-twigz[\\\w-]|[^\x00-\x7f]z(?:[\\_a-z]|[^\x00-\x7f])z(?:z)*r�r�r�z\{\#.*?\#\}r�zL(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})z(\{%%)(-?\s*)(filter)(\s+)(%s)r|r�r�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]+r�r�z4([{}()\[\]+\-*/,:~%]|\.\.|\?|:|\*\*|\/\/|!=|[><=]=?)r�r�r�r�r�r�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 rrtrrrrr�rr�r�r�rrr�r�rrrxrhrhrhrir_:s�	
���������������cs6eZdZdZdZdgZdgZdgZ�fdd�Z�Z	S)r`zw
    Subclass of the `TwigLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    z	HTML+Twigz	html+twigz*.twigztext/html+twigcstt|�jttf|�dSr�)r�r`rerr_r�r�rhrire�szTwigHtmlLexer.__init__rrhrhr�rir`�sc@s�eZdZdZdZdgZdefdeej	e
�dfdeeej
ee
ee
�dfd	eeej
ee
�fd
eeej
ee�dfdeeej
e�fgde
fd
ej	dfdejfdejfdejfdefdejfdejfdeee
ee
ee
ee
�fg	dedfdedfdedfgd�ZdS)raad
    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
    ZAngular2Zng2z	[^{([*#]+r�ngExpressionz&([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)r�z([([]+)([\w:.-]+)([\])]+)(\s*)z([*#])([\w:.-]+)(\s*)(=)(\s*)z([*#])([\w:.-]+)(\s*)z\s+(\|\s+)?rr�z:?(true|false)r�r�r�z[a-zA-Z][\w-]*(\(.*\))?z\.[\w-]+(\(.*\))?z-(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)r�r�r�)r�r0r�N)r�r�r�r�r�r�r rrrtrrrr�rrZBooleanr�r�rr�rxrhrhrhrira�sN�����
�����cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)rbz{
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML + Angular2zhtml+ng2z*.ng2cstt|�jttf|�dSr�)r�rbrerrar�r�rhrire�szAngular2HtmlLexer.__init__)	r�r�r�r�r�r�r�rer�rhrhr�rirb�s
)tr�r�Zpygments.lexers.htmlrrZpygments.lexers.javascriptrrZpygments.lexers.cssrZpygments.lexers.phprZpygments.lexers.pythonrZpygments.lexers.perlr	Zpygments.lexers.jvmr
rZpygments.lexers.datarZpygments.lexerr
rrrrrrrrZpygments.tokenrrrrrrrrrrr r!Z
pygments.utilr"r#�__all__r(r-rRrSrTr2r<r=r>r@r?rArBrCrDrErFr�rHrIrJrKr9r�r8r7r;r:r)r*r+r,r$r%r&r'r.r/r0r1r3r5r4r6r�rGrLrMrNrOrrPrQrUrrVrWrXrYrZr[r\r]r^r_r`rarbrhrhrhri�<module>s
,8�_8RS09D
,#@50.LOS@