
    Mh'                       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Z1 G d de          Z2 G d de          Z3 G d de          Z4 G d de          Z5 G d de          Z6 G d de          Z7 G d de          Z8 G d de          Z9 G d  d!e          Z: G d" d#e          Z; G d$ d%e          Z< G d& d'e          Z= G d( d)e          Z> G d* d+e          Z? G d, d-e          Z@ G d. d/e          ZA G d0 d1e          ZB G d2 d3e          ZC G d4 d5e          ZD G d6 d7e          ZE G d8 d9e          ZF G d: d;e          ZG G d< d=e          ZH G d> d?e          ZI G d@ dAe          ZJ G dB dCe          ZK G dD dEe          ZL G dF dGe          ZM G dH dIe          ZN G dJ dKe          ZO G dL dMe          ZP G dN dOe          ZQ G dP dQe          ZR G dR dSe          ZS G dT dUe          ZT G dV dWe          ZU G dX dYe          ZV G dZ d[e          ZW G d\ d]e          ZX G d^ d_e          ZY G d` dae          ZZ G db dce          Z[ G dd dee          Z\ G df dge          Z] G dh die          Z^ G dj dke          Z_ G dl dme          Z` G dn doe          Za G dp dqe          Zb G dr dse          Zc G dt due          Zd G dv dwe          Ze G dx dye          Zf G dz d{e          Zg G d| d}e          Zh G d~ de          Zi G d de          Zj G d de          Zk G d de          Zl G d de          Zm G d de          Zn G d de          Zo G d de          Zp G d de          Zq G d de          Zr G d de          Zs G d de          Zt G d de          Zu G d de          ZvdS )z
    pygments.lexers.templates
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for various template engines' markup.

    :copyright: Copyright 2006-2025 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                   h    e Zd ZdZdZdZdgZdgZdZ e	j
        de	j                  Zd Zd	 Z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`.
    ERBhttps://github.com/ruby/erberbzapplication/x-ruby-templating z*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)c                 P    ddl m}  |di || _        t          j        | fi | d S )Nr   )	RubyLexer )pygments.lexers.rubyrl   
ruby_lexerr   __init__)selfoptionsrl   s      Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/templates.pyrp   zErbLexer.__init__E   sI    222222#)..g..t''w'''''    c              #     K   | j                             |          }|                                 dx}}	 	 |dk    r6|                                }|t          |fV  |t          |          z  }d}n|dk    r|                                }|dv r|t          |fV  |dz  }d}n|dk    rM|t          j        |fV  |                                }|dz   t          |fV  |dt          |          z   z  }d}nV|dv ry|t          j        |fV  |t          |          z  }|                                }d}| j        	                    |          D ]\  }}	}
||z   |	|
fV  |t          |          z  }d}n|d	v r!|t          |fV  |t          |          z  }d}n|t          j        |d         fV  d}| j        	                    |dd
                   D ]\  }}	}
|dz   |z   |	|
fV  |t          |          z  }d}nP|dk    rJ|                                }|d	vr|t          |fV  n|t          j        |fV  |t          |          z  }d}# t          $ r Y d
S w xY 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   Preprocro   get_tokens_unprocessedr   
IndexError)rq   texttokensstateidxvaltagdatar_idxr_tokenr_values              rs   r   zErbLexer.get_tokens_unprocessedJ   s      %%d++9	6A:: **,,Cuc/)))3s88OCEEaZZ **,,Cn,,!5#o---q !!7?C7777$jjll!Agw3333q3s88|+ ! 444!7?C7777s3xx%zz|| ! $ F Ft L L@ @3E7G"'#+w"?????s4yy( !--!5#o---s3xx ! "7?CF:::: ! $ F Fs122w O OD D3E7G"%'E/7G"CCCCCs3xx !aZZ **,,C-//!5#o----!7?C77773s88OCEm6n  	 	 	FF	s   HI 
I I c                     d| v rd| v rdS d S d S )Nry   rz   皙?rm   r   s    rs   analyse_textzErbLexer.analyse_text   s#    4<<DDLL3 <LLrt   N)__name__
__module____qualname____doc__nameurlaliases	mimetypesversion_addedrecompileMr{   rp   r   r   rm   rt   rs   r*   r*   3   s          D
'CgG01IM
H"$OOI( ( (
B B BH    rt   r*   c                      e Zd ZdZdZdZdgZdgZdgZdZ	e
j        e
j        z  Zdefd	 eej        eej                  fd
 eej         ee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 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.
    Smartyhttps://www.smarty.net/smarty*.tplzapplication/x-smartyrj   [^{]+z(\{)(\*.*?\*)(\})z(\{php\})(.*?)(\{/php\})T)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                     d}t          j        d|           r|dz  }t          j        d|           r|dz  }t          j        d|           r|dz  }t          j        d|           r|dz  }|S )N        z\{if\s+.*?\}.*?\{/if\}333333?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}{Gz?r   searchr   rvs     rs   r   zSmartyLexer.analyse_text   s    9.55 	$JB9.55 	$JB98$?? 	$JB9\4(( 	$JB	rt   N)"r   r   r   r   r   r   r   	filenamesr   r   r   	MULTILINEDOTALLflagsr"   r   r   r   r   r   r   Functionr   Variabler   r   Constantr!   r    DoubleSingle	Attributer   r   rm   rt   rs   r/   r/      sr         D
#CjG	I'(IML29$E u!Xgow@@B(XgouuX4'H'H'Ho' '( *Xgot}d;;XGGOX.

 TNGOW-GOV,.&6+X6#W%56'(.0(&-8(&-8dn-
 F8
 
 
 
 
rt   r/   c                      e Zd ZdZdZdZdgZddgZdZe	j
        e	j        z  ZdZd	efd
 eej        eej                  fd eej        e          fdez   dz    eej        ej        ej        e          dfdez   dz    eej        ej        ej                  fdedfgeej        fdedfdez   dz    eeej                  dfdedf ed          gdefdedfdez   dz   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) Z!d*S )+rT   z
    Generic Velocity template lexer.

    Just highlights velocity directives and variable references, other
    data is left untouched by the lexer.
    Velocityhttps://velocity.apache.org/velocity*.vm*.fhtmlrj   r   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                    d}t          j        d| t           j                  r|dz  }t          j        d| t           j                  r|dz  }t          j        d| t           j                  r|dz  }t          j        d|           r|dz  }|S )	Nr   z #\{?macro\}?\(.*?\).*?#\{?end\}?      ?z#\{?if\}?\(.+?\).*?#\{?end\}?r   z"#\{?foreach\}?\(.+?\).*?#\{?end\}?z6\$!?\{?[a-zA-Z_]\w*(\([^)]*\))?(\.\w+(\([^)]*\))?)*\}?r   r   r   r   r   s     rs   r   zVelocityLexer.analyse_text  s    98$	JJ 	$JB95tRYGG 	$JB9:D")LL 	$JB9 0157 7 	$JB	rt   N)"r   r   r   r   r   r   r   r   r   r   r   r   r   
identifierr"   r   r   r   r   r   r   r   r   r   r   r   r    r   r   r!   r   r   r   r   rm   rt   rs   rT   rT      s_         D
(ClG#IML29$E J Xgow@@BXgow//1*$'77Xgot}go{SS  *${2Xgot}goFFHj1
 'K.
"T)Xk4=117<K(GFOO
 NHo.Z%'7GL!!
 hGL!!Hf%
 j1TNk"(&-8(&-8&/F##W%56K)K(K)K(K)K(
E2 2Fh    rt   rT   c                   B     e Zd ZdZdZdgZdZddgZdgZdZ	 fd	Z
 xZS )
rU   za
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `HtmlLexer`.

    zHTML+Velocityzhtml+velocityrj   *.htmlr   ztext/html+velocityr   c                 R     t                      j        t          t          fi | d S N)superrp   r   rT   rq   rr   	__class__s     rs   rp   zVelocityHtmlLexer.__init__/  *    M==W=====rt   )r   r   r   r   r   r   r   alias_filenamesr   r   rp   __classcell__r   s   @rs   rU   rU   !  sm          DGM+O%&I
(C> > > > > > > > >rt   rU   c                   H     e Zd ZdZdZdgZdZddgZdgZdZ	 fd	Z
d
 Z xZS )rV   z`
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `XmlLexer`.

    zXML+Velocityzxml+velocityrj   *.xmlr   zapplication/xml+velocityr   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rT   r   s     rs   rp   zVelocityXmlLexer.__init__A  s*    =<<G<<<<<rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S Nr   r   )rT   r   r%   r   s     rs   r   zVelocityXmlLexer.analyse_textD  s8    ''--4$ 	#IB	rt   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   s   @rs   rV   rV   3  s|          DGM'O+,I
(C= = = = =      rt   rV   c                      e Zd ZdZdZddgZddgZdZdZe	j
        e	j        z  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% Z d&S )'r4   a  
    Generic `Django <https://www.djangoproject.com/documentation/templates/>`_
    and `Jinja <https://jinja.palletsprojects.com>`_ 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-jinja5https://www.djangoproject.com/documentation/templatesrj   r   \{\{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                     d}t          j        d|           |dz  }t          j        d|           |dz  }t          j        d|           |dz  }|S )Nr   z\{%\s*(block|extends)r   z\{%\s*if\s*.*?%\}皙?z\{\{.*?\}\}r   r   s     rs   r   zDjangoLexer.analyse_text  s_    9-t44@#IB9)400<#IB9^T**6#IB	rt   N)!r   r   r   r   r   r   r   r   r   r   r   Sr   r"   r   r   r   r   r   r   r   r   PseudoBuiltinr   r    r   r   r!   r   r   r   r   rm   rt   rs   r4   r4   K  sa         D!G24IJI
ACMD24KE ugou-7#5XgotWdGOwgto' '(1XgotWdGOGOT7Do' '( 8XgotWdDMJJ +XgotW55w@EN/
4 (Xhdm4463XgtWdDMBBD5w~FG -dl;/t}%*FM:*FM:0(;'(.0
& TNHHT7?;;VDGJ
 TN88D'/::FCGJ;	
c7 7Fr    rt   r4   c                   <   e Zd ZdZdZdZdgZddgZdgZd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>   zh
    Generic myghty templates lexer. Code that isn't Myghty
    markup is yielded as `Token.Other`.
    Myghtyhttp://www.myghty.org/myghtyz*.mytautodelegatezapplication/x-myghty0.6r   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   r   Tagr   r   r   r	   r   r"   r   r   rm   rt   rs   r>   r>     s        
 D
"CjG.)I'(IM 	TNCXdhdmTXeDkk48- -. 4XdhtxeK(($(4 45 )Xdhuu[/A/A48LLN*Xdhuu[/A/A48LLNdh#Xdhk 2 2DH==?$g.(Xdhk 2 2E::<	  xx00	2%
FFFrt   r>   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )r?   z^
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `HtmlLexer`.
    zHTML+Myghtyzhtml+myghtyztext/html+myghtyr   r   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r>   r   s     rs   rp   zMyghtyHtmlLexer.__init__  *    K;;7;;;;;rt   r   r   r   r   r   r   r   r   r   rp   r   r   s   @rs   r?   r?     sb         
 DoG#$I
"CM< < < < < < < < <rt   r?   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )r@   z]
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtyr   r   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r>   r   s     rs   rp   zMyghtyXmlLexer.__init__  *    ;::':::::rt   r  r   s   @rs   r@   r@     sb         
 DnG)*I
"CM; ; ; ; ; ; ; ; ;rt   r@   c                   >     e Zd ZdZdZddgZg dZdZdZ fdZ	 xZ
S )	rB   zd
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Myghtyzjavascript+myghtyz	js+myghty)zapplication/x-javascript+myghtyztext/x-javascript+myghtyztext/javascript+mygthyr   r   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r>   r   s     rs   rp   zMyghtyJavascriptLexer.__init__  *    +AAAAAAArt   r  r   s   @rs   rB   rB     sy         
 D"K0G+ + +I #CMB B B B B B B B Brt   rB   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )rA   z]
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.
    z
CSS+Myghtyz
css+myghtyztext/css+myghtyr   r   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r>   r   s     rs   rp   zMyghtyCssLexer.__init__  r
  rt   r  r   s   @rs   rA   rA      sb         
 DnG"#I
"CM; ; ; ; ; ; ; ; ;rt   rA   c                   |   e Zd ZdZdZdZdgZg dZdgZd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 ZdS )rC   zl
    Generic mason templates lexer. Stolen from Myghty lexer. Code that isn't
    Mason markup is HTML.
    Masonzhttp://www.masonhq.com/mason)z*.mz*.mhtmlz*.mcz*.miautohandlerdhandlerzapplication/x-mason1.4r   r   z(?s)(<%doc>)(.*?)(</%doc>)r   z%(?s)(<%(\w+)(.*?)(>))(.*?)(</%\2\s*>)Nz(?s)(<&[^|])(.*?)(,.*?)?(&>)r   r   r   r   r  r  c                 ~    d}t          j        d|           d}n"t          j        d| t           j                  d}|S )Nr   z</%(class|doc|init)>g      ?z<&.+&>g)\(?r   )r   results     rs   r   zMasonLexer.analyse_text=  sA    9,d33?FFYy$	22>Frt   )r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   	Multiliner   r   r   r
   r"   r   r   r   r   rm   rt   rs   rC   rC     s         D
#CiGMMMI&'IM 	Z *Xdh 148<<>CXdh
DM48eDkk48- -. 6XdhdD%%	2B2BDHMMO,XdhuuY/?/?JJL*XdhuuY/?/?JJLdh#Xdhi 0 0$(;;=$g.(Xdhi 0 0%88:	  xi 0 0(;;	='
FB    rt   rC   c                      e Zd ZdZdZdZdgZdgZdgZd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 )rD   zd
    Generic mako templates lexer. Code that isn't Mako
    markup is yielded as `Token.Other`.
    Makohttp://www.makotemplates.org/makoz*.maozapplication/x-mako0.7z(\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   ry   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   r   r   r   r"   r   r	   r   r  r   r   r   r   r   r    r   rm   rt   rs   rD   rD   F  s        
 D
)ChG	I%&IM /XdowGGI'Xdowk8J8JERRT&Xdow~tGGI$g&78Xgot|44e=!Xgot|W_EEG+>'Xgouu['9'97?KKMXgouu['9'97?KKM %**, TN? 
D GO$7FGENN
 *XdndF3350TN	
 ff%ff%(
[2 2FFFrt   rD   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )rE   z\
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.
    z	HTML+Makoz	html+makoztext/html+makor  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rD   r   s     rs   rp   zMakoHtmlLexer.__init__  *    I9999999rt   r  r   s   @rs   rE   rE     sb         
 DmG!"I
)CM: : : : : : : : :rt   rE   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )rF   z[
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Makozxml+makozapplication/xml+makor  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rD   r   s     rs   rp   zMakoXmlLexer.__init__  *    98888888rt   r  r   s   @rs   rF   rF     sb         
 DlG'(I
)CM9 9 9 9 9 9 9 9 9rt   rF   c                   >     e Zd ZdZdZddgZg dZdZdZ fdZ	 xZ
S )	rG   zb
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Makozjavascript+makozjs+mako)zapplication/x-javascript+makoztext/x-javascript+makoztext/javascript+makor  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rD   r   s     rs   rp   zMakoJavascriptLexer.__init__  s*    )??w?????rt   r  r   s   @rs   rG   rG     sy         
 D ),G) ) )I *CM@ @ @ @ @ @ @ @ @rt   rG   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )rH   z[
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.
    zCSS+Makozcss+makoztext/css+makor  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rD   r   s     rs   rp   zMakoCssLexer.__init__  r)  rt   r  r   s   @rs   rH   rH     sb         
 DlG !I
)CM9 9 9 9 9 9 9 9 9rt   rH   c                       e Zd ZdZd ZdS )CheetahPythonLexerzI
    Lexer for handling Cheetah's special $ tokens in Python syntax.
    c              #      K   t          di | j        }|                    |          D ]/\  }}}|t          j        k    r|dk    rt
          j        }|||fV  0d S )N$rm   )r	   rr   r   r#   r   r   r   )rq   r   pylexerpostype_values         rs   r   z)CheetahPythonLexer.get_tokens_unprocessed  s{      ----!(!?!?!E!E 	$ 	$C##ue#####	$ 	$rt   N)r   r   r   r   r   rm   rt   rs   r/  r/    s-         $ $ $ $ $rt   r/  c                   B   e Zd ZdZdZdZddgZddgZdd	gZd
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 )rJ   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/
    Cheetahhttp://www.cheetahtemplate.org/cheetahspitfirez*.tmplz*.sptzapplication/x-cheetahzapplication/x-spitfirerj   r   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   r   r   r   r/  r"   r   r   rm   rt   rs   rJ   rJ     s#         D
+C*%G7#I(*BCIM 	hw" '*"GO4)*hw.@(A(A( (* (Xgouu-?'@'@AAC%Xgouu-?'@'@o' '(  TN/
FFFrt   rJ   c                   >     e Zd ZdZdZg dZddgZdZdZ fdZ	 xZ
S )	rK   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+spitfirer8  rj   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rJ   r   s     rs   rp   zCheetahHtmlLexer.__init__  s*    L<<G<<<<<rt   r  r   s   @rs   rK   rK     si         
 D>>>G$&:;I
+CM= = = = = = = = =rt   rK   c                   >     e Zd ZdZdZddgZddgZdZdZ fd	Z	 xZ
S )
rL   z^
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Cheetahzxml+cheetahzxml+spitfirezapplication/xml+cheetahzapplication/xml+spitfirer8  rj   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rJ   r   s     rs   rp   zCheetahXmlLexer.__init__"  *    <;;7;;;;;rt   r  r   s   @rs   rL   rL     sh         
 Dn-G*,FGI
+CM< < < < < < < < <rt   rL   c                   >     e Zd ZdZdZg dZg dZdZdZ fdZ	 xZ
S )rM   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+spitfirer8  rj   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rJ   r   s     rs   rp   zCheetahJavascriptLexer.__init__8  s*    ,BB'BBBBBrt   r  r   s   @rs   rM   rM   &  s         
  D5 5 5G- - -I ,CMC C C C C C C C Crt   rM   c                   b   e Zd ZdZdZdZdgZddgZd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 Texthttps://genshi.edgewall.org/
genshitextzapplication/x-genshi-textztext/x-genshirj   z[^#$\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   rF  r   N)r   r   r   r   r   r   r   r   r   r"   r   r   r   r   r   r   r	   r   r   r   r   rm   rt   rs   r;   r;   <  s?         D
(CnG,o>IM % xxg66788D'/::KHGJ
 D&!#UU;%7%7@0XgtUU;%7%788&B$gv6&$(H(H&Q
 'Xgouu['9'97?KKM,]
! FFFrt   r;   c                   Z   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[^"'$]+rG  z(?<!\$)(\$)([a-zA-Z_][\w\.]*))	r   rJ  rK  r   r#  rM  rO  rP  r   N)r   r   r   r   r   r   r   r"   r   r   r   r   r	   r   r  r   r   r   r    r   r   rm   rt   rs   rI  rI  `  s        
 IE %Xgouu['9'97?KKM 8?#TXw7"DHe4GJe

 TNT^X6&)
 HHVUU;-?-?HH&QHHVUU;-?-?HH&Q(
 TNt~x8T^V4&)	
 &.)&.)(
 &&!GI&M
 &&!GI&M
  GJ

 'Xgouu['9'97?KKM-]
_5 5FFFrt   rI  c                   J     e Zd ZdZdZddgZdZg dZdgZdZ	 fd	Z
d
 Z xZS )r:   z
    A lexer that highlights `genshi <https://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid HTML templates.
    zHTML+Genshizhtml+genshizhtml+kidrj   r   *.htm*.xhtmlztext/html+genshirD  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rI  r   s     rs   rp   zHtmlGenshiLexer.__init__  s+    $5AAAAAAArt   c                     d}t          j        d|           |dz  }t          j        d|           |dz  }|t          j        |           z   dz
  S Nr   z	\$\{.*?\}皙?zpy:(.*?)=["\']r   )r   r   r   r   r   s     rs   r   zHtmlGenshiLexer.analyse_text  sY    9\4((4#IB9&--9#IBI*4000477rt   r   r   s   @rs   r:   r:     s         
 Dj)GM444O#$I
(CB B B B B8 8 8 8 8 8 8rt   r:   c                   P     e Zd ZdZdZg dZdgZdZdgZddgZ	d	Z
 fd
Zd Z xZS )r9   z
    A lexer that highlights `genshi <https://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid XML templates.
    Genshi)genshikidz
xml+genshizxml+kidz*.kidrj   r   zapplication/x-genshizapplication/x-kidrD  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rI  r   s     rs   rp   zGenshiLexer.__init__  s+    #4@@@@@@@rt   c                     d}t          j        d|           |dz  }t          j        d|           |dz  }|t          j        |           z   dz
  S rW  )r   r   r   r   r   s     rs   r   zGenshiLexer.analyse_text  sY    9\4((4#IB9&--9#IBH)$///$66rt   r   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   s   @rs   r9   r9     s         
 D888G	IMiO')<=I
(CA A A A A7 7 7 7 7 7 7rt   r9   c                   J     e Zd ZdZdZg dZdZdgZg dZdZ	 fdZ
d	 Z x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+genshirj   *.js)zapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshihttps://genshi.edgewall.orgc                 R     t                      j        t          t          fi | d S r   )r   rp   r   r;   r   s     rs   rp   zJavascriptGenshiLexer.__init__  s*    /EEWEEEEErt   c                 <    t                               |           dz
  S N皙?r9   r   r   s    rs   r   z"JavascriptGenshiLexer.analyse_text      ''--44rt   r   r   s   @rs   r=   r=     s          $D$ $ $GMhO+ + +I (CF F F F F5 5 5 5 5 5 5rt   r=   c                   H     e Zd ZdZdZddgZdZdgZdgZdZ	 fd	Z
d
 Z xZS )r<   zK
    A lexer that highlights CSS definitions in genshi text templates.
    zCSS+Genshi Textzcss+genshitextz
css+genshirj   *.cssztext/css+genshirb  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r;   r   s     rs   rp   zCssGenshiLexer.__init__  s*    ?>>g>>>>>rt   c                 <    t                               |           dz
  S re  rg  r   s    rs   r   zCssGenshiLexer.analyse_text  rh  rt   r   r   s   @rs   r<   r<     s{          D.GMiO"#I
'C? ? ? ? ?5 5 5 5 5 5 5rt   r<   c                   P     e Zd ZdZdZg dZdgZdZg dZdgZ	dZ
 fd	Zd
 Z x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*.rhtmlrj   rR  ztext/html+rubyrh   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r*   r   s     rs   rp   zRhtmlLexer.__init__  *    H8888888rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S Nr   g      ?)r*   r   r$   r   s     rs   r   zRhtmlLexer.analyse_text  s8    ""4((4/%% 	#IB	rt   r_  r   s   @rs   r+   r+     s          D000GIM444O!"I
'C9 9 9 9 9      rt   r+   c                   H     e Zd ZdZdZddgZdZdgZdgZdZ	 fd	Z
d
 Z xZS )r,   zo
    Subclass of `ErbLexer` which highlights data outside preprocessor
    directives with the `XmlLexer`.
    zXML+Rubyzxml+rubyzxml+erbrj   r   zapplication/xml+rubyrh   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r*   r   s     rs   rp   zXmlErbLexer.__init__%  *    877w77777rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S r   )r*   r   r%   r   s     rs   r   zXmlErbLexer.analyse_text(  s8    ""4((4/$ 	#IB	rt   r   r   s   @rs   r,   r,     s{         
 D9%GMiO'(I
'C8 8 8 8 8      rt   r,   c                   H     e Zd ZdZdZddgZdZdgZdgZdZ	 fd	Z
d
 Z xZS )r-   zS
    Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
    zCSS+Rubyzcss+rubyzcss+erbrj   rj  ztext/css+rubyrh   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r*   r   s     rs   rp   zCssErbLexer.__init__;  rv  rt   c                 <    t                               |           dz
  S re  r*   r   r   s    rs   r   zCssErbLexer.analyse_text>      $$T**T11rt   r   r   s   @rs   r-   r-   /  s{          D9%GMiO !I
'C8 8 8 8 82 2 2 2 2 2 2rt   r-   c                   J     e Zd ZdZdZg dZdZdgZg dZdZ	 fdZ
d	 Z xZS )
r.   z^
    Subclass of `ErbLexer` which highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Ruby)zjavascript+rubyzjs+rubyzjavascript+erbzjs+erbrj   ra  )zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyrh   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r*   r   s     rs   rp   zJavascriptErbLexer.__init__Q  *    (>>g>>>>>rt   c                 <    t                               |           dz
  S re  r{  r   s    rs   r   zJavascriptErbLexer.analyse_textT  r|  rt   r   r   s   @rs   r.   r.   B  s         
 DHHHGMhO) ) )I (C? ? ? ? ?2 2 2 2 2 2 2rt   r.   c                   P     e Zd ZdZdZdgZdgZdZg dZg dZ	dZ
 fd	Zd
 Z x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*.phtmlrj   )*.phpr   rS  rT  
*.php[345])zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5https://www.php.netc                 R     t                      j        t          t          fi | d S r   )r   rp   r   r   r   s     rs   rp   zHtmlPhpLexer.__init__k  rq  rt   c                 \    t          j        |           dz
  }t          |           r|dz  }|S rs  )r   r   r$   r   s     rs   r   zHtmlPhpLexer.analyse_textn  s5    "4((4/%% 	#IB	rt   r_  r   s   @rs   r&   r&   X  s          DlGIM% % %OI I II  C9 9 9 9 9      rt   r&   c                   H     e Zd ZdZdZdgZdZg dZdgZdZ	 fdZ
d	 Z xZS )
r'   zT
    Subclass of `PhpLexer` that highlights unhandled data with the `XmlLexer`.
    zXML+PHPzxml+phprj   )r   r  r  zapplication/xml+phpr  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r   r   s     rs   rp   zXmlPhpLexer.__init__  rv  rt   c                 \    t          j        |           dz
  }t          |           r|dz  }|S r   )r   r   r%   r   s     rs   r   zXmlPhpLexer.analyse_text  s5    "4((4/$ 	#IB	rt   r   r   s   @rs   r'   r'   u  s|          DkGM666O&'I
C8 8 8 8 8      rt   r'   c                   F     e Zd ZdZdZdgZdZdgZdgZdZ	 fdZ
d	 Z xZS )
r(   zU
    Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
    zCSS+PHPzcss+phprj   rj  ztext/css+phpr  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r   r   s     rs   rp   zCssPhpLexer.__init__  rv  rt   c                 0    t          j        |           dz
  S re  r   r   r   s    rs   r   zCssPhpLexer.analyse_text  s    $T**T11rt   r   r   s   @rs   r(   r(     sx          DkGMiO I
C8 8 8 8 82 2 2 2 2 2 2rt   r(   c                   J     e Zd ZdZdZddgZdZdgZg dZdZ	 fd	Z
d
 Z xZS )r)   z`
    Subclass of `PhpLexer` which highlights unmatched data with the
    `JavascriptLexer`.
    zJavaScript+PHPzjavascript+phpzjs+phprj   ra  )zapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpr  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r   r   s     rs   rp   zJavascriptPhpLexer.__init__  r  rt   c                 *    t          j        |           S r   r  r   s    rs   r   zJavascriptPhpLexer.analyse_text  s    $T***rt   r   r   s   @rs   r)   r)     s         
 D*GMhO( ( (I  C? ? ? ? ?+ + + + + + +rt   r)   c                   H     e Zd ZdZdZdgZdZg dZdgZdZ	 fdZ
d	 Z xZS )
r0   z
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Smartyzhtml+smartyrj   )r   rS  rT  r   ztext/html+smartyr   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r/   r   s     rs   rp   zHtmlSmartyLexer.__init__  r  rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S rs  )r/   r   r$   r   s     rs   r   zHtmlSmartyLexer.analyse_text  8    %%d++d2%% 	#IB	rt   r   r   s   @rs   r0   r0     s|          DoGM===O#$I
#C< < < < <      rt   r0   c                   H     e Zd ZdZdZdgZdZddgZdgZdZ	 fd	Z
d
 Z xZS )r1   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Smartyz
xml+smartyrj   r   r   zapplication/xml+smartyr   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r/   r   s     rs   rp   zXmlSmartyLexer.__init__  r
  rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S r   )r/   r   r%   r   s     rs   r   zXmlSmartyLexer.analyse_text  8    %%d++d2$ 	#IB	rt   r   r   s   @rs   r1   r1     s{         
 DnGM(O)*I
#C; ; ; ; ;      rt   r1   c                   H     e Zd ZdZdZdgZdZddgZdgZdZ	 fd	Z
d
 Z xZS )r2   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `CssLexer`.
    z
CSS+Smartyz
css+smartyrj   rj  r   ztext/css+smartyr   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r/   r   s     rs   rp   zCssSmartyLexer.__init__  r
  rt   c                 <    t                               |           dz
  S re  r/   r   r   s    rs   r   zCssSmartyLexer.analyse_text  rh  rt   r   r   s   @rs   r2   r2     s{         
 DnGM(O"#I
#C; ; ; ; ;5 5 5 5 5 5 5rt   r2   c                   L     e Zd ZdZdZddgZdZddgZg dZd	Z	 fd
Z
d Z xZS )r3   zd
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Smartyzjavascript+smartyz	js+smartyrj   ra  r   )zapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartyr   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r/   r   s     rs   rp   zJavascriptSmartyLexer.__init__  r  rt   c                 <    t                               |           dz
  S re  r  r   s    rs   r   z"JavascriptSmartyLexer.analyse_text
  rh  rt   r   r   s   @rs   r3   r3     s         
 D"K0GMw'O+ + +I $CB B B B B5 5 5 5 5 5 5rt   r3   c                   T     e Zd ZdZdZg dZg dZdZg dZddgZ	d	Z
 fd
Zd Z xZS )r5   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.jinja2rj   rR  ztext/html+djangoztext/html+jinjar   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r4   r   s     rs   rp   zHtmlDjangoLexer.__init__  r  rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S rs  )r4   r   r$   r   s     rs   r   zHtmlDjangoLexer.analyse_text!  r  rt   r_  r   s   @rs   r5   r5     s          D999GjjjIM444O#%67I
AC< < < < <      rt   r5   c                   R     e Zd ZdZdZddgZddgZdZdgZd	d
gZ	dZ
 fdZd Z xZS )r7   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `XmlLexer`.
    zXML+Django/Jinjaz
xml+djangoz	xml+jinjaz*.xml.j2z*.xml.jinja2rj   r   zapplication/xml+djangozapplication/xml+jinjar   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r4   r   s     rs   rp   zXmlDjangoLexer.__init__6  r
  rt   c                 h    t                               |           dz
  }t          |           r|dz  }|S r   )r4   r   r%   r   s     rs   r   zXmlDjangoLexer.analyse_text9  r  rt   r_  r   s   @rs   r7   r7   (  s         
 D[)G^,IMiO)+BCI
AC; ; ; ; ;      rt   r7   c                   R     e Zd ZdZdZddgZddgZdZdgZd	d
gZ	dZ
 fdZd Z xZS )r6   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `CssLexer`.
    zCSS+Django/Jinjaz
css+djangoz	css+jinjaz*.css.j2z*.css.jinja2rj   rj  ztext/css+djangoztext/css+jinjar   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r4   r   s     rs   rp   zCssDjangoLexer.__init__N  r
  rt   c                 <    t                               |           dz
  S re  r4   r   r   s    rs   r   zCssDjangoLexer.analyse_textQ  rh  rt   r_  r   s   @rs   r6   r6   @  s         
 D[)G^,IMiO"$45I
AC; ; ; ; ;5 5 5 5 5 5 5rt   r6   c                   R     e Zd ZdZdZg dZddgZdZdgZg dZ	d	Z
 fd
Zd Z xZS )r8   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.jinja2rj   ra  )zapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjar   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r4   r   s     rs   rp   zJavascriptDjangoLexer.__init__i  r  rt   c                 <    t                               |           dz
  S re  r  r   s    rs   r   z"JavascriptDjangoLexer.analyse_textl  rh  rt   r_  r   s   @rs   r8   r8   U  s         
 %D/ / /GM*IMhO* * *I BCB B B B B5 5 5 5 5 5 5rt   r8   c                   V    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).*?>[^<]+<rz   r   [\w\W]+?(?=%>|\Z)r   r  N)	r   r   r   r   r   r"   r   r   r   rm   rt   rs   r  r  p  sr          w&Su5M
 GV$!55#3#34
 FFFrt   r  c                   F     e Zd ZdZdZdgZdgZdgZdZdZ	 fdZ
d	 Z xZS )
rI   z&
    Lexer for Java Server Pages.
    zJava Server Pagejspz*.jspzapplication/x-jspz.https://projects.eclipse.org/projects/ee4j.jspr  c                 R     t                      j        t          t          fi | d S r   r   rp   r   r  r   s     rs   rp   zJspLexer.__init__  r@  rt   c                 v    t          j        |           dz
  }t          |           r|dz  }d| v r	d| v r|dz  }|S Nr   r   ry   rz   r   )r   r   r%   r   s     rs   r   zJspLexer.analyse_text  sO    #D))D0$ 	#IB4<<DDLL#IB	rt   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   s   @rs   rI   rI     sx          DgG	I$%I
:CM< < < < <      rt   rI   c                      e Zd ZdZdZdgZdgZdgZdZd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 ZdS )rN   z7
    For files using the Evoque templating system.
    Evoqueevoquez*.evoquezapplication/x-evoquehttps://gizmojo.org/templating1.1z[^#$]+z#\[commentz\$\$z\$\w+:[^$\n]*\$z'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})Nz>(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+)?(.*?)((?(4)%)\})z!(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})z(\$)(else|rof|fi)z%(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})#z[^\]#]r   z\]#r   z[\]#])r   r  c                     d| v rdS dS )z.Evoque templates use $evoque, which is unique.z$evoquerv   Nrm   r   s    rs   r   zEvoqueLexer.analyse_text  s    1 rt   )r   r   r   r   r   r   r   r   r   r   r   r   r   r"   r   r  r   r   r   r   r    r   r	   r   r   rm   rt   rs   rN   rN     s         DjGI'(I
*CMIE W&	2e!237Xk4<dk+ +,!Xk4<deeK00+? ?@
 2Xk4<deK((+7 78 "88K#F#FG5Xk4{););lD$= => 5M9
> )*W&0W&/w()	
?% %FN    rt   rN   c                   F     e Zd ZdZdZdgZdgZdgZdZdZ	 fdZ
d	 Z xZS )
rO   z^
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML+Evoquezhtml+evoquer   ztext/html+evoquer  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rN   r   s     rs   rp   zEvoqueHtmlLexer.__init__  r  rt   c                 6    t                               |           S r   rN   r   r   s    rs   r   zEvoqueHtmlLexer.analyse_text      ''---rt   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   s   @rs   rO   rO     sx          DoGjO#$I
*CM< < < < <. . . . . . .rt   rO   c                   F     e Zd ZdZdZdgZdgZdgZdZdZ	 fdZ
d	 Z xZS )
rP   z]
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Evoquez
xml+evoquer   zapplication/xml+evoquer  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rN   r   s     rs   rp   zEvoqueXmlLexer.__init__  r
  rt   c                 6    t                               |           S r   r  r   s    rs   r   zEvoqueXmlLexer.analyse_text  r  rt   r  r   s   @rs   rP   rP     sx          DnGiO)*I
*CM; ; ; ; ;. . . . . . .rt   rP   c                   p   e Zd ZdZdZdgZg Zg ZdZd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 )!rQ   z
    Coldfusion statements
    cfstatementcfs5https://www.adobe.com/products/coldfusion-family.htmlrj   z//.*?\nz/\*(?:.|\n)*?\*/z\+\+|--z
[-+*/^&=!]z<=|>=|<|>|==zmod\bz"(eq|lt|gt|lte|gte|not|is|and|or)\bz\|\||&&z\?rL  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[^"#]+r  r   )r   r  N)r   r   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   Interpr   rm   rt   rs   rQ   rQ     sY         DgGII
ACMME ( '"34"H%h'x 2H="H6=(+ v}%VMNUW $W%56T](XdmT;779t}- +.TN3
8 FM"v}%&6=!6=&)
9# #FFFrt   rQ   c                      e Zd ZdZdZdgZg Zg Zd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
    
Coldfusioncfr  r  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)<[^<>]*r  r   z--->z([^<-]|<(?!!---)|-(?!-->))+)r   r  r  r  N)r   r   r   r   r   r   r   r   r   r"   r   r   r  r   r   r   r   rQ   r   r   rm   rt   rs   r  r  2  sj         DfGII
AC uGFOO
 w(+6(t|Z88XdlEE/$:$:DLIIKQ XdlEE/$:$:DLII	K
 XXk553I3I&13 3 4 f5GFOOU#5M	
 w('2g'0+W->?
;" "FFFrt   r  c                   B     e Zd ZdZdZdgZddgZdgZdZdZ	 fd	Z
 xZS )
rR   z#
    Coldfusion markup in html
    zColdfusion HTMLcfmz*.cfmz*.cfmlzapplication/x-coldfusionr  rj   c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r  r   s     rs   rp   zColdfusionHtmlLexer.__init__l  s+    $9EEWEEEEErt   r   r   r   r   r   r   r   r   r   r   rp   r   r   s   @rs   rR   rR   a  su          DgG(#I+,I
ACMF F F F F F F F Frt   rR   c                   >     e Zd ZdZdZdgZdgZg ZdZdZ	 fdZ
 xZS )rS   z-
    Coldfusion markup/script components
    zColdfusion CFCcfcz*.cfcr  2.0c                 R     t                      j        t          t          fi | d S r   )r   rp   rR   rQ   r   s     rs   rp   zColdfusionCFCLexer.__init__{  s+    ,oIIIIIIIrt   r  r   s   @rs   rS   rS   p  so          DgG	II
ACMJ J J J J J J J Jrt   rS   c                   F     e Zd ZdZdZdgZdgZdgZdZdZ	 fdZ
d	 Z xZS )
rW   z)
    Lexer for Scalate Server Pages.
    zScalate Server Pagesspz*.sspzapplication/x-sspz"https://scalate.github.io/scalate/r  c                 R     t                      j        t          t          fi | d S r   r  r   s     rs   rp   zSspLexer.__init__  r@  rt   c                     d}t          j        d|           r|dz  }t          |           r|dz  }d| v r	d| v r|dz  }|S )Nr   zval \w+\s*:g333333?rX  ry   rz   r   )r   r   r%   r   s     rs   r   zSspLexer.analyse_text  s\    9^T** 	#IB$ 	#IB4<<DDLL#IB	rt   r  r   s   @rs   rW   rW     sx          !DgG	I$%I
.CM< < < < <      rt   rW   c                   P    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  rz   r   r  r  N)	r   r   r   r   r   r"   r   r   r   rm   rt   rs   r  r    sg          w&u5M
 GV$!55#6#67
 FFFrt   r  c                   F     e Zd ZdZdZdgZdgZdgZdZdZ	 fdZ
d	 Z xZS )
rX   z"
    Lexer for Tea Templates.
    Teateaz*.teaz
text/x-teaz$https://github.com/teatrove/teatrovez1.5c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r  r   s     rs   rp   zTeaTemplateLexer.__init__  s+    #7CC7CCCCCrt   c                 v    t          j        |           dz
  }t          |           r|dz  }d| v r	d| v r|dz  }|S r  )r   r   r%   r   s     rs   r   zTeaTemplateLexer.analyse_text  sO    &t,,t3$ 	#IB4<<DDLL#IB	rt   r  r   s   @rs   rX   rX     s|          DgG	II
0CMD D D D D      rt   rX   c                   J     e Zd ZdZdZdgZdZg dZg dZdZ	 fdZ
d	 Z xZS )
rY   z
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `HtmlLexer`.

    Nested JavaScript and CSS is also highlighted.
    z
HTML+Lassoz
html+lasso1.6)r   rS  rT  *.lasso*.lasso[89]*.incl*.inc*.las)ztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]https://www.lassosoft.comc                 R     t                      j        t          t          fi | d S r   )r   rp   r   r   r   s     rs   rp   zLassoHtmlLexer.__init__  s*    J::':::::rt   c                 \    t          j        |           dz
  }t          |           r|dz  }|S rs  )r   r   r$   r   s     rs   r   zLassoHtmlLexer.analyse_text  s5    $T**T1%% 	#IB	rt   r   r   s   @rs   rY   rY     s          DnGM3 3 3O2 2 2I &C; ; ; ; ;      rt   rY   c                   H     e Zd ZdZdZdgZdZg dZdgZdZ	 fdZ
d	 Z xZS )
rZ   z_
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.
    z	XML+Lassoz	xml+lassor  )r   r  r  r  r  r  zapplication/xml+lassor  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r   r   s     rs   rp   zLassoXmlLexer.__init__  s*    :9999999rt   c                 \    t          j        |           dz
  }t          |           r|dz  }|S r   )r   r   r%   r   s     rs   r   zLassoXmlLexer.analyse_text  s5    $T**T1$ 	#IB	rt   r   r   s   @rs   rZ   rZ     s         
 DmGM3 3 3O()I
%C: : : : :      rt   rZ   c                   F     e Zd ZdZdZdgZdZdgZdgZdZ	 fdZ
d	 Z xZS )
r[   z_
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.
    z	CSS+Lassoz	css+lassor  rj  ztext/css+lassor  c                 \    d|d<    t                      j        t          t          fi | d S NTrequiredelimiters)r   rp   r   r   r   s     rs   rp   zLassoCssLexer.__init__  s5    '+#$:9999999rt   c                 z    t          j        |           dz
  }t          j        d|           r|dz  }d| v r|dz  }|S )Nrf  z
\w+:[^;]+;r   zpadding:)r   r   r   r   r   s     rs   r   zLassoCssLexer.analyse_text
  sM    $T**T19]D)) 	#IB#IB	rt   r   r   s   @rs   r[   r[     sx         
 DmGMiO!"I
%C: : : : :      rt   r[   c                   J     e Zd ZdZdZddgZdZdgZg dZdZ	 fd	Z
d
 Z xZS )r\   zf
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.
    zJavaScript+Lassozjavascript+lassozjs+lassor  ra  )zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassor  c                 \    d|d<    t                      j        t          t          fi | d S r  )r   rp   r   r   r   s     rs   rp   zLassoJavascriptLexer.__init__"  s5    '+#$*@@@@@@@rt   c                 4    t          j        |           dz
  }|S re  )r   r   r   s     rs   r   z!LassoJavascriptLexer.analyse_text&  s    $T**T1	rt   r   r   s   @rs   r\   r\     s         
 D!:.GMhO* * *I &CA A A A A      rt   r\   c                      e Zd ZdZdZdZdgZd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                    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.
    
Handlebarshttps://handlebarsjs.com/
handlebarsr  r   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   r
  r   r  N)r   r   r   r   r   r   r   r   r"   r   r   Specialr   r   r!   r   r   r   r   r   r   r   r   r   r   r    r   r   r   rm   rt   rs   r]   r]   +  s0         D
%CnGM u W% xx>>F (Xgov'79IJJESXXgot<<eD
  TN0HHVW_==vF hht~x@@A )((7D'*J*JK"HHWdDM$J$JKhhwkBB  GI!
& TNK(+XXgt6:mT.K .K L"HHWd-2U4z-J-J-J%L %L M&GI
 #DM2$-(-t}=
 GJ +FM:*FM:'(.0
g< <FFFrt   r]   c                   D     e Zd ZdZdZdgZddgZddgZdZd	Z	 fd
Z
 xZS )r^   zb
    Subclass of the `HandlebarsLexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML+Handlebarszhtml+handlebarsz*.handlebarsz*.hbsztext/html+handlebarsztext/x-handlebars-templater  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r]   r   s     rs   rp   zHandlebarsHtmlLexer.__init__  s*    O??w?????rt   r  r   s   @rs   r^   r^   w  sy         
 D !G)I')EFI
%CM@ @ @ @ @ @ @ @ @rt   r^   c                   F     e Zd ZdZdZg dZg dZddgZdZdZ	 fd	Z
 xZS )
r_   z
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `YamlLexer`.

    Commonly used in Saltstack salt states.
    z
YAML+Jinja)z
yaml+jinjasaltsls)z*.slsz	*.yaml.j2z*.yml.j2z*.yaml.jinja2z*.yml.jinja2ztext/x-yaml+jinjaz
text/x-sls!https://jinja.palletsprojects.comr  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r4   r   s     rs   rp   zYamlJinjaLexer.__init__  r  rt   r  r   s   @rs   r_   r_     ss          D+++GSSSI$l3I
-CM< < < < < < < < <rt   r_   c                   L   e Zd ZdZdZdZdgZdgZdZi dde	fd e
ee          d	fd
 e
ee ee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          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          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          eee eed          ee          fd,efd-ej        fd. e
 eed          eej        e eed                    f ed           ed          gd/ ed           ed0          gd1d2 e
eede          dfd3 e
eej        e          dfgd)d#edfgdd4ed&fgd0d5edfgd6 ed          d7 e
ej        ee          fd8 e
ee eed          ee          f ed9           ed:           ed;          d<efgd* ed6          d=e	fgd> ed6           ed          d=e	fgd"d4ed&f ed*          gd d4ed&f ed>          gd;d?ej        fgd@ej        fdAefgdBej        fdCej        fgdDej        fdEej         fg ed;           ed9           ed:           ed          gdFefgdG e
eeej        ee          d&fd=e!fgde	fdH e
eeej        ee          dfde	fgdIZ"dS )Jr`   z%
    Lexer for Liquid templates.
    liquidz.https://www.rubydoc.info/github/Shopify/liquidz*.liquidr  r   r   z
(\{%)(\s*)ztag-or-blockz(\{\{)(\s*)([^\s}]+)r  r  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*)(%\})r  z(raw)(\s*)(%\})rawz(end(case|unless|if))(\s*)(%\})Nz(end([^\s%]+))(\s*)(%\})z"(cycle)(\s+)(?:([^\s:]*)(:))?(\s*)zvariable-tag-markupz([^\s%]+)(\s*)z
tag-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*)(\}\})r  numberkeyword,r   zvariable-param-markupz\b(false|true)\br   z(?<=\w)\.(?=\w)z'[^']*'z"[^"]*"z\d+\.\d+r  z[ \t]+z (\{%)(\s*)(endcomment)(\s*)(%\})z(\{%)(\s*)(endraw)(\s*)(%\}))r   r  r  r  r  r  r  )#r   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   rm   rt   rs   r`   r`     s         D
:CjGIM@tHH[*==~N$Xk:uuT9/M/M/MNN DM	
@ 	-w/?MXXg&6
CCXnlI>>@ Xg&
K@@&J 2Xdh
EE$
,K,K,K +/ /068 $Xdh
K88)EXdh
K88%A 0Xg&j+FFP(Xdhj+>>H 3Xdh
eD	222KM M"$ : > >M=
@Z 	GL!!k6*K+	
[@h 	GL!!k#34#Xdm[*==P	
i@x 	K(GL!!G*++
y@D 	GN##GL!!?XeeD)444j( %%i"@"@"@*!# #$ X':XeeD)444j(- %%i"@"@"@B BC GIGL!!
E@h 	GIG'((
i@r 	'Xj(D*==vG(Xj(-<<fF
s@@ 	k6*
A@H 	["23
I@P 	Z(
Q@Z 	GL!!$Xdnj(;;= /Xk:uuT:/N/N/N +/ /0 GHGHGI;
[@z 	GN##4L!
{@D 	 GN##GJ4L"
E@P 	["23G*++
Q@Z 	["23G+,, 
[@f 	 '"23
g@p dm,-
 ''
 &,'V^$
 GIGHGHGJ	
 
#
 1Xk:tx!# #$46 7O	
 t,Xk:tx!# #$*, DM
s@ @ @FFFrt   r`   c                      e Zd ZdZdZdgZdgZdZdZe	j
        e	j        z  ZdZdZd	ez   d
z   Zeez   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 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 d eeeej                  fde d 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z   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 ))ra   z
    Twig template lexer.

    It just highlights Twig code between the preprocessor directives,
    other data is left untouched by the lexer.
    Twigtwigzapplication/x-twighttps://twig.symfony.comr  z[\\\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+)(r   r   r   r   z
(\|)(\s*)(z(is)(\s+)(not)?(\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   r   r   _ident_char_ident_begin
_ident_end_ident_innerr"   r   r   r   r   r   r   r   r   r   r   r   r!   r    r   r   r   r   r   rm   rt   rs   ra   ra   h  s         DhG%&I
$CMD24KE *K/L+%,J*,L ugou-W%1XgotWdGOW_dGTo' '(
6XgotWdGOW_dGTo' '( <L;;;XgotWdDMJJ +XgotW55u>EN-
2 +<***Xhdm4465l555XgtWdDMBBD,gn=5 	
 &t|44=)\!4=1&!*FM:*FM:DhO'(.0%
, TNHHT7?;;VDGJ
 TN88D'/::FCGJ;	
g9 9FFFrt   ra   c                   @     e Zd ZdZdZdgZdgZdgZdZdZ	 fdZ
 xZS )	rb   z\
    Subclass of the `TwigLexer` that highlights unlexed data with the
    `HtmlLexer`.
    z	HTML+Twigz	html+twigz*.twigztext/html+twigr(  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   ra   r   s     rs   rp   zTwigHtmlLexer.__init__  r&  rt   r  r   s   @rs   rb   rb     si         
 DmG
I!"I
$CM: : : : : : : : :rt   rb   c                      e Zd ZdZdZdZdgZd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 )rc   z
    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.
    Angular2(https://angular.io/guide/template-syntaxng2z2.1z	[^{([*#]+r	  ngExpressionz&([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)r#  z([([]+)([\w:.-]+)([\])]+)(\s*)z([*#])([\w:.-]+)(\s*)(=)(\s*)z([*#])([\w:.-]+)(\s*)z\s+(\|\s+)?r  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   r3  r#  N)r   r   r   r   r   r   r   r   r"   r   r   r   r   r   r   r   r   r    Booleanr   r   r!   r   r   rm   rt   rs   rc   rc     s         D
4CgGM 5! XXgot<<nM 7Xk4>;hPTUU /Xk4>;EEG .Xk4>44HH&R%Xk4>488:!
* T"gov. /*FM:*FM:'(.0 (7!4=1 >XhfdHdFDQQS!
( ff%ff%(
Q- -FFFrt   rc   c                   :     e Zd ZdZdZdgZdgZdZdZ fdZ	 xZ
S )rd   z`
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML + Angular2zhtml+ng2z*.ng2r1  r  c                 R     t                      j        t          t          fi | d S r   )r   rp   r   rc   r   s     rs   rp   zAngular2HtmlLexer.__init__	  r   rt   )r   r   r   r   r   r   r   r   r   rp   r   r   s   @rs   rd   rd   
	  sa         
 DlG	I
4CM> > > > > > > > >rt   rd   c                   B     e Zd ZdZdZdgZg dZdZdZ fdZ	d Z
 xZS )	re   z
    Templated SQL lexer.
    z	SQL+Jinjaz	sql+jinja)z*.sqlz*.sql.j2z*.sql.jinja2r  z2.13c                 R     t                      j        t          t          fi | d S r   )r   rp   r   r4   r   s     rs   rp   zSqlJinjaLexer.__init__%	  r
  rt   c                     d}t          j        d|           r|dz  }t          j        d|           r|dz  }t          j        d|           r|dz  }|S )Nr   z\{\{\s*ref\(.*\)\s*\}\}r   z\{\{\s*source\(.*\)\s*\}\}r   z\{%-?\s*macro \w+\(.*\)\s*-?%\}r   r   r   s     rs   r   zSqlJinjaLexer.analyse_text(	  sf    9/66 	#IB92D99 	$JB97>> 	$JB	rt   )r   r   r   r   r   r   r   r   r   rp   r   r   r   s   @rs   re   re   	  st          DmG555I
-CM; ; ; ; ;      rt   re   )wr   r   pygments.lexers.htmlr   r   pygments.lexers.javascriptr   r   pygments.lexers.cssr   pygments.lexers.phpr   pygments.lexers.pythonr	   pygments.lexers.perlr
   pygments.lexers.jvmr   r   pygments.lexers.datar   pygments.lexers.sqlr   pygments.lexerr   r   r   r   r   r   r   r   r   pygments.tokenr   r   r   r   r   r   r   r   r    r!   r"   r#   pygments.utilr$   r%   __all__r*   r/   rT   rU   rV   r4   r>   r?   r@   rB   rA   rC   rD   rE   rF   rG   rH   r/  rJ   rK   rL   rM   r;   rI  r:   r9   r=   r<   r+   r,   r-   r.   r&   r'   r(   r)   r0   r1   r2   r3   r5   r7   r6   r8   r  rI   rN   rO   rP   rQ   r  rR   rS   rW   r  rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rm   rt   rs   <module>rG     s    
			 4 4 4 4 4 4 4 4 B B B B B B B B ( ( ( ( ( ( ( ( ( ( ( ( . . . . . . * * * * * * 7 7 7 7 7 7 7 7 * * * * * * ( ( ( ( ( (, , , , , , , , , , , , , , , , , , , , , ,I I I I I I I I I I I I I I I I I I I I I I I I I I I I > > > > > > > >  .] ] ] ] ]u ] ] ]@7 7 7 7 7* 7 7 7tQ Q Q Q QJ Q Q Qh> > > > > > > >$       0R R R R R* R R Rj+ + + + +* + + +\< < < < <o < < < ; ; ; ; ;_ ; ; ; B B B B BO B B B$; ; ; ; ;_ ; ; ; 3 3 3 3 3 3 3 3l? ? ? ? ?
 ? ? ?D: : : : :O : : : 9 9 9 9 9? 9 9 9 @ @ @ @ @/ @ @ @$9 9 9 9 9? 9 9 9$
$ 
$ 
$ 
$ 
$ 
$ 
$ 
$* * * * *: * * *Z= = = = = = = = < < < < <o < < < C C C C C_ C C C,! ! ! ! !j ! ! !H= = = = =
 = = =@8 8 8 8 8o 8 8 827 7 7 7 7/ 7 7 745 5 5 5 5O 5 5 5,5 5 5 5 5_ 5 5 5&       8    /   .2 2 2 2 2/ 2 2 2&2 2 2 2 2 2 2 2,    ?   :    /   ,2 2 2 2 2/ 2 2 2&+ + + + + + + +,    o   2    _   .5 5 5 5 5_ 5 5 5(5 5 5 5 5O 5 5 5,    o   4    _   05 5 5 5 5_ 5 5 5*5 5 5 5 5O 5 5 56    :   2       .7 7 7 7 7* 7 7 7r. . . . .o . . .&. . . . ._ . . .&0 0 0 0 0j 0 0 0f, , , , ,J , , ,^F F F F F/ F F FJ J J J J J J J       2    :   ,       .    _   8    O   0    O   4    ?   0I I I I Ij I I IX@ @ @ @ @/ @ @ @"< < < < <_ < < <&J J J J J* J J JZP P P P P
 P P Pf: : : : :O : : :"; ; ; ; ;J ; ; ;|> > > > > > > >     O     rt   