o
    Zh                    @   sT  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 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/m0Z0 g dZ1G dd deZ2G dd deZ3G dd deZ4G dd deZ5G dd deZ6G dd deZ7G dd deZ8G dd deZ9G d d! d!eZ:G d"d# d#eZ;G d$d% d%eZ<G d&d' d'eZ=G d(d) d)eZ>G d*d+ d+eZ?G d,d- d-eZ@G d.d/ d/eZAG d0d1 d1eZBG d2d3 d3eZCG d4d5 d5eZDG d6d7 d7eZEG d8d9 d9eZFG d:d; d;eZGG d<d= d=eZHG d>d? d?eZIG d@dA dAeZJG dBdC dCeZKG dDdE dEeZLG dFdG dGeZMG dHdI dIeZNG dJdK dKeZOG dLdM dMeZPG dNdO dOeZQG dPdQ dQeZRG dRdS dSeZSG dTdU dUeZTG dVdW dWeZUG dXdY dYeZVG dZd[ d[eZWG d\d] d]eZXG d^d_ d_eZYG d`da daeZZG dbdc dceZ[G ddde deeZ\G dfdg dgeZ]G dhdi dieZ^G djdk dkeZ_G dldm dmeZ`G dndo doeZaG dpdq dqeZbG drds dseZcG dtdu dueZdG dvdw dweZeG dxdy dyeZfG dzd{ d{eZgG d|d} d}eZhG d~d deZiG dd deZjG dd deZkG dd deZlG dd deZmG dd deZnG dd deZoG dd deZpG dd deZqG dd deZrG dd deZsG dd deZtG dd deZuG dd deZvdS )z
    pygments.lexers.templates
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for various template engines' markup.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)	HtmlLexerXmlLexer)JavascriptLexer
LassoLexer)CssLexer)PhpLexer)PythonLexer)	PerlLexer)	JavaLexerTeaLangLexer)	YamlLexer)SqlLexer)	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Angular2HtmlLexerSqlJinjaLexerc                   @   sJ   e Zd ZdZdZdZdgZdgZe	dej
Zdd Zd	d
 Zdd ZdS )r)   z
    Generic ERB (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`.
    ERBzhttps://github.com/ruby/erberbzapplication/x-ruby-templatingz*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)c                 K   s2   ddl m} |di || _tj| fi | d S )Nr   )	RubyLexer )Zpygments.lexers.rubyrg   
ruby_lexerr   __init__)selfoptionsrg   rh   rh   P/var/www/html/lang_env/lib/python3.10/site-packages/pygments/lexers/templates.pyrj   D   s   zErbLexer.__init__c                 c   s   | j |}|  d }}z	 |dkr(| }|t|fV  |t|7 }d}n|dkr| }|dv rA|t|fV  |d7 }d}n|dkrc|tj|fV  | }|d t|fV  |dt| 7 }d}n|dv r|tj|fV  |t|7 }| }d}| j	|D ]\}}	}
|| |	|
fV  q|t|7 }d}nc|d	v r|t
|fV  |t|7 }d}nP|tj|d fV  d}| j	|dd
 D ]\}}	}
|d | |	|
fV  q|t|7 }d}n"|dkr| }|d	vr|t|fV  n|tj|fV  |t|7 }d}q ty   Y d
S w )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   T   )z<%%z%%>   z<%#   )<%z<%=z<%-)%>z-%>N)	_block_resplitreversepopr!   lenr   Preprocri   get_tokens_unprocessedr   
IndexError)rk   texttokensstateidxvaltagdataZr_idxZr_tokenZr_valuerh   rh   rm   ry   I   sn   
7zErbLexer.get_tokens_unprocessedc                 C   s   d| v r
d| v rdS d S d S )Nrq   rr   皙?rh   r{   rh   rh   rm   analyse_text   s   zErbLexer.analyse_textN)__name__
__module____qualname____doc__nameurlaliases	mimetypesrecompileMrs   rj   ry   r   rh   rh   rh   rm   r)   3   s    	Dr)   c                   @   s   e Zd 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 template lexer.

    Just highlights smarty code between the preprocessor directives, other
    data is left untouched by the lexer.
    Smartyzhttps://www.smarty.net/smarty*.tplzapplication/x-smarty[^{]+z(\{)(\*.*?\*)(\})z(\{php\})(.*?)(\{/php\})T)Zstartinlinez(\{)(/?[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   c                 C   sX   d}t d| r|d7 }t d| r|d7 }t d| r |d7 }t d| r*|d7 }|S )N        z\{if\s+.*?\}.*?\{/if\}333333?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}{Gz?r   searchr{   rvrh   rh   rm   r      s   zSmartyLexer.analyse_textN)!r   r   r   r   r   r   r   	filenamesr   r   	MULTILINEDOTALLflagsr!   r   r   rx   r   r   r   Functionr   Variabler   r   Constantr    r   DoubleSingle	Attributer|   r   rh   rh   rh   rm   r.      sL    


r.   c                   @   s  e Zd 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 )+rS   z
    Generic Velocity template lexer.

    Just highlights velocity directives and variable references, other
    data is left untouched by the lexer.
    Velocityzhttps://velocity.apache.org/velocity*.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   z0[xX][0-9a-fA-F]+[Ll]?z
\b[0-9]+\br   \)r   )r   r   r   r   r   c                 C   sd   d}t d| t jr|d7 }t d| t jr|d7 }t d| t jr&|d7 }t d| r0|d7 }|S )	Nr   z #\{?macro\}?\(.*?\).*?#\{?end\}?      ?z#\{?if\}?\(.+?\).*?#\{?end\}?r   z"#\{?foreach\}?\(.+?\).*?#\{?end\}?z6\$!?\{?[a-zA-Z_]\w*(\([^)]*\))?(\.\w+(\([^)]*\))?)*\}?r   r   r   r   r   rh   rh   rm   r     s   zVelocityLexer.analyse_textN)!r   r   r   r   r   r   r   r   r   r   r   r   
identifierr!   r   r   rx   r   r   r   r   r   r   r   r   r   r   r   r    r   r   r|   r   rh   rh   rh   rm   rS      sx    



	4rS   c                       8   e Zd ZdZdZdgZddgZdgZ fddZ  Z	S )	rT   za
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `HtmlLexer`.

    zHTML+Velocityzhtml+velocity*.htmlr   ztext/html+velocityc                       t  jttfi | d S N)superrj   r   rS   rk   rl   	__class__rh   rm   rj   *     zVelocityHtmlLexer.__init__)
r   r   r   r   r   r   alias_filenamesr   rj   __classcell__rh   rh   r   rm   rT     s    rT   c                       @   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 )rU   z`
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `XmlLexer`.

    zXML+Velocityzxml+velocity*.xmlr   zapplication/xml+velocityc                    r   r   )r   rj   r   rS   r   r   rh   rm   rj   :  r   zVelocityXmlLexer.__init__c                 C   "   t | d }t| r|d7 }|S Nr   r   )rS   r   r$   r   rh   rh   rm   r   =     zVelocityXmlLexer.analyse_textr   r   r   r   r   r   r   r   rj   r   r   rh   rh   r   rm   rU   .  s    rU   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 )&r3   a  
    Generic `django <http://www.djangoproject.com/documentation/templates/>`_
    and `jinja <https://jinja.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/Jinjadjangojinjazapplication/x-django-templatingzapplication/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   c                 C   sP   d}t d| d ur|d7 }t d| d ur|d7 }t d| d ur&|d7 }|S )Nr   z\{%\s*(block|extends)r   z\{%\s*if\s*.*?%\}皙?z\{\{.*?\}\}r   r   rh   rh   rm   r     s   zDjangoLexer.analyse_textN)r   r   r   r   r   r   r   r   r   Sr   r!   r   rx   r   r   r   r   r   r   PseudoBuiltinr   r   r   r   r    r   r   r|   r   rh   rh   rh   rm   r3   D  sz    
9r3   c                   @   s   e Zd 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
    Myghtyzhttp://www.myghty.org/myghtyz*.mytautodelegatezapplication/x-myghtyr   r   3(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)z#(?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   r   r   r   r   Tagr   r   r   r   r   r!   r   r|   rh   rh   rh   rm   r=     sL    

	r=   c                       0   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                    r   r   )r   rj   r   r=   r   r   rh   rm   rj     r   zMyghtyHtmlLexer.__init__	r   r   r   r   r   r   r   rj   r   rh   rh   r   rm   r>         r>   c                       r   )r?   zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.6
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtyc                    r   r   )r   rj   r   r=   r   r   rh   rm   rj     r   zMyghtyXmlLexer.__init__r   rh   rh   r   rm   r?     r   r?   c                       4   e Zd ZdZdZddgZg dZ fddZ  ZS )rA   z
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `JavascriptLexer`.

    .. versionadded:: 0.6
    zJavaScript+Myghtyzjavascript+myghtyz	js+myghty)zapplication/x-javascript+myghtyztext/x-javascript+myghtyztext/javascript+mygthyc                    r   r   )r   rj   r   r=   r   r   rh   rm   rj     r   zMyghtyJavascriptLexer.__init__r   rh   rh   r   rm   rA         rA   c                       r   )r@   zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.6
    z
CSS+Myghtyz
css+myghtyztext/css+myghtyc                    r   r   )r   rj   r   r=   r   r   rh   rm   rj     r   zMyghtyCssLexer.__init__r   rh   rh   r   rm   r@     r   r@   c                   @   s  e Zd ZdZdZdZdgZg d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ddd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 )rB   z
    Generic mason templates lexer. Stolen from Myghty lexer. Code that isn't
    Mason markup is HTML.

    .. versionadded:: 1.4
    Masonzhttp://www.masonhq.com/mason)z*.mz*.mhtmlz*.mcz*.miautohandlerdhandlerzapplication/x-masonr   r   z(?s)(<%doc>)(.*?)(</%doc>)r   z%(?s)(<%(\w+)(.*?)(>))(.*?)(</%\2\s*>)Nz(?s)(<&[^|])(.*?)(,.*?)?(&>)r   r   r   r   r   r   c                 C   s8   d}t d| d urd}|S t d| t jd urd}|S )Nr   z</%(class|doc|init)>g      ?z<&.+&>g)\(?r   )r{   resultrh   rh   rm   r   6  s   zMasonLexer.analyse_text)r   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   rm   rB     sP    
	!rB   c                   @   s<  e Zd ZdZdZdZdgZdgZdgZde	e
jejeefde	e
jejeeefd	e	e
jeje
j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 )rC   z
    Generic mako templates lexer. Code that isn't Mako
    markup is yielded as `Token.Other`.

    .. versionadded:: 0.7
    Makozhttp://www.makotemplates.org/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
                )
            r   rq   z'(?<=<%)(include|inherit|namespace|page)z((?:\w+)\s*=)(\s*)(".*?")/?\s*>r   ".*?"'.*?'[^\s>]+)r   r   r   attrN)r   r   r   r   r   r   r   r   r   r   r   r   r   rx   r   r!   r   r   r   r   r   r   r   r   r   r   r|   rh   rh   rh   rm   rC   ?  sd    
"

rC   c                       r   )rD   zw
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.

    .. versionadded:: 0.7
    z	HTML+Makoz	html+makoztext/html+makoc                    r   r   )r   rj   r   rC   r   r   rh   rm   rj     r   zMakoHtmlLexer.__init__r   rh   rh   r   rm   rD     r   rD   c                       r   )rE   zv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.7
    zXML+Makozxml+makozapplication/xml+makoc                    r   r   )r   rj   r   rC   r   r   rh   rm   rj     r   zMakoXmlLexer.__init__r   rh   rh   r   rm   rE     r   rE   c                       r   )rF   z}
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `JavascriptLexer`.

    .. versionadded:: 0.7
    zJavaScript+Makozjavascript+makozjs+mako)zapplication/x-javascript+makoztext/x-javascript+makoztext/javascript+makoc                    r   r   )r   rj   r   rC   r   r   rh   rm   rj     r   zMakoJavascriptLexer.__init__r   rh   rh   r   rm   rF     r   rF   c                       r   )rG   zv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.7
    zCSS+Makozcss+makoztext/css+makoc                    r   r   )r   rj   r   rC   r   r   rh   rm   rj     r   zMakoCssLexer.__init__r   rh   rh   r   rm   rG     r   rG   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   sP    t di | j}||D ]\}}}|tjkr|dkrtj}|||fV  qd S )N$rh   )r   rl   ry   r"   r   r   rx   )rk   r{   Zpylexerpostype_valuerh   rh   rm   ry     s   z)CheetahPythonLexer.get_tokens_unprocessedN)r   r   r   r   ry   rh   rh   rh   rm   r     s    r   c                   @   s   e Zd 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 )rI   z
    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.

    .. _spitfire templates: http://code.google.com/p/spitfire/
    Cheetahzhttp://www.cheetahtemplate.org/cheetah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
                )
            r   N)r   r   r   r   r   r   r   r   r   r   r   rx   r   r   r!   r   r|   rh   rh   rh   rm   rI     sB    rI   c                       s4   e Zd ZdZdZg dZddgZ fddZ  ZS )rJ   z_
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `HtmlLexer`.
    zHTML+Cheetah)zhtml+cheetahzhtml+spitfirehtmlcheetahztext/html+cheetahztext/html+spitfirec                    r   r   )r   rj   r   rI   r   r   rh   rm   rj   	  r   zCheetahHtmlLexer.__init__r   rh   rh   r   rm   rJ         rJ   c                       s4   e Zd ZdZdZddgZddgZ fddZ  ZS )	rK   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                    r   r   )r   rj   r   rI   r   r   rh   rm   rj     r   zCheetahXmlLexer.__init__r   rh   rh   r   rm   rK     r  rK   c                       s4   e Zd ZdZdZg dZg dZ fddZ  ZS )rL   ze
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Cheetah)zjavascript+cheetahz
js+cheetahzjavascript+spitfirezjs+spitfire)z application/x-javascript+cheetahztext/x-javascript+cheetahztext/javascript+cheetahz!application/x-javascript+spitfireztext/x-javascript+spitfireztext/javascript+spitfirec                    r   r   )r   rj   r   rI   r   r   rh   rm   rj   +  r   zCheetahJavascriptLexer.__init__r   rh   rh   r   rm   rL     s    rL   c                
   @   s   e Zd 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 )r:   z8
    A lexer that highlights genshi text templates.
    zGenshi Textzhttp://genshi.edgewall.org/
genshitextzapplication/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   r!   r   r   r   rx   r   r   r   r   r   r   r|   rh   rh   rh   rm   r:   /  s8    	
r:   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[<$]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!   r   r   rx   r   r   r   r   r   r   r   r   r   r|   rh   rh   rh   rm   r
  R  sb    







r
  c                       sB   e Zd ZdZdZddgZg dZdgZ fddZd	d
 Z	  Z
S )r9   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+kidr   *.htm*.xhtmlztext/html+genshic                    r   r   )r   rj   r   r
  r   r   rh   rm   rj     r   zHtmlGenshiLexer.__init__c                 C   F   d}t d| d ur|d7 }t d| d ur|d7 }|t|  d S Nr   z	\$\{.*?\}皙?zpy:(.*?)=["\']r   )r   r   r   r   r   rh   rh   rm   r        zHtmlGenshiLexer.analyse_textr   rh   rh   r   rm   r9     s    r9   c                       sH   e Zd ZdZdZg dZdgZdgZd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 XML templates.
    Genshi)genshikidz
xml+genshizxml+kidz*.kidr   zapplication/x-genshizapplication/x-kidc                    r   r   )r   rj   r   r
  r   r   rh   rm   rj     r   zGenshiLexer.__init__c                 C   r  r  )r   r   r   r   r   rh   rh   rm   r     r  zGenshiLexer.analyse_textr   r   r   r   r   r   r   r   r   rj   r   r   rh   rh   r   rm   r8     s    r8   c                       B   e Zd ZdZdZg dZdgZg d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 Text)zjs+genshitextz	js+genshizjavascript+genshitextzjavascript+genshi*.js)zapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshic                    r   r   )r   rj   r   r:   r   r   rh   rm   rj     r   zJavascriptGenshiLexer.__init__c                 C      t | d S N皙?r8   r   r   rh   rh   rm   r        z"JavascriptGenshiLexer.analyse_textr   rh   rh   r   rm   r<     s    r<   c                       @   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+genshi*.cssztext/css+genshic                    r   r   )r   rj   r   r:   r   r   rh   rm   rj     r   zCssGenshiLexer.__init__c                 C   r  r   r"  r   rh   rh   rm   r     r#  zCssGenshiLexer.analyse_textr   rh   rh   r   rm   r;         r;   c                       sH   e Zd ZdZdZg dZdgZg d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.
    RHTML)rhtmlzhtml+erbz	html+rubyz*.rhtmlr  ztext/html+rubyc                    r   r   )r   rj   r   r)   r   r   rh   rm   rj     r   zRhtmlLexer.__init__c                 C   r   Nr   g      ?)r)   r   r#   r   rh   rh   rm   r     s   zRhtmlLexer.analyse_textr  rh   rh   r   rm   r*     s    r*   c                       r$  )r+   zo
    Subclass of `ErbLexer` which highlights data outside preprocessor
    directives with the `XmlLexer`.
    zXML+Rubyzxml+rubyzxml+erbr   zapplication/xml+rubyc                    r   r   )r   rj   r   r)   r   r   rh   rm   rj   
  r   zXmlErbLexer.__init__c                 C   r   r   )r)   r   r$   r   rh   rh   rm   r     r   zXmlErbLexer.analyse_textr   rh   rh   r   rm   r+     s    r+   c                       r$  )r,   zS
    Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
    zCSS+Rubyzcss+rubyzcss+erbr%  ztext/css+rubyc                    r   r   )r   rj   r   r)   r   r   rh   rm   rj     r   zCssErbLexer.__init__c                 C   r  r   r)   r   r   rh   rh   rm   r   !  r#  zCssErbLexer.analyse_textr   rh   rh   r   rm   r,     r&  r,   c                       r  )
r-   z^
    Subclass of `ErbLexer` which highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Ruby)zjavascript+rubyzjs+rubyzjavascript+erbzjs+erbr  )zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyc                    r   r   )r   rj   r   r)   r   r   rh   rm   rj   2  r   zJavascriptErbLexer.__init__c                 C   r  r   r*  r   rh   rh   rm   r   5  r#  zJavascriptErbLexer.analyse_textr   rh   rh   r   rm   r-   %      r-   c                       sH   e Zd ZdZdZdgZdgZg dZg d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*.phtml)*.phpr   r  r  
*.php[345])zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5c                    r   r   )r   rj   r   r   r   r   rh   rm   rj   I  r   zHtmlPhpLexer.__init__c                 C   r   r)  )r   r   r#   r   rh   rh   rm   r   L  r   zHtmlPhpLexer.analyse_textr  rh   rh   r   rm   r%   9  s    r%   c                       @   e Zd ZdZdZdgZg d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+php)r   r,  r-  zapplication/xml+phpc                    r   r   )r   rj   r   r   r   r   rh   rm   rj   ]  r   zXmlPhpLexer.__init__c                 C   r   r   )r   r   r$   r   rh   rh   rm   r   `  r   zXmlPhpLexer.analyse_textr   rh   rh   r   rm   r&   S  s    r&   c                       >   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+phpr%  ztext/css+phpc                    r   r   )r   rj   r   r   r   r   rh   rm   rj   q  r   zCssPhpLexer.__init__c                 C   r  r   r   r   r   rh   rh   rm   r   t  r#  zCssPhpLexer.analyse_textr   rh   rh   r   rm   r'   g  s    r'   c                       B   e Zd ZdZdZddgZdgZg d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javascript+phpzjs+phpr  )zapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpc                    r   r   )r   rj   r   r   r   r   rh   rm   rj     r   zJavascriptPhpLexer.__init__c                 C   
   t | S r   r0  r   rh   rh   rm   r        
zJavascriptPhpLexer.analyse_textr   rh   rh   r   rm   r(   x  r+  r(   c                       r.  )
r/   z
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Smartyzhtml+smarty)r   r  r  r   ztext/html+smartyc                    r   r   )r   rj   r   r.   r   r   rh   rm   rj     r   zHtmlSmartyLexer.__init__c                 C   r   r)  )r.   r   r#   r   rh   rh   rm   r     r   zHtmlSmartyLexer.analyse_textr   rh   rh   r   rm   r/     s    r/   c                       r   )r0   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Smartyz
xml+smartyr   r   zapplication/xml+smartyc                    r   r   )r   rj   r   r.   r   r   rh   rm   rj     r   zXmlSmartyLexer.__init__c                 C   r   r   )r.   r   r$   r   rh   rh   rm   r     r   zXmlSmartyLexer.analyse_textr   rh   rh   r   rm   r0         r0   c                       r   )r1   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `CssLexer`.
    z
CSS+Smartyz
css+smartyr%  r   ztext/css+smartyc                    r   r   )r   rj   r   r.   r   r   rh   rm   rj     r   zCssSmartyLexer.__init__c                 C   r  r   r.   r   r   rh   rh   rm   r     r#  zCssSmartyLexer.analyse_textr   rh   rh   r   rm   r1     r4  r1   c                       sD   e Zd ZdZdZddgZddgZg dZ fdd	Zd
d Z	  Z
S )r2   zd
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Smartyzjavascript+smartyz	js+smartyr  r   )zapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartyc                    r   r   )r   rj   r   r.   r   r   rh   rm   rj     r   zJavascriptSmartyLexer.__init__c                 C   r  r   r5  r   rh   rh   rm   r     r#  z"JavascriptSmartyLexer.analyse_textr   rh   rh   r   rm   r2     s    r2   c                       sL   e Zd ZdZdZg dZg dZg d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
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Django/Jinja)zhtml+djangoz
html+jinja
htmldjango)z	*.html.j2z*.htm.j2z
*.xhtml.j2z*.html.jinja2z*.htm.jinja2z*.xhtml.jinja2r  ztext/html+djangoztext/html+jinjac                    r   r   )r   rj   r   r3   r   r   rh   rm   rj     r   zHtmlDjangoLexer.__init__c                 C   r   r)  )r3   r   r#   r   rh   rh   rm   r     r   zHtmlDjangoLexer.analyse_textr  rh   rh   r   rm   r4     s    r4   c                       J   e Zd ZdZdZddgZddgZdgZdd	gZ fd
dZ	dd Z
  ZS )r6   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `XmlLexer`.
    zXML+Django/Jinjaz
xml+djangoz	xml+jinjaz*.xml.j2z*.xml.jinja2r   zapplication/xml+djangozapplication/xml+jinjac                    r   r   )r   rj   r   r3   r   r   rh   rm   rj     r   zXmlDjangoLexer.__init__c                 C   r   r   )r3   r   r$   r   rh   rh   rm   r     r   zXmlDjangoLexer.analyse_textr  rh   rh   r   rm   r6         r6   c                       r7  )r5   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `CssLexer`.
    zCSS+Django/Jinjaz
css+djangoz	css+jinjaz*.css.j2z*.css.jinja2r%  ztext/css+djangoztext/css+jinjac                    r   r   )r   rj   r   r3   r   r   rh   rm   rj     r   zCssDjangoLexer.__init__c                 C   r  r   r3   r   r   rh   rh   rm   r     r#  zCssDjangoLexer.analyse_textr  rh   rh   r   rm   r5     r8  r5   c                       sJ   e Zd ZdZdZg dZddgZdgZg dZ fdd	Z	d
d Z
  ZS )r7   zd
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Django/Jinja)zjavascript+djangoz	js+djangozjavascript+jinjazjs+jinjaz*.js.j2z*.js.jinja2r  )zapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjac                    r   r   )r   rj   r   r3   r   r   rh   rm   rj   1  r   zJavascriptDjangoLexer.__init__c                 C   r  r   r9  r   rh   rh   rm   r   4  r#  z"JavascriptDjangoLexer.analyse_textr  rh   rh   r   rm   r7     s    r7   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
    <%\S?seczC</?jsp:(forward|getProperty|include|plugin|setProperty|useBean).*?>[^<]+<rr   r   [\w\W]+?(?=%>|\Z)r   r<  N)	r   r   r   r   r   r!   r   r
   r|   rh   rh   rh   rm   r:  8  s    		

r:  c                       r/  )
rH   zA
    Lexer for Java Server Pages.

    .. versionadded:: 0.7
    zJava Server Pagejspz*.jspzapplication/x-jspc                    r   r   r   rj   r   r:  r   r   rh   rm   rj   \  r   zJspLexer.__init__c                 C   :   t | d }t| r|d7 }d| v rd| v r|d7 }|S Nr   r   rq   rr   r   )r
   r   r$   r   rh   rh   rm   r   _     zJspLexer.analyse_textr   r   r   r   r   r   r   r   rj   r   r   rh   rh   r   rm   rH   Q      rH   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d ZdS )rM   zR
    For files using the Evoque templating system.

    .. versionadded:: 1.1
    Evoqueevoquez*.evoquezapplication/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   rJ  c                 C   s   d| v rdS dS )z.Evoque templates use $evoque, which is unique.z$evoquern   Nrh   r   rh   rh   rm   r     s   zEvoqueLexer.analyse_text)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   rm   rM   h  sR    




'rM   c                       r/  )
rN   zy
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 1.1
    zHTML+Evoquezhtml+evoquer   ztext/html+evoquec                    r   r   )r   rj   r   rM   r   r   rh   rm   rj     r   zEvoqueHtmlLexer.__init__c                 C   r2  r   rM   r   r   rh   rh   rm   r     r3  zEvoqueHtmlLexer.analyse_textrF  rh   rh   r   rm   rN         rN   c                       r/  )
rO   zx
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.

    .. versionadded:: 1.1
    z
XML+Evoquez
xml+evoquer   zapplication/xml+evoquec                    r   r   )r   rj   r   rM   r   r   rh   rm   rj     r   zEvoqueXmlLexer.__init__c                 C   r2  r   rL  r   rh   rh   rm   r     r3  zEvoqueXmlLexer.analyse_textrF  rh   rh   r   rm   rO     rM  rO   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 )rP   z
    Coldfusion statements
    cfstatementcfsz//.*?\nz/\*(?:.|\n)*?\*/z\+\+|--z
[-+*/^&=!]z<=|>=|<|>|==zmod\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[^"#]+rK  r   )r   rP  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   rm   rP     sP    


rP   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
Coldfusioncfr=  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)<[^<>]*rK  r   z--->z([^<-]|<(?!!---)|-(?!-->))+)r   rU  rW  rV  N)r   r   r   r   r   r   r   r   r!   r   r   r   r   r   r   r   rP   r   r|   rh   rh   rh   rm   rS    sD    





rS  c                       r   )	rQ   z#
    Coldfusion markup in html
    zColdfusion HTMLcfmz*.cfmz*.cfmlzapplication/x-coldfusionc                    r   r   )r   rj   r   rS  r   r   rh   rm   rj   .  r   zColdfusionHtmlLexer.__init__
r   r   r   r   r   r   r   r   rj   r   rh   rh   r   rm   rQ   %  s    rQ   c                       s4   e Zd ZdZdZdgZdgZg Z fddZ  Z	S )rR   zH
    Coldfusion markup/script components

    .. versionadded:: 2.0
    zColdfusion CFCcfcz*.cfcc                    r   r   )r   rj   rQ   rP   r   r   rh   rm   rj   =  r   zColdfusionCFCLexer.__init__rY  rh   rh   r   rm   rR   2  s    rR   c                       r/  )
rV   zD
    Lexer for Scalate Server Pages.

    .. versionadded:: 1.4
    zScalate Server Pagesspz*.sspzapplication/x-sspc                    r   r   rB  r   r   rh   rm   rj   L  r   zSspLexer.__init__c                 C   sD   d}t d| r|d7 }t| r|d7 }d| v r d| v r |d7 }|S )Nr   zval \w+\s*:g333333?r  rq   rr   r   )r   r   r$   r   rh   rh   rm   r   O  s   zSspLexer.analyse_textrF  rh   rh   r   rm   rV   A  rG  rV   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
    r;  r<  r=  r>  rr   r   r?  r@  N)	r   r   r   r   r   r!   r   r   r|   rh   rh   rh   rm   r\  Z  s    	

r\  c                       r/  )
rW   zW
    Lexer for `Tea Templates <http://teatrove.org/>`_.

    .. versionadded:: 1.5
    Teateaz*.teaz
text/x-teac                    r   r   )r   rj   r   r\  r   r   rh   rm   rj   {  r   zTeaTemplateLexer.__init__c                 C   rC  rD  )r   r   r$   r   rh   rh   rm   r   ~  rE  zTeaTemplateLexer.analyse_textrF  rh   rh   r   rm   rW   p  rG  rW   c                       sB   e Zd ZdZdZdgZg dZg dZ fddZdd	 Z	  Z
S )
rX   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+lasso)r   r  r  *.lasso*.lasso[89]*.incl*.inc*.las)ztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]c                    r   r   )r   rj   r   r   r   r   rh   rm   rj     r   zLassoHtmlLexer.__init__c                 C   r   r)  )r   r   r#   r   rh   rh   rm   r     r   zLassoHtmlLexer.analyse_textr   rh   rh   r   rm   rX     s    	rX   c                       r.  )
rY   zz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.

    .. versionadded:: 1.6
    z	XML+Lassoz	xml+lasso)r   r_  r`  ra  rb  rc  zapplication/xml+lassoc                    r   r   )r   rj   r   r   r   r   rh   rm   rj     r   zLassoXmlLexer.__init__c                 C   r   r   )r   r   r$   r   rh   rh   rm   r     r   zLassoXmlLexer.analyse_textr   rh   rh   r   rm   rY     s    rY   c                       r/  )
rZ   zz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.

    .. versionadded:: 1.6
    z	CSS+Lassoz	css+lassor%  ztext/css+lassoc                    "   d|d< t  jttfi | d S NTZrequiredelimiters)r   rj   r   r   r   r   rh   rm   rj        zLassoCssLexer.__init__c                 C   s6   t | d }td| r|d7 }d| v r|d7 }|S )Nr!  z
\w+:[^;]+;r   zpadding:)r   r   r   r   r   rh   rh   rm   r     s   zLassoCssLexer.analyse_textr   rh   rh   r   rm   rZ     s    rZ   c                       r1  )r[   z
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.

    .. versionadded:: 1.6
    zJavaScript+Lassozjavascript+lassozjs+lassor  )zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassoc                    rd  re  )r   rj   r   r   r   r   rh   rm   rj     rf  zLassoJavascriptLexer.__init__c                 C   s   t | d }|S r   )r   r   r   rh   rh   rm   r     s   z!LassoJavascriptLexer.analyse_textr   rh   rh   r   rm   r[     s    r[   c                   @   sJ  e Zd 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jejdfd
e	ejedfgdefdej
dfde	eejd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 template lexer.

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

    .. versionadded:: 2.0
    
Handlebarszhttps://handlebarsjs.com/
handlebarsr   z\{\{!.*\}\}z(\{\{\{)(\s*)r   z(\{\{)([#~/]+)([^\s}]*)(\{\{)(\s*)r   z\}\}\}r   z
(~?)(\}\})z([^\s}]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()dynamic-partialgenericr   z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)r   r}   z[\w-]+z[()/@a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+r   r   r   )r   r   rj  r   rk  N)r   r   r   r   r   r   r   r!   r   r   Specialr   rx   r    r   r   r   r   r   r   r   r   r   r   r   r   r   r|   rh   rh   rh   rm   r\     s^    	


r\   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                    r   r   )r   rj   r   r\   r   r   rh   rm   rj   G  r   zHandlebarsHtmlLexer.__init__rY  rh   rh   r   rm   r]   :  s    r]   c                       s<   e Zd ZdZdZg dZg d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+Jinja)z
yaml+jinjasaltsls)z*.slsz	*.yaml.j2z*.yml.j2z*.yaml.jinja2z*.yml.jinja2ztext/x-yaml+jinjaz
text/x-slsc                    r   r   )r   rj   r   r3   r   r   rh   rm   rj   Z  r   zYamlJinjaLexer.__init__rY  rh   rh   r   rm   r^   K  s    	r^   c                   @   s  e Zd ZdZdZdZdgZdgZi ddefde	e
edfd	e	e
eeed
ddfdefgd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
dedd"e
dfd#e
d$fgd$edd"e
d%fd&e	eje
ed'fgd'd#e
dfed(ed)gd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d.ed
ed/gd0d1e	eededfd2e	eejedfgd(d"e
dfgdd3e
d%fgd/d4edfgd5edd6e	ejeefd7e	e
eeeddee
fed8ed9ed:d;e
fgd)ed5d<efgd=ed5edd<efgd!d3e
d%fed)gdd3e
d%fed=gd:d>ejfgd?ejfd@e
fgdAejfdBejfgdCejfdDejfged:ed8ed9edgdEefgdFe	e
eejee
d%fd<e fgdefdGe	e
eejee
dfdefgdHZ!dS )Ir_   z@
    Lexer for Liquid templates.

    .. versionadded:: 2.0
    liquidz.https://www.rubydoc.info/github/Shopify/liquidz*.liquidr   r   z
(\{%)(\s*)ztag-or-blockz(\{\{)(\s*)([^\s}]+)rk  rl  outputr   z(if|unless|elsif|case)(?=\s+)	conditionz(when)(\s+)zend-of-block
whitespacez(else)(\s*)(%\})r   z!(capture)(\s+)([^\s%]+)(\s*)(%\})r   z(comment)(\s*)(%\})rJ  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-markup\}\}z\|filters)r   r   z([^\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generic-valuezend-at-whitespaceoperatorz(\s*)((=|!|>|<)=?)(\s*)z(\s*)(\bcontains\b)(\s*)z%\}r   zparam-markupz([^\s=:]+)(\s*)(=|:)z(\{\{)(\s*)([^\s}])(\s*)(\}\})rP  numberkeyword,r   zvariable-param-markupz\b(false|true)\br   z(?<=\w)\.(?=\w)z'[^']*'z"[^"]*"z\d+\.\d+rQ  z[ \t]+z (\{%)(\s*)(endcomment)(\s*)(%\})z(\{%)(\s*)(endraw)(\s*)(%\}))r   rP  rx  rk  rs  rJ  rt  )"r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Reservedr   r   r   r   r   r   Wordr   r   r   r   r   r   r    FloatIntegerr   r|   rh   rh   rh   rm   r_   ^  s   

-4<BTY`dhm}   	       r_   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 template lexer.

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

    .. versionadded:: 2.0
    Twigtwigzapplication/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!   r   rx   r   r   r   r   r   r   r   r   r   r    r   r   r   r   r   r|   rh   rh   rh   rm   r`   ,  s    	

r`   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 )ra   zw
    Subclass of the `TwigLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    z	HTML+Twigz	html+twigz*.twigztext/html+twigc                    r   r   )r   rj   r   r`   r   r   rh   rm   rj     r   zTwigHtmlLexer.__init__rY  rh   rh   r   rm   ra     s    ra   c                   @   s   e Zd 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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 )rb   a  
    Generic angular2 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
    Angular2z(https://angular.io/guide/template-syntaxng2z	[^{([*#]+ri  ngExpressionz&([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)r   z([([]+)([\w:.-]+)([\])]+)(\s*)z([*#])([\w:.-]+)(\s*)(=)(\s*)z([*#])([\w:.-]+)(\s*)z\s+(\|\s+)?ru  r   z:?(true|false)r   r   r   z[a-zA-Z][\w-]*(\(.*\))?z\.[\w-]+(\(.*\))?z-(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)r   r   r   )r   r  r   N)r   r   r   r   r   r   r   r!   r   r   rx   r   r   r   r   r   r   Booleanr   r   r    r   r|   rh   rh   rh   rm   rb     sP    


rb   c                       r   )rc   z{
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML + Angular2zhtml+ng2z*.ng2c                    r   r   )r   rj   r   rb   r   r   rh   rm   rj     r   zAngular2HtmlLexer.__init__)	r   r   r   r   r   r   r   rj   r   rh   rh   r   rm   rc     r   rc   c                       s:   e Zd ZdZdZdgZg dZ fddZdd Z  Z	S )	rd   z:
    Templated SQL lexer.

    .. versionadded:: 2.13
    z	SQL+Jinjaz	sql+jinja)z*.sqlz*.sql.j2z*.sql.jinja2c                    r   r   )r   rj   r   r3   r   r   rh   rm   rj     r   zSqlJinjaLexer.__init__c                 C   sD   d}t d| r|d7 }t d| r|d7 }t d| r |d7 }|S )Nr   z\{\{\s*ref\(.*\)\s*\}\}r   z\{\{\s*source\(.*\)\s*\}\}r   z\{%-?\s*macro \w+\(.*\)\s*-?%\}r   r   r   rh   rh   rm   r     s   zSqlJinjaLexer.analyse_text)
r   r   r   r   r   r   r   rj   r   r   rh   rh   r   rm   rd     s    rd   )wr   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.lexers.sqlr   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.   rS   rT   rU   r3   r=   r>   r?   rA   r@   rB   rC   rD   rE   rF   rG   r   rI   rJ   rK   rL   r:   r
  r9   r8   r<   r;   r*   r+   r,   r-   r%   r&   r'   r(   r/   r0   r1   r2   r4   r6   r5   r7   r:  rH   rM   rN   rO   rP   rS  rQ   rR   rV   r\  rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   rh   rh   rh   rm   <module>   s    
,8_9SS/7C,#@90.M OS?