
    |e                       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      Zvy)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                   p    e Zd ZdZdZdZdgZdgZ ej                  dej                        Zd Zd Zd	 Zy
)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                 V    ddl m}  |di || _        t        j                  | fi | y )Nr   )	RubyLexer )pygments.lexers.rubyrj   
ruby_lexerr   __init__)selfoptionsrj   s      ;/usr/lib/python3/dist-packages/pygments/lexers/templates.pyrn   zErbLexer.__init__D   s%    2#.g.t'w'    c              #   j  K   | j                   j                  |      }|j                          dx}}	 	 |dk(  r-|j                         }|t        |f |t        |      z  }d}n|dk(  rl|j                         }|dv r|t        |f |dz  }d}n|dk(  rH|t        j                  |f |j                         }|dz   t        |f |dt        |      z   z  }d}nA|dv rt|t        j                  |f |t        |      z  }|j                         }d}| j                  j                  |      D ]  \  }}	}
||z   |	|
f  |t        |      z  }d}n|dv r|t        |f |t        |      z  }d}n|t        j                  |d   f d}| j                  j                  |dd	       D ]  \  }}	}
|dz   |z   |	|
f  |t        |      z  }d}nJ|dk(  rE|j                         }|dvr|t        |f n|t        j                  |f |t        |      z  }d}# t        $ r Y y	w xY w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      )z<%%z%%>   z<%#   )<%z<%=z<%-)%>z-%>N)	_block_resplitreversepopr"   lenr   Preprocrm   get_tokens_unprocessedr   
IndexError)ro   texttokensstateidxvaltagdatar_idxr_tokenr_values              rq   r   zErbLexer.get_tokens_unprocessedI   se     %%d+9	A: **,Cuc/)3s8OCEaZ **,Cn,!5#o-q !!7??C77$jjl!Agw33q3s8|+ ! 44!7??C77s3x%zz| ! $ F Ft L@3E7G"'#+w"??@ s4y( !-!5#o-s3x ! "7??CF:: ! $ F Fs12w OD3E7G"%'E/7G"CCD s3x !aZ **,C-/!5#o-!7??C773s8OCEm n  		s#   0H3G1H$ $	H0-H3/H00H3c                     d| v rd| v ryy y )Nrw   rx   皙?rk   r   s    rq   analyse_textzErbLexer.analyse_text   s    4<DDL )<rr   N)__name__
__module____qualname____doc__nameurlaliases	mimetypesrecompileMry   rn   r   r   rk   rr   rq   r*   r*   3   sJ     D
'CgG01I

H"$$OI(
BHrr   r*   c                   @   e Zd ZdZdZdZdgZdgZdg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j2                  fdefdej8                  fdej:                  fdej<                  fgdZd Z y)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)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     rq   r   zSmartyLexer.analyse_text   sk    99.5$JB99.5$JB998$?$JB99\4($JB	rr   N)!r   r   r   r   r   r   r   	filenamesr   r   	MULTILINEDOTALLflagsr"   r   r   r~   r   r   r   Functionr   Variabler   r   Constantr!   r    DoubleSingle	Attributer   r   rk   rr   rq   r/   r/      sQ    D
#CjG	I'(ILL299$E u!goow@B(goouX4'Hoo'( *goot}}d;XGGOOX.

 TNGOOW-GOOV,.&6+X6#W%5%56'(.0(&--8(&--8dnn-
F8
rr   r/   c                      e Zd ZdZdZdZdgZddg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j4                  fd!ej6                  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 y))*rT   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                 <   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     rq   r   zVelocityLexer.analyse_text  s    998$		J$JB995tRYYG$JB99:D"))L$JB99 0157$JB	rr   N)!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   rk   rr   rq   rT   rT      s0    D
(ClG#ILL299$E J goow@Bgoow/1*$'77goot}}goo{S  *${2goot}}gooFHj1
 'K.
"T)k4==17<K(FO
 NHo.Z%'7L!
 hL!Hf%
 j1TNk"(&--8(&--8&/F##W%5%56K)K(K)K(K)K(
E2Fhrr   rT   c                   :     e Zd ZdZdZdgZddgZdgZ fdZ xZ	S )rU   za
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `HtmlLexer`.

    zHTML+Velocityzhtml+velocity*.htmlr   ztext/html+velocityc                 8    t        |   t        t        fi | y N)superrn   r   rT   ro   rp   	__class__s     rq   rn   zVelocityHtmlLexer.__init__*      M=W=rr   )
r   r   r   r   r   r   alias_filenamesr   rn   __classcell__r   s   @rq   rU   rU     s3     DG+O%&I> >rr   rU   c                   @     e Zd ZdZdZdgZddgZdg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+velocity*.xmlr   zapplication/xml+velocityc                 8    t        |   t        t        fi | y r   )r   rn   r   rT   r   s     rq   rn   zVelocityXmlLexer.__init__:  s    =<G<rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S Nr   r   )rT   r   r%   r   s     rq   r   zVelocityXmlLexer.analyse_text=  s-    ''-4$#IB	rr   r   r   r   r   r   r   r   r   rn   r   r   r   s   @rq   rV   rV   .  s3     DG'O+,I=rr   rV   c                   |   e Zd ZdZdZddgZddg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j0                  fdej2                  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y$)%r4   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                     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     rq   r   zDjangoLexer.analyse_text  s\    99-t4@#IB99)40<#IB99^T*6#IB	rr   N)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   rk   rr   rq   r4   r4   D  s+    D!G24IJIDD244KE ugoou-7#5gootWdGOOwgtoo'(1gootWdGOOGOOT7Doo'( 8gootWdDMMJ +gootW5w@EN/
4 (hdmm463gtWdDMMBD5w~~FG -dll;/t}}%*FMM:*FMM:0(;'(.0
& TNHT7??;VDJ
 TN8D'//:FCJ;	
c7Frrr   r4   c                      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y)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   rk   rr   rq   r>   r>     sa    D
"CjG.)I'(I 	TNCdhhdmmTXXDk488-. 4dhhtxxK($((45 )dhhu[/A488LN*dhhu[/A488LNdhh#dhhk 2DHH=?$g.(dhhk 2E:<	  x0	2%
Frr   r>   c                   2     e Zd ZdZdZdgZdgZ fdZ x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                 8    t        |   t        t        fi | y r   )r   rn   r   r>   r   s     rq   rn   zMyghtyHtmlLexer.__init__      K;7;rr   	r   r   r   r   r   r   r   rn   r   r   s   @rq   r?   r?     s(     DoG#$I< <rr   r?   c                   2     e Zd ZdZdZdgZdgZ fdZ xZS )r@   zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.6
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtyc                 8    t        |   t        t        fi | y r   )r   rn   r   r>   r   s     rq   rn   zMyghtyXmlLexer.__init__      ;:':rr   r   r   s   @rq   r@   r@     s(     DnG)*I; ;rr   r@   c                   6     e Zd ZdZdZddgZg dZ fdZ xZS )rB   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                 8    t        |   t        t        fi | y r   )r   rn   r   r>   r   s     rq   rn   zMyghtyJavascriptLexer.__init__      +AArr   r   r   s   @rq   rB   rB     s,     D"K0G+IB Brr   rB   c                   2     e Zd ZdZdZdgZdgZ fdZ xZS )rA   zx
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.6
    z
CSS+Myghtyz
css+myghtyztext/css+myghtyc                 8    t        |   t        t        fi | y r   )r   rn   r   r>   r   s     rq   rn   zMyghtyCssLexer.__init__  r  rr   r   r   s   @rq   rA   rA     s(     DnG"#I; ;rr   rA   c                      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 Zy)rC   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                     d}t        j                  d|       d}|S t        j                  d| t         j                        d}|S )Nr   z</%(class|doc|init)>g      ?z<&.+&>g)\(?r   )r   results     rq   r   zMasonLexer.analyse_text6  sH    99,d3?F  YYy$		2>Frr   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   	Multiliner   r   r   r
   r"   r   r   r   r   rk   rr   rq   rC   rC     s    D
#CiGMI&'I 	Z *dhh 1 1488<>Cdhh
DMM488Dk488-. 6dhhdD%	2BDHHMO,dhhuY/?JL*dhhuY/?JLdhh#dhhi 0$((;=$g.(dhhi 0%8:	  i 0(;	='
FBrr   rC   c                   0   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j0                  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y)rD   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   rw   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   rk   rr   rq   rD   rD   ?  s    D
)ChG	I%&I /doowGI'doowk8JERT&doow~~tGI$g&7&78goot||4e=!goot||W__EG+>'goou['97??KMgoou['97??KM %*, TN? 
D GOO$7FEN
 *dnndF350TN	
 ff%ff%(
[2Frr   rD   c                   2     e Zd ZdZdZdgZdgZ fdZ xZS )rE   zw
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.

    .. versionadded:: 0.7
    z	HTML+Makoz	html+makoztext/html+makoc                 8    t        |   t        t        fi | y r   )r   rn   r   rD   r   s     rq   rn   zMakoHtmlLexer.__init__      I99rr   r   r   s   @rq   rE   rE     s(     DmG!"I: :rr   rE   c                   2     e Zd ZdZdZdgZdgZ fdZ xZS )rF   zv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.

    .. versionadded:: 0.7
    zXML+Makozxml+makozapplication/xml+makoc                 8    t        |   t        t        fi | y r   )r   rn   r   rD   r   s     rq   rn   zMakoXmlLexer.__init__      988rr   r   r   s   @rq   rF   rF     s(     DlG'(I9 9rr   rF   c                   6     e Zd ZdZdZddgZg dZ fdZ xZS )rG   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                 8    t        |   t        t        fi | y r   )r   rn   r   rD   r   s     rq   rn   zMakoJavascriptLexer.__init__  s    )?w?rr   r   r   s   @rq   rG   rG     s,     D ),G)I@ @rr   rG   c                   2     e Zd ZdZdZdgZdgZ fdZ xZS )rH   zv
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.

    .. versionadded:: 0.7
    zCSS+Makozcss+makoztext/css+makoc                 8    t        |   t        t        fi | y r   )r   rn   r   rD   r   s     rq   rn   zMakoCssLexer.__init__  r  rr   r   r   s   @rq   rH   rH     s(     DlG !I9 9rr   rH   c                       e Zd ZdZd Zy)CheetahPythonLexerzI
    Lexer for handling Cheetah's special $ tokens in Python syntax.
    c              #      K   t        di | j                  }|j                  |      D ]5  \  }}}|t        j                  k(  r|dk(  rt
        j                  }|||f 7 y w)N$rk   )r	   rp   r   r#   r   r   r~   )ro   r   pylexerpostype_values         rq   r   z)CheetahPythonLexer.get_tokens_unprocessed  s`     --!(!?!?!E 	$C#ue##	$s   A A"N)r   r   r   r   r   rk   rr   rq   r$  r$    s    $rr   r$  c                   X   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y)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/
    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   r~   r   r$  r"   r   r   rk   rr   rq   rJ   rJ     s     D
+C*%G7#I(*BCI 	w" '*"GOO4)*w.@(A(* (goou-?'@AC%goou-?'@oo'(  TN/
Frr   rJ   c                   6     e Zd ZdZdZg dZddg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+spitfirec                 8    t        |   t        t        fi | y r   )r   rn   r   rJ   r   s     rq   rn   zCheetahHtmlLexer.__init__	  s    L<G<rr   r   r   s   @rq   rK   rK     s)    
 D>G$&:;I= =rr   rK   c                   6     e Zd ZdZdZddgZddg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+spitfirec                 8    t        |   t        t        fi | y r   )r   rn   r   rJ   r   s     rq   rn   zCheetahXmlLexer.__init__      <;7;rr   r   r   s   @rq   rL   rL     s.    
 Dn-G*,FGI< <rr   rL   c                   6     e Zd ZdZdZg dZg 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+spitfirec                 8    t        |   t        t        fi | y r   )r   rn   r   rJ   r   s     rq   rn   zCheetahJavascriptLexer.__init__+  s    ,B'Brr   r   r   s   @rq   rM   rM     s)    
  D5G-IC Crr   rM   c                   N   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y)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   r9  r   N)r   r   r   r   r   r   r   r   r"   r   r   r   r~   r   r   r	   r   r   r   r   rk   rr   rq   r;   r;   /  s     D
'CnG,o>I % xg678D'//:KHJ
 D&!#U;%7@0gtU;%78&B$gv6&$(H&Q
 'goou['97??KM,]]
!Frr   r;   c                      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y) 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@  rB  rC  r   N)r   r   r   r   r   r   r   r"   r   r   r~   r   r	   r   r   r   r   r   r    r   r   rk   rr   rq   r<  r<  R  s   
 IIE %goou['97??KM 8?#TXXw7"DHHe4Je

 TNT^^X6&)
 HVU;-?H&QHVU;-?H&Q(
 TNt~~x8T^^V4&)	
 &.)&.)(
 &&!I&M
 &&!I&M
  J

 'goou['97??KM-]]
_5Frr   r<  c                   B     e Zd ZdZdZddgZg dZdgZ fdZd Z	 xZ
S )	r:   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                 8    t        |   t        t        fi | y r   )r   rn   r   r<  r   s     rq   rn   zHtmlGenshiLexer.__init__  s    $5AArr   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     rq   r   zHtmlGenshiLexer.analyse_text  sW    99\4(4#IB99&-9#IBI**400477rr   r   r   s   @rq   r:   r:     s1    
 Dj)G4O#$IB8rr   r:   c                   H     e Zd ZdZdZg dZdgZdgZddgZ fdZ	d	 Z
 xZS )
r9   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                 8    t        |   t        t        fi | y r   )r   rn   r   r<  r   s     rq   rn   zGenshiLexer.__init__  s    #4@@rr   c                     d}t        j                  d|       |dz  }t        j                  d|       |dz  }|t        j                  |       z   dz
  S rJ  )r   r   r   r   r   s     rq   r   zGenshiLexer.analyse_text  sW    99\4(4#IB99&-9#IBH))$//$66rr   r   r   r   r   r   r   r   r   r   rn   r   r   r   s   @rq   r9   r9     s8    
 D8G	IiO')<=IA7rr   r9   c                   B     e Zd ZdZdZg dZdgZg 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+genshi*.js)zapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshic                 8    t        |   t        t        fi | y r   )r   rn   r   r;   r   s     rq   rn   zJavascriptGenshiLexer.__init__  s    /EWErr   c                 2    t         j                  |       dz
  S N皙?r9   r   r   s    rq   r   z"JavascriptGenshiLexer.analyse_text      ''-44rr   r   r   s   @rq   r=   r=     s/     $D$GhO+IF5rr   r=   c                   @     e Zd ZdZdZddgZdgZdg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+genshi*.cssztext/css+genshic                 8    t        |   t        t        fi | y r   )r   rn   r   r;   r   s     rq   rn   zCssGenshiLexer.__init__  s    ?>g>rr   c                 2    t         j                  |       dz
  S rW  rY  r   s    rq   r   zCssGenshiLexer.analyse_text  rZ  rr   r   r   s   @rq   r<   r<     s2     D.GiO"#I?5rr   r<   c                   H     e Zd ZdZdZg dZdgZg dZdg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*.rhtmlrE  ztext/html+rubyc                 8    t        |   t        t        fi | y r   )r   rn   r   r*   r   s     rq   rn   zRhtmlLexer.__init__      H88rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S Nr   g      ?)r*   r   r$   r   s     rq   r   zRhtmlLexer.analyse_text  s-    ""4(4/%#IB	rr   rR  r   s   @rq   r+   r+     s2     D0GI4O!"I9rr   r+   c                   @     e Zd ZdZdZddgZdgZdg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+erbr   zapplication/xml+rubyc                 8    t        |   t        t        fi | y r   )r   rn   r   r*   r   s     rq   rn   zXmlErbLexer.__init__
      87w7rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S r   )r*   r   r%   r   s     rq   r   zXmlErbLexer.analyse_text  -    ""4(4/$#IB	rr   r   r   s   @rq   r,   r,     s2    
 D9%GiO'(I8rr   r,   c                   @     e Zd ZdZdZddgZdgZdg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+erbr\  ztext/css+rubyc                 8    t        |   t        t        fi | y r   )r   rn   r   r*   r   s     rq   rn   zCssErbLexer.__init__  rh  rr   c                 2    t         j                  |       dz
  S rW  r*   r   r   s    rq   r   zCssErbLexer.analyse_text!      $$T*T11rr   r   r   s   @rq   r-   r-     s2     D9%GiO !I82rr   r-   c                   B     e Zd ZdZdZg dZdgZg 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+erbrT  )zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyc                 8    t        |   t        t        fi | y r   )r   rn   r   r*   r   s     rq   rn   zJavascriptErbLexer.__init__2      (>g>rr   c                 2    t         j                  |       dz
  S rW  rn  r   s    rq   r   zJavascriptErbLexer.analyse_text5  ro  rr   r   r   s   @rq   r.   r.   %  s,    
 DHGhO)I?2rr   r.   c                   H     e Zd ZdZdZdgZdgZg dZg 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*.phtml)*.phpr   rF  rG  
*.php[345])zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5c                 8    t        |   t        t        fi | y r   )r   rn   r   r   r   s     rq   rn   zHtmlPhpLexer.__init__I  rc  rr   c                 V    t        j                  |       dz
  }t        |       r|dz  }|S re  )r   r   r$   r   s     rq   r   zHtmlPhpLexer.analyse_textL  s-    ""4(4/%#IB	rr   rR  r   s   @rq   r&   r&   9  s6     DlGI%OII9rr   r&   c                   @     e Zd ZdZdZdgZg dZdg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+php)r   ru  rv  zapplication/xml+phpc                 8    t        |   t        t        fi | y r   )r   rn   r   r   r   s     rq   rn   zXmlPhpLexer.__init__]  rh  rr   c                 V    t        j                  |       dz
  }t        |       r|dz  }|S r   )r   r   r%   r   s     rq   r   zXmlPhpLexer.analyse_text`  rj  rr   r   r   s   @rq   r'   r'   S  s-     DkG6O&'I8rr   r'   c                   >     e Zd ZdZdZdgZdgZdg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+phpr\  ztext/css+phpc                 8    t        |   t        t        fi | y r   )r   rn   r   r   r   s     rq   rn   zCssPhpLexer.__init__q  rh  rr   c                 2    t        j                  |       dz
  S rW  r   r   r   s    rq   r   zCssPhpLexer.analyse_textt  ro  rr   r   r   s   @rq   r(   r(   g  s/     DkGiO I82rr   r(   c                   B     e Zd ZdZdZddgZdgZg 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+phprT  )zapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpc                 8    t        |   t        t        fi | y r   )r   rn   r   r   r   s     rq   rn   zJavascriptPhpLexer.__init__  rr  rr   c                 ,    t        j                  |       S r   r  r   s    rq   r   zJavascriptPhpLexer.analyse_text  s    $$T**rr   r   r   s   @rq   r)   r)   x  s1    
 D*GhO(I?+rr   r)   c                   @     e Zd ZdZdZdgZg dZdg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+smarty)r   rF  rG  r   ztext/html+smartyc                 8    t        |   t        t        fi | y r   )r   rn   r   r/   r   s     rq   rn   zHtmlSmartyLexer.__init__  r   rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S re  )r/   r   r$   r   s     rq   r   zHtmlSmartyLexer.analyse_text  -    %%d+d2%#IB	rr   r   r   s   @rq   r0   r0     s-     DoG=O#$I<rr   r0   c                   @     e Zd ZdZdZdgZddgZdg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+smartyr   r   zapplication/xml+smartyc                 8    t        |   t        t        fi | y r   )r   rn   r   r/   r   s     rq   rn   zXmlSmartyLexer.__init__  r  rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S r   )r/   r   r%   r   s     rq   r   zXmlSmartyLexer.analyse_text  -    %%d+d2$#IB	rr   r   r   s   @rq   r1   r1     s2    
 DnG(O)*I;rr   r1   c                   @     e Zd ZdZdZdgZddgZdg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+smartyr\  r   ztext/css+smartyc                 8    t        |   t        t        fi | y r   )r   rn   r   r/   r   s     rq   rn   zCssSmartyLexer.__init__  r  rr   c                 2    t         j                  |       dz
  S rW  r/   r   r   s    rq   r   zCssSmartyLexer.analyse_text  rZ  rr   r   r   s   @rq   r2   r2     s2    
 DnG(O"#I;5rr   r2   c                   D     e Zd ZdZdZddgZddgZg 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+smartyrT  r   )zapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartyc                 8    t        |   t        t        fi | y r   )r   rn   r   r/   r   s     rq   rn   zJavascriptSmartyLexer.__init__  r  rr   c                 2    t         j                  |       dz
  S rW  r  r   s    rq   r   z"JavascriptSmartyLexer.analyse_text  rZ  rr   r   r   s   @rq   r3   r3     s5    
 D"K0Gw'O+IB5rr   r3   c                   L     e Zd ZdZdZg dZg dZg dZddg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.jinja2rE  ztext/html+djangoztext/html+jinjac                 8    t        |   t        t        fi | y r   )r   rn   r   r4   r   s     rq   rn   zHtmlDjangoLexer.__init__  r   rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S re  )r4   r   r$   r   s     rq   r   zHtmlDjangoLexer.analyse_text  r  rr   rR  r   s   @rq   r5   r5     s3     D9GjI4O#%67I<rr   r5   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
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.jinja2r   zapplication/xml+djangozapplication/xml+jinjac                 8    t        |   t        t        fi | y r   )r   rn   r   r4   r   s     rq   rn   zXmlDjangoLexer.__init__  r  rr   c                 V    t         j                  |       dz
  }t        |       r|dz  }|S r   )r4   r   r%   r   s     rq   r   zXmlDjangoLexer.analyse_text  r  rr   rR  r   s   @rq   r7   r7     s?    
 D[)G^,IiO)+BCI;rr   r7   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
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.jinja2r\  ztext/css+djangoztext/css+jinjac                 8    t        |   t        t        fi | y r   )r   rn   r   r4   r   s     rq   rn   zCssDjangoLexer.__init__  r  rr   c                 2    t         j                  |       dz
  S rW  r4   r   r   s    rq   r   zCssDjangoLexer.analyse_text  rZ  rr   rR  r   s   @rq   r6   r6     s?    
 D[)G^,IiO"$45I;5rr   r6   c                   J     e Zd ZdZdZg dZddgZdgZg 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.jinja2rT  )zapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjac                 8    t        |   t        t        fi | y r   )r   rn   r   r4   r   s     rq   rn   zJavascriptDjangoLexer.__init__1  r  rr   c                 2    t         j                  |       dz
  S rW  r  r   s    rq   r   z"JavascriptDjangoLexer.analyse_text4  rZ  rr   rR  r   s   @rq   r8   r8     s9    
 %D/GM*IhO*IB5rr   r8   c                   N    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y)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).*?>[^<]+<rx   r   [\w\W]+?(?=%>|\Z)r   r  N)	r   r   r   r   r   r"   r   r   r   rk   rr   rq   r  r  8  sW     w&Su5M
 GV$!5#34
Frr   r  c                   >     e Zd ZdZdZdgZdgZdgZ fdZd Z	 xZ
S )rI   zA
    Lexer for Java Server Pages.

    .. versionadded:: 0.7
    zJava Server Pagejspz*.jspzapplication/x-jspc                 8    t        |   t        t        fi | y r   r   rn   r   r  r   s     rq   rn   zJspLexer.__init__\  r4  rr   c                 p    t        j                  |       dz
  }t        |       r|dz  }d| v r	d| v r|dz  }|S Nr   r   rw   rx   r   )r   r   r%   r   s     rq   r   zJspLexer.analyse_text_  sC    ##D)D0$#IB4<DDL#IB	rr   r   r   r   r   r   r   r   r   rn   r   r   r   s   @rq   rI   rI   Q  s/    
 DgG	I$%I<rr   rI   c                      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 Zy)rN   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   r  c                     d| v ryy)z.Evoque templates use $evoque, which is unique.z$evoquert   Nrk   r   s    rq   r   zEvoqueLexer.analyse_text  s     rr   )r   r   r   r   r   r   r   r   r   r   r   r"   r   r  r   r   r   r   r    r   r	   r   r   rk   rr   rq   rN   rN   h  sl   
 DjGI'(IIIE W&&	2e!2!237k4<<dk+,!k4<<deK0+?@
 2k4<<dK(+78 "8K#FG5k4{);llD$=> 5M9
> ))*W&&0W&&/w(()	
?%FNrr   rN   c                   >     e Zd ZdZdZdgZdgZdgZ fdZd Z	 xZ
S )rO   zy
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 1.1
    zHTML+Evoquezhtml+evoquer   ztext/html+evoquec                 8    t        |   t        t        fi | y r   )r   rn   r   rN   r   s     rq   rn   zEvoqueHtmlLexer.__init__  r   rr   c                 ,    t         j                  |       S r   rN   r   r   s    rq   r   zEvoqueHtmlLexer.analyse_text      ''--rr   r  r   s   @rq   rO   rO     s/     DoG
I#$I<.rr   rO   c                   >     e Zd ZdZdZdgZdgZdgZ fdZd Z	 xZ
S )rP   zx
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.

    .. versionadded:: 1.1
    z
XML+Evoquez
xml+evoquer   zapplication/xml+evoquec                 8    t        |   t        t        fi | y r   )r   rn   r   rN   r   s     rq   rn   zEvoqueXmlLexer.__init__  r  rr   c                 ,    t         j                  |       S r   r  r   s    rq   r   zEvoqueXmlLexer.analyse_text  r  rr   r  r   s   @rq   rP   rP     s/     DnG	I)*I;.rr   rP   c                      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j2                  fdefdefgdej                   fdej4                  fdej                   fdej                   fdej                   dfgdZy)rQ   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[^"#]+r  r   )r   r  N)r   r   r   r   r   r   r   r   r   
IGNORECASEr   r   r   r  r   r    r   r!   r   r   r   r   r   r   r   r   Interpr   rk   rr   rq   rQ   rQ     sR    DgGIIMME ( '"3"34"H%h'x 2H="H6==(+ v}}%VMNUW $W%5%56T]](dmmT;79t}}- +.TN3
8 FMM"v}}%&6==!6==&)
9#Frr   rQ   c                      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y)ColdfusionMarkupLexerz 
    Coldfusion markup only
    
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)<[^<>]*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   rQ   r   r   rk   rr   rq   r  r    s?    DfGII uFO
 w((+6(t||Z88dllE/$:DLLIKQ dllE/$:DLLI	K
 Xk53I&13 4 f5FOU#5M	
 w(('2g''0+W->->?
;"Frr   r  c                   :     e Zd ZdZdZdgZddgZdgZ fdZ xZ	S )rR   z#
    Coldfusion markup in html
    zColdfusion HTMLcfmz*.cfmz*.cfmlzapplication/x-coldfusionc                 8    t        |   t        t        fi | y r   )r   rn   r   r  r   s     rq   rn   zColdfusionHtmlLexer.__init__.  s    $9EWErr   
r   r   r   r   r   r   r   r   rn   r   r   s   @rq   rR   rR   %  s4     DgG(#I+,IF Frr   rR   c                   6     e Zd ZdZdZdgZdgZg Z fdZ xZ	S )rS   zH
    Coldfusion markup/script components

    .. versionadded:: 2.0
    zColdfusion CFCcfcz*.cfcc                 8    t        |   t        t        fi | y r   )r   rn   rR   rQ   r   s     rq   rn   zColdfusionCFCLexer.__init__=  s    ,oIIrr   r  r   s   @rq   rS   rS   2  s.    
 DgG	IIJ Jrr   rS   c                   >     e Zd ZdZdZdgZdgZdgZ fdZd Z	 xZ
S )rW   zD
    Lexer for Scalate Server Pages.

    .. versionadded:: 1.4
    zScalate Server Pagesspz*.sspzapplication/x-sspc                 8    t        |   t        t        fi | y r   r  r   s     rq   rn   zSspLexer.__init__L  r4  rr   c                 z    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?rK  rw   rx   r   )r   r   r%   r   s     rq   r   zSspLexer.analyse_textO  sJ    99^T*#IB$#IB4<DDL#IB	rr   r  r   s   @rq   rW   rW   A  s/    
 !DgG	I$%I<rr   rW   c                   H    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y
)TeaTemplateRootLexerz
    Base for the `TeaTemplateLexer`. Yields `Token.Other` for area outside of
    code blocks.

    .. versionadded:: 1.5
    r  r  r  r  rx   r   r  r  N)	r   r   r   r   r   r"   r   r   r   rk   rr   rq   r  r  Z  sL     w&u5M
 GV$!5#67
Frr   r  c                   >     e Zd ZdZdZdgZdgZdgZ fdZd Z	 xZ
S )rX   zW
    Lexer for `Tea Templates <http://teatrove.org/>`_.

    .. versionadded:: 1.5
    Teateaz*.teaz
text/x-teac                 8    t        |   t        t        fi | y r   )r   rn   r   r  r   s     rq   rn   zTeaTemplateLexer.__init__{  s    #7C7Crr   c                 p    t        j                  |       dz
  }t        |       r|dz  }d| v r	d| v r|dz  }|S r  )r   r   r%   r   s     rq   r   zTeaTemplateLexer.analyse_text~  sC    &&t,t3$#IB4<DDL#IB	rr   r  r   s   @rq   rX   rX   p  s/    
 DgG	IIDrr   rX   c                   B     e Zd ZdZdZdgZg dZg 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.

    .. versionadded:: 1.6
    z
HTML+Lassoz
html+lasso)r   rF  rG  *.lasso*.lasso[89]*.incl*.inc*.las)ztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]c                 8    t        |   t        t        fi | y r   )r   rn   r   r   r   s     rq   rn   zLassoHtmlLexer.__init__  s    J:':rr   c                 V    t        j                  |       dz
  }t        |       r|dz  }|S re  )r   r   r$   r   s     rq   r   zLassoHtmlLexer.analyse_text  s-    $$T*T1%#IB	rr   r   r   s   @rq   rY   rY     s.     DnG3O2I;rr   rY   c                   @     e Zd ZdZdZdgZg dZdgZ fdZd Z	 xZ
S )rZ   zz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.

    .. versionadded:: 1.6
    z	XML+Lassoz	xml+lasso)r   r  r  r  r  r  zapplication/xml+lassoc                 8    t        |   t        t        fi | y r   )r   rn   r   r   r   s     rq   rn   zLassoXmlLexer.__init__  s    :99rr   c                 V    t        j                  |       dz
  }t        |       r|dz  }|S r   )r   r   r%   r   s     rq   r   zLassoXmlLexer.analyse_text  s-    $$T*T1$#IB	rr   r   r   s   @rq   rZ   rZ     s/     DmG3O()I:rr   rZ   c                   >     e Zd ZdZdZdgZdgZdgZ fdZd Z	 xZ
S )r[   zz
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.

    .. versionadded:: 1.6
    z	CSS+Lassoz	css+lassor\  ztext/css+lassoc                 B    d|d<   t        |   t        t        fi | y NTrequiredelimiters)r   rn   r   r   r   s     rq   rn   zLassoCssLexer.__init__  s"    '+#$:99rr   c                 ~    t        j                  |       dz
  }t        j                  d|       r|dz  }d| v r|dz  }|S )NrX  z
\w+:[^;]+;r   zpadding:)r   r   r   r   r   s     rq   r   zLassoCssLexer.analyse_text  sD    $$T*T199]D)#IB#IB	rr   r   r   s   @rq   r[   r[     s/     DmGiO!"I:rr   r[   c                   B     e Zd ZdZdZddgZdgZg dZ fdZd Z	 xZ
S )	r\   z
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.

    .. versionadded:: 1.6
    zJavaScript+Lassozjavascript+lassozjs+lassorT  )zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassoc                 B    d|d<   t        |   t        t        fi | y r  )r   rn   r   r   r   s     rq   rn   zLassoJavascriptLexer.__init__  s"    '+#$*@@rr   c                 6    t        j                  |       dz
  }|S rW  )r   r   r   s     rq   r   z!LassoJavascriptLexer.analyse_text  s    $$T*T1	rr   r   r   s   @rq   r\   r\     s2     D!:.GhO*IArr   r\   c                      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            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j2                  fdej4                  fd efgd!Zy")#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   r  r   r  N)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   rk   rr   rq   r]   r]     s    D
%CnG u W% x>F (goov'7'79I9IJESXgoot<eD
  TN0HVW__=vF ht~~x@A )(7D'*JK"HWdDMM$JKhwkB  I!
& TNK(+Xgt6:mmT.K L"HWd-24z-J%L M&I
 #DMM2$--(-t}}=
 J +FMM:*FMM:'(.0
g<Frr   r]   c                   <     e Zd ZdZdZdgZddgZddgZ fdZ x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                 8    t        |   t        t        fi | y r   )r   rn   r   r]   r   s     rq   rn   zHandlebarsHtmlLexer.__init__G  s    O?w?rr   r  r   s   @rq   r^   r^   :  s8     D !G)I')EFI@ @rr   r^   c                   >     e Zd ZdZdZg dZg dZddg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.

    .. 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                 8    t        |   t        t        fi | y r   )r   rn   r   r4   r   s     rq   rn   zYamlJinjaLexer.__init__Z  r   rr   r  r   s   @rq   r_   r_   K  s-     D+GSI$l3I< <rr   r_   c                      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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d/      gd0d1 e	eede      dfd2 e	eej,                  e      dfgd(d"e
dfgdd3e
d%fgd/d4edfgd5 ed      d6 e	ej.                  ee      fd7 e	e
e ee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j0                  fgd?ej2                  fd@e
fgdAej6                  fdBej8                  fgdCej<                  fdDej>                  fg ed:       ed8       ed9       ed      gdEefgdF e	e
eej$                  ee
      d%fd<e fgdefdG e	e
eej$                  ee
      dfdefgdHZ!y)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}]+)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   Reservedr   r   r   r   r   r   Wordr   r   r   r    r   r   r!   FloatIntegerr   r   rk   rr   rq   r`   r`   ^  s   
 D
:CjGI@tH[*=~N$k:uT9/MN DM	
@ 	-w/?/?MXg&6&6
CnlI>@ g&&
K@&J 2dhh
E$
,K +/068 $dhh
K8)Edhh
K8%A 0g&&j+FP(dhhj+>H 3dhh
D	2KM"$ : >M=
@Z 	L!k6*K+	
[@h 	L!k#34#dmm[*=P	
i@x 	K(L!*+
y@D 	N#L!?eD)4j( %i"@*!#$ X':eD)4j(-- %i"@BC IL!
E@h 	I'(
i@r 	'j(D*=vG(j(--<fF
s@@ 	k6*
A@H 	["23
I@P 	Z(
Q@Z 	L!$dnnj(;= /k:uT:/N +/0 HHI;
[@z 	N#4L!
{@D 	 N#J4L"
E@P 	["23*+
Q@Z 	["23+, 
[@f 	 '"2"23
g@p dmm,-
 ''
 &,,'V^^$
 IHHJ	
 
#
 1k:txx!#$46 7O	
 t,k:txx!#$*, DM
s@Frr   r`   c                      e Zd ZdZdZdgZdg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z   eej"                  eeeej,                        dfd eej"                  ee      dfdefgdez   eeeej,                        fdez   eeeeeej,                        fdej0                  fdefdej2                  feej4                  fdez   ej4                  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!y%)&ra   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   _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   rk   rr   rq   ra   ra   ,  s`    DhG%&IDD244KE *K/L+%,J*,L ugoou-W%1gootWdGOOW__dGToo'(
6gootWdGOOW__dGToo'( /=gootWdDMMJ +gootW5u>EN-
2 ,hdmm46(<7gtWdDMMBD,gnn=5 	
 &t||44==)\!4==1&!*FMM:*FMM:DhO'(.0%
, TNHT7??;VDJ
 TN8D'//:FCJ;	
g9Frr   ra   c                   8     e Zd ZdZdZdgZdgZdgZ fdZ xZ	S )rb   zw
    Subclass of the `TwigLexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    z	HTML+Twigz	html+twigz*.twigztext/html+twigc                 8    t        |   t        t        fi | y r   )r   rn   r   ra   r   s     rq   rn   zTwigHtmlLexer.__init__  r  rr   r  r   s   @rq   rb   rb     s/     DmG
I!"I: :rr   rb   c                      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y)rc   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	[^{([*#]+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   r  r  N)r   r   r   r   r   r   r   r"   r   r   r~   r   r   r   r   r   r    Booleanr   r   r!   r   r   rk   rr   rq   rc   rc     sr    D
4CgG 5! Xgoot<nM 7k4>>;hPTU /k4>>;EG .k4>>44H&R%k4>>48:!
* T"goov. /*FMM:*FMM:'(.0 (7!4==1 >hfdHdFDQS!
( ff%ff%(
Q-Frr   rc   c                   2     e Zd ZdZdZdgZdgZ fdZ xZS )rd   z{
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.

    .. versionadded:: 2.0
    zHTML + Angular2zhtml+ng2z*.ng2c                 8    t        |   t        t        fi | y r   )r   rn   r   rc   r   s     rq   rn   zAngular2HtmlLexer.__init__  r   rr   )	r   r   r   r   r   r   r   rn   r   r   s   @rq   rd   rd     s'     DlG	I> >rr   rd   c                   :     e Zd ZdZdZdgZg dZ fdZd Z xZ	S )re   z:
    Templated SQL lexer.

    .. versionadded:: 2.13
    z	SQL+Jinjaz	sql+jinja)z*.sqlz*.sql.j2z*.sql.jinja2c                 8    t        |   t        t        fi | y r   )r   rn   r   r4   r   s     rq   rn   zSqlJinjaLexer.__init__  r  rr   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     rq   r   zSqlJinjaLexer.analyse_text  sT    99/6#IB992D9$JB997>$JB	rr   )
r   r   r   r   r   r   r   rn   r   r   r   s   @rq   re   re     s%     DmG5I;rr   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;   r<  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   rk   rr   rq   <module>r.     s   
 4 B ( ( . * 7 * (, , ,I I I I >.\u \~6* 6rPJ Pf> >  ,P* Pf,* ,^<o < ;_ ; BO B$;_ ; 4 4n@
 @F:O : 9? 9 @/ @$9? 9$
$ 
$): )X= =<o <C_ C( j  F=
 =@8o 8.7/ 705O 5(5_ 5" 2/ *2/ 2"2 2(? 4/ (2/ 2"+ +(o ._ *5_ 5$5O 5(o 0_ ,5_ 5&5O 52: 2 .7* 7r.o .&._ .&-j -`+J +\
F/ 
FJ J 2: , ._ 8O 0O 4? 0Jj JZ@/ @"<_ <&K* K\P
 Pf:O :"<J <~> > O rr   