Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/__pycache__/templates.cpython-37.pyc

B

ʽ�\��?@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-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@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�J/opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/templates.pyreCszErbLexer.__init__ccs.|j�|�}|��d}}�y�x�|dkrR|��}|t|fV|t|�7}d}q$|dk�r�|��}|dkr�|t|fV|d7}d}�q|dkr�|tj|fV|��}|dt|fV|dt|�7}d}n�|dk�r<|tj|fV|t|�7}|��}d}x,|j�	|�D]\}}	}
|||	|
fV�q
W|t|�7}d}n�|dk�rd|t
|fV|t|�7}d}n`|tj|dfVd}x8|j�	|dd	��D] \}}	}
|d||	|
fV�q�W|t|�7}d}q$|dkr$|��}|dk�r�|t|fVn|tj|fV|t|�7}d}q$WWntk
�r(d	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<%-)z%>z-%>N)�	_block_re�split�reverse�popr �lenr�Preprocrd�get_tokens_unprocessedr�
IndexError)rf�text�tokens�state�idx�val�tag�dataZr_idxZr_tokenZr_valuerhrhrirsHsh



zErbLexer.get_tokens_unprocessedcCsd|krd|krdSdS)Nz<%z%>g�������?rh)rurhrhri�analyse_text�szErbLexer.analyse_textN)�__name__�
__module__�__qualname__�__doc__�name�aliases�	mimetypes�re�compile�Mrmrersr|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�smartyz*.tplzapplication/x-smartyz[^{]+z(\{)(\*.*?\*)(\})z(\{php\})(.*?)(\{/php\})T)Zstartinlinez(\{)(/?[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�cCsXd}t�d|�r|d7}t�d|�r,|d7}t�d|�r@|d7}t�d|�rT|d7}|S)Ngz\{if\s+.*?\}.*?\{/if\}g333333�?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}g{�G�z�?)r��search)ru�rvrhrhrir|�szSmartyLexer.analyse_textN) r}r~rr�r�r��	filenamesr�r��	MULTILINE�DOTALL�flagsr rrrrrrr�Functionr�Variablerr�Constantrr�Double�Single�	Attributervr|rhrhrhrir-�s8

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.
    ZVelocityZvelocityz*.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'(\\\\|\\'|[^'])*'z0[xX][0-9a-fA-F]+[Ll]?z
\b[0-9]+\bz(true|false|null)\bz\)z\{)r�r�r�r�r�cCsXd}t�d|�r|d7}t�d|�r,|d7}t�d|�r@|d7}t�d|�rT|d7}|S)	Ngz #\{?macro\}?\(.*?\).*?#\{?end\}?g�?z#\{?if\}?\(.+?\).*?#\{?end\}?g333333�?z"#\{?foreach\}?\(.+?\).*?#\{?end\}?z4\$\{?[a-zA-Z_]\w*(\([^)]*\))?(\.\w+(\([^)]*\))?)*\}?g{�G�z�?)r�r�)rur�rhrhrir|
szVelocityLexer.analyse_textN) r}r~rr�r�r�r�r�r�r�r��
identifierr rrrrrr�rr�rrrrrr�r�rrr�rvr|rhrhrhrirR�s\




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

    z
HTML+Velocityz
html+velocityz*.htmlz*.fhtmlztext/html+velocitycstt|�jttf|�dS)N)�superrSrerrR)rfrg)�	__class__rhrire'szVelocityHtmlLexer.__init__)
r}r~rr�r�r��alias_filenamesr�re�
__classcell__rhrh)r�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+velocityz*.xmlz*.vmzapplication/xml+velocitycstt|�jttf|�dS)N)r�rTrerrR)rfrg)r�rhrire8szVelocityXmlLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�������?)rRr|r#)rur�rhrhrir|<szVelocityXmlLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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-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�cCsPd}t�d|�dk	r|d7}t�d|�dk	r4|d7}t�d|�dk	rL|d7}|S)Ngz\{%\s*(block|extends)g�������?z\{%\s*if\s*.*?%\}g�������?z\{\{.*?\}\})r�r�)rur�rhrhrir|�szDjangoLexer.analyse_textN)r}r~rr�r�r�r�r�r��Sr�r rrrrrrrr�r�Pseudo�Builtinr�rr�r�rrrrvr|rhrhrhrir2CsZ
c@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�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~rr�r�r�r�r�rrr�Tagr�rrrrr rrvrhrhrhrir<�s0
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|�dS)N)r�r=rerr<)rfrg)r�rhrire�szMyghtyHtmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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|�dS)N)r�r>rerr<)rfrg)r�rhrire�szMyghtyXmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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|�dS)N)r�r@rerr<)rfrg)r�rhrire�szMyghtyJavascriptLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�rir@�scs0eZdZdZdZdgZdgZ�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|�dS)N)r�r?rerr<)rfrg)r�rhrireszMyghtyCssLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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�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
                 )cCs6d}t�d|�dk	rd}nt�d|tj�dk	r2d}|S)Ngz</%(class|doc|init)%>g�?z<&.+&>g)\��(�?)r�r�r�)ru�resultrhrhrir|<szMasonLexer.analyse_textN)r}r~rr�r�r�r�r�rrrr�r�	Multiliner�rrr	r rrrvr|rhrhrhrirAs6
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.:]+)rzz(</%)([\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�rz�attrN)r}r~rr�r�r�r�r�rrrrrrr rrrr�rrr�rrvrhrhrhrirBEsB

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|�dS)N)r�rCrerrB)rfrg)r�rhrire�szMakoHtmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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|�dS)N)r�rDrerrB)rfrg)r�rhrire�szMakoXmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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|�dS)N)r�rErerrB)rfrg)r�rhrire�szMakoJavascriptLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�rirE�scs0eZdZdZdZdgZdgZ�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|�dS)N)r�rFrerrB)rfrg)r�rhrire�szMakoCssLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�rirF�s
c@seZdZdZdd�ZdS)�CheetahPythonLexerzI
    Lexer for handling Cheetah's special $ tokens in Python syntax.
    ccsNtf|j�}x<|�|�D].\}}}|tjkr:|dkr:tj}|||fVqWdS)N�$)rrgrsr!rrrr)rfruZpylexer�pos�type_�valuerhrhrirs�s
z)CheetahPythonLexer.get_tokens_unprocessedN)r}r~rr�rsrhrhrhrir��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
                )
            z\s+N)r}r~rr�r�r�r�r�rrrrrr�r rrvrhrhrhrirH�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|�dS)N)r�rIrerrH)rfrg)r�rhrireszCheetahHtmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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|�dS)N)r�rJrerrH)rfrg)r�rhrire#szCheetahXmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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|�dS)N)r�rKrerrH)rfrg)r�rhrire8szCheetahJavascriptLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�rirK(sc
@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\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~rr�r�r�r�r rrrrrrrrrrr�rvrhrhrhrir9=s&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:.]+rzr�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�rzr�zattr-dstringzattr-sstringr�r�N)r}r~rr�r�r�r�r rrrrrrrr�rrr�rr�rvrhrhrhrir�`sF






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+kidz*.htmlz*.htmz*.xhtmlztext/html+genshicstt|�jttf|�dS)N)r�r8rerr�)rfrg)r�rhrire�szHtmlGenshiLexer.__init__cCsFd}t�d|�dk	r|d7}t�d|�dk	r4|d7}|t�|�dS)Ngz	\$\{.*?\}g�������?zpy:(.*?)=["\']g{�G�z�?)r�r�rr|)rur�rhrhrir|�szHtmlGenshiLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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*.kidz*.xmlzapplication/x-genshizapplication/x-kidcstt|�jttf|�dS)N)r�r7rerr�)rfrg)r�rhrire�szGenshiLexer.__init__cCsFd}t�d|�dk	r|d7}t�d|�dk	r4|d7}|t�|�dS)Ngz	\$\{.*?\}g�������?zpy:(.*?)=["\']g{�G�z�?)r�r�rr|)rur�rhrhrir|�szGenshiLexer.analyse_text)r}r~rr�r�r�r�r�r�rer|r�rhrh)r�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+genshiz*.jszapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshicstt|�jttf|�dS)N)r�r;rerr9)rfrg)r�rhrire�szJavascriptGenshiLexer.__init__cCst�|�dS)Ng�������?)r7r|)rurhrhrir|�sz"JavascriptGenshiLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+genshiz*.cssztext/css+genshicstt|�jttf|�dS)N)r�r:rerr9)rfrg)r�rhrire�szCssGenshiLexer.__init__cCst�|�dS)Ng�������?)r7r|)rurhrhrir|�szCssGenshiLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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*.rhtmlz*.htmlz*.htmz*.xhtmlztext/html+rubycstt|�jttf|�dS)N)r�r)rerr()rfrg)r�rhrireszRhtmlLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�?)r(r|r")rur�rhrhrir|
szRhtmlLexer.analyse_text)r}r~rr�r�r�r�r�r�rer|r�rhrh)r�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+rubyz*.xmlzapplication/xml+rubycstt|�jttf|�dS)N)r�r*rerr()rfrg)r�rhrireszXmlErbLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�������?)r(r|r#)rur�rhrhrir| szXmlErbLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+rubyz*.cssz
text/css+rubycstt|�jttf|�dS)N)r�r+rerr()rfrg)r�rhrire1szCssErbLexer.__init__cCst�|�dS)Ng�������?)r(r|)rurhrhrir|4szCssErbLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+rubyz*.jszapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubycstt|�jttf|�dS)N)r�r,rerr()rfrg)r�rhrireEszJavascriptErbLexer.__init__cCst�|�dS)Ng�������?)r(r|)rurhrhrir|IszJavascriptErbLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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*.phtmlz*.phpz*.htmlz*.htmz*.xhtmlz
*.php[345]zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5cstt|�jttf|�dS)N)r�r$rerr)rfrg)r�rhrire]szHtmlPhpLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�?)rr|r")rur�rhrhrir|`szHtmlPhpLexer.analyse_text)r}r~rr�r�r�r�r�r�rer|r�rhrh)r�rir$MscsBeZdZdZdZdgZdddgZdgZ�fdd	�Zd
d�Z	�Z
S)r%zT
    Subclass of `PhpLexer` that highlights unhandled data with the `XmlLexer`.
    zXML+PHPzxml+phpz*.xmlz*.phpz
*.php[345]zapplication/xml+phpcstt|�jttf|�dS)N)r�r%rerr)rfrg)r�rhrireqszXmlPhpLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�������?)rr|r#)rur�rhrhrir|tszXmlPhpLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�rir%gs
cs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
r&zU
    Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
    zCSS+PHPzcss+phpz*.cssztext/css+phpcstt|�jttf|�dS)N)r�r&rerr)rfrg)r�rhrire�szCssPhpLexer.__init__cCst�|�dS)Ng�������?)rr|)rurhrhrir|�szCssPhpLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�rir&{scsDeZdZdZdZddgZdgZdddgZ�fd	d
�Zdd�Z	�Z
S)
r'z`
    Subclass of `PhpLexer` which highlights unmatched data with the
    `JavascriptLexer`.
    zJavaScript+PHPzjs+phpzjavascript+phpz*.jszapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpcstt|�jttf|�dS)N)r�r'rerr)rfrg)r�rhrire�szJavascriptPhpLexer.__init__cCs
t�|�S)N)rr|)rurhrhrir|�szJavascriptPhpLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+smartyz*.htmlz*.htmz*.xhtmlz*.tplztext/html+smartycstt|�jttf|�dS)N)r�r.rerr-)rfrg)r�rhrire�szHtmlSmartyLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�?)r-r|r")rur�rhrhrir|�szHtmlSmartyLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+smartyz*.xmlz*.tplzapplication/xml+smartycstt|�jttf|�dS)N)r�r/rerr-)rfrg)r�rhrire�szXmlSmartyLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�������?)r-r|r#)rur�rhrhrir|�szXmlSmartyLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+smartyz*.cssz*.tplztext/css+smartycstt|�jttf|�dS)N)r�r0rerr-)rfrg)r�rhrire�szCssSmartyLexer.__init__cCst�|�dS)Ng�������?)r-r|)rurhrhrir|�szCssSmartyLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+smartyz*.jsz*.tplzapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartycstt|�jttf|�dS)N)r�r1rerr-)rfrg)r�rhrire�szJavascriptSmartyLexer.__init__cCst�|�dS)Ng�������?)r-r|)rurhrhrir|�sz"JavascriptSmartyLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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
htmldjangoz*.htmlz*.htmz*.xhtmlztext/html+djangoztext/html+jinjacstt|�jttf|�dS)N)r�r3rerr2)rfrg)r�rhrireszHtmlDjangoLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�?)r2r|r")rur�rhrhrir|szHtmlDjangoLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+jinjaz*.xmlzapplication/xml+djangozapplication/xml+jinjacstt|�jttf|�dS)N)r�r5rerr2)rfrg)r�rhrireszXmlDjangoLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�������?)r2r|r#)rur�rhrhrir|szXmlDjangoLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+jinjaz*.cssztext/css+djangoztext/css+jinjacstt|�jttf|�dS)N)r�r4rerr2)rfrg)r�rhrire+szCssDjangoLexer.__init__cCst�|�dS)Ng�������?)r2r|)rurhrhrir|.szCssDjangoLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+jinjaz*.jszapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjacstt|�jttf|�dS)N)r�r6rerr2)rfrg)r�rhrireCszJavascriptDjangoLexer.__init__cCst�|�dS)Ng�������?)r2r|)rurhrhrir|Gsz"JavascriptDjangoLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�rir62sc@sFeZdZdZdedfdefdefdefgdedfd	ee�fgd
�ZdS)�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~rr�rr rr
rvrhrhrhrir�Ksr�cs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
rGzA
    Lexer for Java Server Pages.

    .. versionadded:: 0.7
    zJava Server PageZjspz*.jspzapplication/x-jspcstt|�jttf|�dS)N)r�rGrerr�)rfrg)r�rhrireoszJspLexer.__init__cCs:t�|�d}t|�r|d7}d|kr6d|kr6|d7}|S)Ng{�G�z�?g�������?z<%z%>g�������?)r
r|r#)rur�rhrhrir|rszJspLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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)%)\})NzG(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?(.*?)((?(4)%)\})z!(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})z(\$)(else|rof|fi)z%(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})�#z[^\]#]z#pushz\]#z#popz[\]#])r�r�)r}r~rr�r�r�r�r�r�r�r�r rr�rrrr�rrrrvrhrhrhrirL{s8


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

    .. versionadded:: 1.1
    zHTML+Evoquezhtml+evoquez*.htmlztext/html+evoquecstt|�jttf|�dS)N)r�rMrerrL)rfrg)r�rhrire�szEvoqueHtmlLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�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+evoquez*.xmlzapplication/xml+evoquecstt|�jttf|�dS)N)r�rNrerrL)rfrg)r�rhrire�szEvoqueXmlLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�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��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~rr�r�r�r�r�r��
IGNORECASEr�rr�r�rrr�rrr�rrr�rrr�ZInterprvrhrhrhrirO�sB
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
ColdfusionZcfz[^<]+�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~rr�r�r�r�r�r rrr�rr�rrrOrrvrhrhrhrir�s2




r�cs8eZdZdZdZdgZddgZdgZ�fdd�Z�Z	S)	rPz#
    Coldfusion markup in html
    zColdfusion HTMLZcfmz*.cfmz*.cfmlzapplication/x-coldfusioncstt|�jttf|�dS)N)r�rPrerr�)rfrg)r�rhrire9szColdfusionHtmlLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�rirP0scs4eZdZdZdZdgZdgZgZ�fdd�Z�Z	S)rQzH
    Coldfusion markup/script components

    .. versionadded:: 2.0
    zColdfusion CFCZcfcz*.cfccstt|�jttf|�dS)N)r�rQrerPrO)rfrg)r�rhrireIszColdfusionCFCLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�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|�dS)N)r�rUrerr�)rfrg)r�rhrireYszSspLexer.__init__cCsDd}t�d|�r|d7}t|�r(|d7}d|kr@d|kr@|d7}|S)Ngzval \w+\s*:g333333�?g�������?z<%z%>g�������?)r�r�r#)rur�rhrhrir|\szSspLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�rirUNsc@s@eZdZdZdedfdefdefgdedfdee�fgd	�Zd
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~rr�rr rrrvrhrhrhrir�gsr�cs>eZdZdZdZdgZdgZdgZ�fdd�Zdd	�Z	�Z
S)
rVzW
    Lexer for `Tea Templates <http://teatrove.org/>`_.

    .. versionadded:: 1.5
    ZTeaZteaz*.teaz
text/x-teacstt|�jttf|�dS)N)r�rVrerr�)rfrg)r�rhrire�szTeaTemplateLexer.__init__cCs:t�|�d}t|�r|d7}d|kr6d|kr6|d7}|S)Ng{�G�z�?g�������?z<%z%>g�������?)rr|r#)rur�rhrhrir|�szTeaTemplateLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+lassoz*.htmlz*.htmz*.xhtmlz*.lassoz*.lasso[89]z*.inclz*.incz*.lasztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]cstt|�jttf|�dS)N)r�rWrerr)rfrg)r�rhrire�szLassoHtmlLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�?)rr|r")rur�rhrhrir|�szLassoHtmlLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+lassoz*.xmlz*.lassoz*.lasso[89]z*.inclz*.incz*.laszapplication/xml+lassocstt|�jttf|�dS)N)r�rXrerr)rfrg)r�rhrire�szLassoXmlLexer.__init__cCs"t�|�d}t|�r|d7}|S)Ng{�G�z�?g�������?)rr|r#)rur�rhrhrir|�szLassoXmlLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+lassoz*.cssztext/css+lassocs"d|d<tt|�jttf|�dS)NT�requiredelimiters)r�rYrerr)rfrg)r�rhrire�szLassoCssLexer.__init__cCs6t�|�d}t�d|�r"|d7}d|kr2|d7}|S)Ng�������?z\w+:.+?;g�������?zpadding:)rr|r�r�)rur�rhrhrir|�szLassoCssLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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+lassoz*.jszapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassocs"d|d<tt|�jttf|�dS)NTr�)r�rZrerr)rfrg)r�rhrire�szLassoJavascriptLexer.__init__cCst�|�d}|S)Ng�������?)rr|)rur�rhrhrir|�sz!LassoJavascriptLexer.analyse_text)r}r~rr�r�r�r�r�rer|r�rhrh)r�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
handlebarsz[^{]+z\{\{!.*\}\}z
(\{\{\{)(\s*)rzz(\{\{)(\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*)(\()zdynamic-partial�genericz\)z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)r�)rwz[\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�rzzdynamic-partialr�r�N)r}r~rr�r�r�r rr�Specialrrrrrr�r�rr�rrrrrr�r�rrvrhrhrhrir[�sH



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|�dS)N)r�r\rerr[)rfrg)r�rhrireUszHandlebarsHtmlLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�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|�dS)N)r�r]rerr2)rfrg)r�rhrirehszYamlJinjaLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�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*.liquidz[^{]+z
(\{%)(\s*)ztag-or-blockz(\{\{)(\s*)([^\s}]+)r�)rw�outputz\{z(if|unless|elsif|case)(?=\s+)�	conditionz(when)(\s+)zend-of-block�
whitespacez(else)(\s*)(%\})z#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*)zvariable-tag-markupz([^\s%]+)(\s*)z
tag-markupz\}\}z\|�filters)z#popz#popz([^\s|:]+)(:?)(\s*)z
filter-markupz
end-of-tagzdefault-param-markupz/([^\s=!><]+)(\s*)([=!><]=?)(\s*)(\S+)(\s*)(%\})z\b!z\bnot\bz*([\w.\'"]+)(\s+)(contains)(\s+)([\w.\'"]+)zend-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�zvariable-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-blockzend-at-whitespacezparam-markupzdefault-param-markupzvariable-param-markupz
tag-markupzvariable-tag-markupr�r�r�r�r�r�r�r�)!r}r~rr�r�r�r�rrrrrrrZReservedrrr�rr�r�Wordr�r�r�rr�r�rZFloatZIntegerrrvrhrhrhrir^ls�








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)*z[^{]+z\{\{r�z\{\#.*?\#\}zB(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})zL(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})z(\{%%)(-?\s*)(filter)(\s+)(%s)rzz(\{%)(-?\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�rzN)"r}r~rr�r�r�r�r�r�r�r�Z_ident_charZ_ident_beginZ
_ident_endZ_ident_innerr rrrrrrrr�rr�r�r�rrr�r�rrrvrhrhrhrir_:sb
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|�dS)N)r�r`rerr_)rfrg)r�rhrire�szTwigHtmlLexer.__init__)
r}r~rr�r�r�r�r�rer�rhrh)r�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	[^{([*#]+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~rr�r�r�r rrrrrrrr�rrZBooleanr�r�rr�rvrhrhrhrira�s8
cs0eZdZdZdZdgZdgZ�fdd�Z�ZS)rbz{
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML + Angular2zhtml+ng2z*.ng2cstt|�jttf|�dS)N)r�rbrerra)rfrg)r�rhrire�szAngular2HtmlLexer.__init__)	r}r~rr�r�r�r�rer�rhrh)r�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�rPrQrUr�rVrWrXrYrZr[r\r]r^r_r`rarbrhrhrhri�<module>
s�,8_8RS09D
,#@50.LOS@