
    L&i                       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-2022 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                   d    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d
S )r*   z
    Generic ERB (Ruby Templating) lexer.

    Just highlights ruby code between the preprocessor directives, other data
    is left untouched by the lexer.

    All options are also forwarded to the `RubyLexer`.
    ERBzhttps://github.com/ruby/erberbzapplication/x-ruby-templatingz*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)c                 P    ddl m}  |di || _        t          j        | fi | d S )Nr   )	RubyLexer )pygments.lexers.rubyrj   
ruby_lexerr   __init__)selfoptionsrj   s      f/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/pygments/lexers/templates.pyrn   zErbLexer.__init__D   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   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   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 )Nrw   rx   皙?rk   r   s    rq   analyse_textzErbLexer.analyse_text   s#    4<<DDLL3 <LLrr   N)__name__
__module____qualname____doc__nameurlaliases	mimetypesrecompileMry   rn   r   r   rk   rr   rq   r*   r*   3   s          D
'CgG01I
H"$OOI( ( (
B B 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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.
    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   s    9.55 	$JB9.55 	$JB98$?? 	$JB9\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/      sm         D
#CjG	I'(I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
 
 
 
 
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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.
    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    98$	JJ 	$JB95tRYGG 	$JB9:D")LL 	$JB9 0157 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      sZ         D
(ClG#I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    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                 R     t                      j        t          t          fi | d S 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     sc          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rT   r   s     rq   rn   zVelocityXmlLexer.__init__:  s*    =<<G<<<<<rr   c                 h    t                               |           dz
  }t          |           r|dz  }|S Nr   r   )rT   r   r%   r   s     rq   r   zVelocityXmlLexer.analyse_text=  s8    ''--4$ 	#IB	rr   r   r   r   r   r   r   r   r   rn   r   r   r   s   @rq   rV   rV   .  sr          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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 <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_    9-t44@#IB9)400<#IB9^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  sW         D!G24IJI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    rr   r4   c                   8   e Zd ZdZdZdZdgZddgZdgZdd	e	fd
 e
ej        e	ej        ej         ee          ej                  fd e
ej        ej        ej         ee          ej                  fd e
ej        ej         ee          ej                  fd e
ej        ej         ee          ej                  fdej        fd e
ej         ee          ej                  fdefd e
ej         ee          e          fd e
ee          fg
iZdS )r>   z
    Generic myghty templates lexer. Code that isn't Myghty
    markup is yielded as `Token.Other`.

    .. versionadded:: 0.6
    Myghtyzhttp://www.myghty.org/myghtyz*.mytautodelegatezapplication/x-myghtyr   r   3(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)z#(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)z(<&[^|])(.*?)(,.*?)?(&>)(?s)(<&\|)(.*?)(,.*?)?(&>)</&>(?s)(<%!?)(.*?)(%>)(?<=^)#[^\n]*(\n|\Z)(?<=^)(%)([^\n]*)(\n|\Z)  (?sx)
                 (.+?)               # anything, followed by:
                 (?:
                  (?<=\n)(?=[%#]) |  # an eval or comment line
                  (?=</?[%&]) |      # a substitution or block or
                                     # call start or end
                                     # - don't consume
                  (\\\n) |           # an escaped newline
                  \Z                 # end of string
                 )N)r   r   r   r   r   r   r   r   r   r   r   r   Tagr   r   r   r	   r   r"   r   r   rk   rr   rq   r>   r>     s         D
"CjG.)I'(I 	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%
FFFrr   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                 R     t                      j        t          t          fi | d S 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?     sX          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r>   r   s     rq   rn   zMyghtyXmlLexer.__init__  *    ;::':::::rr   r   r   s   @rq   r@   r@     sX          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r>   r   s     rq   rn   zMyghtyJavascriptLexer.__init__  *    +AAAAAAArr   r   r   s   @rq   rB   rB     sm          D"K0G+ + +IB B B B B B B 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r>   r   s     rq   rn   zMyghtyCssLexer.__init__  r  rr   r   r   s   @rq   rA   rA     sX          DnG"#I; ; ; ; ; ; ; ; ;rr   rA   c                   x   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dS )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}n"t          j        d| t           j                  d}|S )Nr   z</%(class|doc|init)>g      ?z<&.+&>g)\(?r   )r   results     rq   r   zMasonLexer.analyse_text6  sA    9,d33?FFYy$	2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MMMI&'I 	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    rr   rC   c                      e Zd ZdZdZdZdgZdgZdgZd e	e
j        ej        ee          fd e	e
j        ej         ee          e          fd	 e	e
j        ej        e
j                  fd
ej        fd e	ej        ej                  dfd e	ej        ej        ej                  fdej        dfd e	ej         ee          ej                  fd e	ej         ee          ej                  fd e	ee          fde
fgdej        fdej        f ed          gd e	ej        e
e          fdej        dfde
fgdedfdedfdedfgdZdS )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 /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FFFrr   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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rD   r   s     rq   rn   zMakoHtmlLexer.__init__  *    I9999999rr   r   r   s   @rq   rE   rE     sX          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rD   r   s     rq   rn   zMakoXmlLexer.__init__  *    98888888rr   r   r   s   @rq   rF   rF     sX          DlG'(I9 9 9 9 9 9 9 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rD   r   s     rq   rn   zMakoJavascriptLexer.__init__  s*    )??w?????rr   r   r   s   @rq   rG   rG     sm          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rD   r   s     rq   rn   zMakoCssLexer.__init__  r  rr   r   r   s   @rq   rH   rH     sX          DlG !I9 9 9 9 9 9 9 9 9rr   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$rk   )r	   rp   r   r#   r   r   r~   )ro   r   pylexerpostype_values         rq   r   z)CheetahPythonLexer.get_tokens_unprocessed  s{      ----!(!?!?!E!E 	$ 	$C##ue#####	$ 	$rr   N)r   r   r   r   r   rk   rr   rq   r$  r$    s-         $ $ $ $ $rr   r$  c                   >   e Zd ZdZdZdZddgZddgZdd	gZd
d e	e
          fde
fde
j        fde
j        fd e	e
j         ee          e
j                  fd e	e
j         ee                    fd e	e
j         ee          e
j                  fdefdefg	iZdS )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 	hw" '*"GO4)*hw.@(A(A( (* (Xgouu-?'@'@AAC%Xgouu-?'@'@o' '(  TN/
FFFrr   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                 R     t                      j        t          t          fi | d S 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                 R     t                      j        t          t          fi | d S 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rJ   r   s     rq   rn   zCheetahJavascriptLexer.__init__+  s*    ,BB'BBBBBrr   r   r   s   @rq   rM   rM     st         
  D5 5 5G- - -IC C C C C C C C Crr   rM   c                   ^   e Zd ZdZdZdZdgZddgZdefd e	e
e          fd	 e	e
ej                  d
f ed          defgde
dfd ee          dfd e	ee
 ee                    dfdedfd e	ee
e          dfgd e	ej         ee          ej                  fdej        fgdZdS )r;   z8
    A lexer that highlights genshi text templates.
    zGenshi Textzhttp://genshi.edgewall.org/
genshitextzapplication/x-genshi-textztext/x-genshiz[^#$\s]+z^(\s*)(##.*)$z	^(\s*)(#)	directiver   z[#$\s]z\nr   z(?:def|for|if)\s+.*z (choose|when|with)([^\S\n]+)(.*)z(choose|otherwise)\bz(end\w*)([^\S\n]*)(.*)(?<!\$)(\$\{)(.+?)(\})z(?<!\$)(\$)([a-zA-Z_][\w.]*))r   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 % 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,]
! FFFrr   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[^"'$]+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        
 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FFFrr   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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r<  r   s     rq   rn   zHtmlGenshiLexer.__init__  s+    $5AAAAA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  sY    9\4((4#IB9&--9#IBI*4000477rr   r   r   s   @rq   r:   r:     sz         
 Dj)G444O#$IB B B B B8 8 8 8 8 8 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                 R     t                      j        t          t          fi | d S 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  sY    9\4((4#IB9&--9#IBH)$///$66rr   r   r   r   r   r   r   r   r   r   rn   r   r   r   s   @rq   r9   r9     s         
 D888G	IiO')<=IA A A A A7 7 7 7 7 7 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r;   r   s     rq   rn   zJavascriptGenshiLexer.__init__  s*    /EEWEEEEErr   c                 <    t                               |           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 F F F F5 5 5 5 5 5 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r;   r   s     rq   rn   zCssGenshiLexer.__init__  s*    ?>>g>>>>>rr   c                 <    t                               |           dz
  S rW  rY  r   s    rq   r   zCssGenshiLexer.analyse_text  rZ  rr   r   r   s   @rq   r<   r<     sq          D.GiO"#I? ? ? ? ?5 5 5 5 5 5 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r*   r   s     rq   rn   zRhtmlLexer.__init__  *    H8888888rr   c                 h    t                               |           dz
  }t          |           r|dz  }|S Nr   g      ?)r*   r   r$   r   s     rq   r   zRhtmlLexer.analyse_text  s8    ""4((4/%% 	#IB	rr   rR  r   s   @rq   r+   r+     s}          D000GI444O!"I9 9 9 9 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r*   r   s     rq   rn   zXmlErbLexer.__init__
  *    877w77777rr   c                 h    t                               |           dz
  }t          |           r|dz  }|S r   )r*   r   r%   r   s     rq   r   zXmlErbLexer.analyse_text  s8    ""4((4/$ 	#IB	rr   r   r   s   @rq   r,   r,     sq         
 D9%GiO'(I8 8 8 8 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r*   r   s     rq   rn   zCssErbLexer.__init__  rh  rr   c                 <    t                               |           dz
  S rW  r*   r   r   s    rq   r   zCssErbLexer.analyse_text!      $$T**T11rr   r   r   s   @rq   r-   r-     sq          D9%GiO !I8 8 8 8 82 2 2 2 2 2 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r*   r   s     rq   rn   zJavascriptErbLexer.__init__2  *    (>>g>>>>>rr   c                 <    t                               |           dz
  S rW  rm  r   s    rq   r   zJavascriptErbLexer.analyse_text5  rn  rr   r   r   s   @rq   r.   r.   %  s{         
 DHHHGhO) ) )I? ? ? ? ?2 2 2 2 2 2 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r   r   s     rq   rn   zHtmlPhpLexer.__init__I  rc  rr   c                 \    t          j        |           dz
  }t          |           r|dz  }|S re  )r   r   r$   r   s     rq   r   zHtmlPhpLexer.analyse_textL  s5    "4((4/%% 	#IB	rr   rR  r   s   @rq   r&   r&   9  s          DlGI% % %OI I II9 9 9 9 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   rt  ru  zapplication/xml+phpc                 R     t                      j        t          t          fi | d S r   )r   rn   r   r   r   s     rq   rn   zXmlPhpLexer.__init__]  rh  rr   c                 \    t          j        |           dz
  }t          |           r|dz  }|S r   )r   r   r%   r   s     rq   r   zXmlPhpLexer.analyse_text`  s5    "4((4/$ 	#IB	rr   r   r   s   @rq   r'   r'   S  sr          DkG666O&'I8 8 8 8 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r   r   s     rq   rn   zCssPhpLexer.__init__q  rh  rr   c                 0    t          j        |           dz
  S rW  r   r   r   s    rq   r   zCssPhpLexer.analyse_textt  s    $T**T11rr   r   r   s   @rq   r(   r(   g  sn          DkGiO I8 8 8 8 82 2 2 2 2 2 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r   r   s     rq   rn   zJavascriptPhpLexer.__init__  rq  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  sz         
 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r/   r   s     rq   rn   zHtmlSmartyLexer.__init__  r   rr   c                 h    t                               |           dz
  }t          |           r|dz  }|S re  )r/   r   r$   r   s     rq   r   zHtmlSmartyLexer.analyse_text  8    %%d++d2%% 	#IB	rr   r   r   s   @rq   r0   r0     sr          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r/   r   s     rq   rn   zXmlSmartyLexer.__init__  r  rr   c                 h    t                               |           dz
  }t          |           r|dz  }|S r   )r/   r   r%   r   s     rq   r   zXmlSmartyLexer.analyse_text  8    %%d++d2$ 	#IB	rr   r   r   s   @rq   r1   r1     sq         
 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r/   r   s     rq   rn   zCssSmartyLexer.__init__  r  rr   c                 <    t                               |           dz
  S rW  r/   r   r   s    rq   r   zCssSmartyLexer.analyse_text  rZ  rr   r   r   s   @rq   r2   r2     sq         
 DnG(O"#I; ; ; ; ;5 5 5 5 5 5 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r/   r   s     rq   rn   zJavascriptSmartyLexer.__init__  r  rr   c                 <    t                               |           dz
  S rW  r  r   s    rq   r   z"JavascriptSmartyLexer.analyse_text  rZ  rr   r   r   s   @rq   r3   r3     s         
 D"K0Gw'O+ + +IB B B B B5 5 5 5 5 5 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r4   r   s     rq   rn   zHtmlDjangoLexer.__init__  r   rr   c                 h    t                               |           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     s          D999GjjjI44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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r4   r   s     rq   rn   zXmlDjangoLexer.__init__  r  rr   c                 h    t                               |           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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r4   r   s     rq   rn   zCssDjangoLexer.__init__  r  rr   c                 <    t                               |           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; ; ; ; ;5 5 5 5 5 5 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r4   r   s     rq   rn   zJavascriptDjangoLexer.__init__1  r  rr   c                 <    t                               |           dz
  S rW  r  r   s    rq   r   z"JavascriptDjangoLexer.analyse_text4  rZ  rr   rR  r   s   @rq   r8   r8     s         
 %D/ / /GM*IhO* * *IB B B B B5 5 5 5 5 5 5rr   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).*?>[^<]+<rx   r   [\w\W]+?(?=%>|\Z)r   r  N)	r   r   r   r   r   r"   r   r   r   rk   rr   rq   r  r  8  sr          w&Su5M
 GV$!55#3#34
 FFFrr   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                 R     t                      j        t          t          fi | d S r   r   rn   r   r  r   s     rq   rn   zJspLexer.__init__\  r4  rr   c                 v    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_  sO    #D))D0$ 	#IB4<<DDLL#IB	rr   r   r   r   r   r   r   r   r   rn   r   r   r   s   @rq   rI   rI   Q  sn         
 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dS )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dS dS )z.Evoque templates use $evoque, which is unique.z$evoquert   Nrk   r   s    rq   r   zEvoqueLexer.analyse_text  s    1 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  s        
 DjGI'(I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    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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rN   r   s     rq   rn   zEvoqueHtmlLexer.__init__  r   rr   c                 6    t                               |           S r   rN   r   r   s    rq   r   zEvoqueHtmlLexer.analyse_text      ''---rr   r  r   s   @rq   rO   rO     sn          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   rN   r   s     rq   rn   zEvoqueXmlLexer.__init__  r  rr   c                 6    t                               |           S r   r  r   s    rq   r   zEvoqueXmlLexer.analyse_text  r  rr   r  r   s   @rq   rP   rP     sn          DnG	I)*I; ; ; ; ;. . . . . . .rr   rP   c                   h   e Zd ZdZdZdgZg Zg Zej	        Z
dej        fdej        fdefdefdefd	efd
efdefdefdej        dfdej        fdefdefdej        fdej        fd eej        ee          fdej        fdefdefgdej        fdej        fdej        fdej        fdej        dfgdZdS )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     sO         DgGII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# #FFFrr   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dS )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    se         DfGII 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->?
;" "FFFrr   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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r  r   s     rq   rn   zColdfusionHtmlLexer.__init__.  s+    $9EEWEEEEErr   
r   r   r   r   r   r   r   r   rn   r   r   s   @rq   rR   rR   %  sk          DgG(#I+,IF F F F F F F 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                 R     t                      j        t          t          fi | d S r   )r   rn   rR   rQ   r   s     rq   rn   zColdfusionCFCLexer.__init__=  s+    ,oIIIIIIIrr   r  r   s   @rq   rS   rS   2  se         
 DgG	IIJ J J J J J J 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                 R     t                      j        t          t          fi | d S r   r  r   s     rq   rn   zSspLexer.__init__L  r4  rr   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?rK  rw   rx   r   )r   r   r%   r   s     rq   r   zSspLexer.analyse_textO  s\    9^T** 	#IB$ 	#IB4<<DDLL#IB	rr   r  r   s   @rq   rW   rW   A  sn         
 !DgG	I$%I< < < < <      rr   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  rx   r   r  r  N)	r   r   r   r   r   r"   r   r   r   rk   rr   rq   r  r  Z  sg          w&u5M
 GV$!55#6#67
 FFFrr   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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r  r   s     rq   rn   zTeaTemplateLexer.__init__{  s+    #7CC7CCCCCrr   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     rq   r   zTeaTemplateLexer.analyse_text~  sO    &t,,t3$ 	#IB4<<DDLL#IB	rr   r  r   s   @rq   rX   rX   p  sr         
 DgG	IID D D D 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r   r   s     rq   rn   zLassoHtmlLexer.__init__  s*    J::':::::rr   c                 \    t          j        |           dz
  }t          |           r|dz  }|S re  )r   r   r$   r   s     rq   r   zLassoHtmlLexer.analyse_text  s5    $T**T1%% 	#IB	rr   r   r   s   @rq   rY   rY     s          DnG3 3 3O2 2 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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r   r   s     rq   rn   zLassoXmlLexer.__init__  s*    :9999999rr   c                 \    t          j        |           dz
  }t          |           r|dz  }|S r   )r   r   r%   r   s     rq   r   zLassoXmlLexer.analyse_text  s5    $T**T1$ 	#IB	rr   r   r   s   @rq   rZ   rZ     sx          DmG3 3 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                 \    d|d<    t                      j        t          t          fi | d S NTrequiredelimiters)r   rn   r   r   r   s     rq   rn   zLassoCssLexer.__init__  s5    '+#$:9999999rr   c                 z    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  sM    $T**T19]D)) 	#IB#IB	rr   r   r   s   @rq   r[   r[     sn          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                 \    d|d<    t                      j        t          t          fi | d S r  )r   rn   r   r   r   s     rq   rn   zLassoJavascriptLexer.__init__  s5    '+#$*@@@@@@@rr   c                 4    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\     s          D!:.GhO* * *IA A A A 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j        fdej        fd efgd!Zd"S )#r]   z
    Generic handlebars template lexer.

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

    .. versionadded:: 2.0
    
Handlebarszhttps://handlebarsjs.com/
handlebarsr   z\{\{!.*\}\}z(\{\{\{)(\s*)r   z(\{\{)([#~/]+)([^\s}]*)(\{\{)(\s*)r   z\}\}\}r   z
(~?)(\}\})z([^\s}]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()dynamic-partialgenericr   z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)r   r   z[\w-]+z[()/@a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+r   r   r   )r   r   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% 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< <FFFrr   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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r]   r   s     rq   rn   zHandlebarsHtmlLexer.__init__G  s*    O??w?????rr   r  r   s   @rq   r^   r^   :  so          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                 R     t                      j        t          t          fi | d S r   )r   rn   r   r4   r   s     rq   rn   zYamlJinjaLexer.__init__Z  r   rr   r  r   s   @rq   r_   r_   K  si          D+++GSSSI$l3I< < < < < < < < <rr   r_   c                   H   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j        fgd?ej        fd@e
fgdAej        fdBej        fgdCej        fdDej        fg ed:           ed8           ed9           ed          gdEefg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!dS )Ir`   z@
    Lexer for Liquid templates.

    .. versionadded:: 2.0
    liquidz.https://www.rubydoc.info/github/Shopify/liquidz*.liquidr   r   z
(\{%)(\s*)ztag-or-blockz(\{\{)(\s*)([^\s}]+)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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@ @ @FFFrr   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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.

    .. 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D24KE *K/L+%,J*,L ugou-W%1XgotWdGOW_dGTo' '(
6XgotWdGOW_dGTo' '( /=XgotWdDMJJ +XgotW55u>EN-
2 ,Xhdm446(<7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FFFrr   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                 R     t                      j        t          t          fi | d S 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dS )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     s         D
4CgG 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- -FFFrr   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                 R     t                      j        t          t          fi | d S 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     sW          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                 R     t                      j        t          t          fi | d S 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| t           j                  r|dz  }|S )Nr   z\{\{\s*ref\(.*\)\s*\}\}r   z\{\{\s*source\(.*\)\s*\}\}r   z?\{%-?\s*macro \w+\(.*\)\s*-?%\}\s+.*\s+\{%-?\s*endmacro\s*-?%\}r   )r   r   r   r   s     rq   r   zSqlJinjaLexer.analyse_text  sr    9/66 	#IB92D99 	$JB9ND
 
 	
 $JB	rr   )
r   r   r   r   r   r   r   rn   r   r   r   s   @rq   re   re     sj          DmG55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 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 \ \ \~6 6 6 6 6* 6 6 6rP P P P PJ P P Pf> > > > > > > >        ,P P P P P* P P Pf, , , , ,* , , ,^< < < < <o < < < ; ; ; ; ;_ ; ; ; B B B B BO B B B$; ; ; ; ;_ ; ; ; 4 4 4 4 4 4 4 4n@ @ @ @ @
 @ @ @F: : : : :O : : : 9 9 9 9 9? 9 9 9 @ @ @ @ @/ @ @ @$9 9 9 9 9? 9 9 9$
$ 
$ 
$ 
$ 
$ 
$ 
$ 
$) ) ) ) ): ) ) )X= = = = = = = =< < < < <o < < <C C C C C_ C C C(         j      F= = = = =
 = = =@8 8 8 8 8o 8 8 8.7 7 7 7 7/ 7 7 705 5 5 5 5O 5 5 5(5 5 5 5 5_ 5 5 5"       2    /   *2 2 2 2 2/ 2 2 2"2 2 2 2 2 2 2 2(    ?   4    /   (2 2 2 2 2/ 2 2 2"+ + + + + + + +(    o   .    _   *5 5 5 5 5_ 5 5 5$5 5 5 5 5O 5 5 5(    o   0    _   ,5 5 5 5 5_ 5 5 5&5 5 5 5 5O 5 5 52    :   2       .7 7 7 7 7* 7 7 7r. . . . .o . . .&. . . . ._ . . .&- - - - -j - - -`+ + + + +J + + +\
F 
F 
F 
F 
F/ 
F 
F 
FJ J J J J J J J       2    :   ,       .    _   8    O   0    O   4    ?   0J J J J Jj J J JZ@ @ @ @ @/ @ @ @"< < < < <_ < < <&K K K K K* K K K\P P P P P
 P P Pf: : : : :O : : :"< < < < <J < < <~> > > > > > > >     O     rr   