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

    Lexers for various template engines' markup.

    :copyright: Copyright 2006-present 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                   @   sN   e Zd ZdZdZdZdgZdgZdZe	 
de	j¡Zdd	„ Zd
d„ Zdd„ ZdS )r)   zÙ
    Generic ERB (Ruby Templating) lexer.

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

    All options are also forwarded to the `RubyLexer`.
    ÚERBúhttps://github.com/ruby/erbÚerbzapplication/x-ruby-templatingÚ z*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)c                 K   s2   ddl m} |f i |¤Ž| _tj| fi |¤Ž d S )Nr   )Ú	RubyLexer)Zpygments.lexers.rubyri   Ú
ruby_lexerr   Ú__init__)ÚselfÚoptionsri   © rn   ú?E:\soccer\ml_env\Lib\site-packages\pygments/lexers/templates.pyrk   E   s    zErbLexer.__init__c                 c   s   | j  |¡}| ¡  d }}�zæ|dkrN| ¡ }|t|fV  |t|ƒ7 }d}q |dk�rº| ¡ }|dv r„|t|fV  |d7 }d}�q |dkrÈ|tj|fV  | ¡ }|d t|fV  |dt|ƒ 7 }d}nð|dv �r4|tj|fV  |t|ƒ7 }| ¡ }d}| j 	|¡D ]\}}	}
|| |	|
fV  �q|t|ƒ7 }d}n„|dv �r\|t
|fV  |t|ƒ7 }d}n\|tj|d fV  d}| j 	|dd	… ¡D ] \}}	}
|d | |	|
fV  �q†|t|ƒ7 }d}q |dkr | ¡ }|dv�râ|t|fV  n|tj|fV  |t|ƒ7 }d}q W n t�y   Y d	S 0 d	S )
z¡
        Since ERB doesn't allow "<%" and other tags inside of ruby
        blocks we have to use a split approach here that fails for
        that too.
        r   é   )z<%%z%%>é   z<%#é   )ú<%z<%=z<%-)ú%>z-%>N)Ú	_block_reÚsplitÚreverseÚpopr!   Úlenr   ÚPreprocrj   Úget_tokens_unprocessedr   Ú
IndexError)rl   ÚtextÚtokensÚstateÚidxÚvalÚtagÚdataZr_idxZr_tokenZr_valuern   rn   ro   r{   J   sf    


ÿ
ÿ

zErbLexer.get_tokens_unprocessedc                 C   s   d| v rd| v rdS d S )Nrs   rt   çš™™™™™Ù?rn   ©r}   rn   rn   ro   Úanalyse_textŽ   s    zErbLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ	mimetypesÚversion_addedÚreÚcompileÚMru   rk   r{   r†   rn   rn   rn   ro   r)   3   s   	Dr)   c                   @   sò   e Zd ZdZdZdZdgZdgZdgZdZ	e
je
jB Zdefd	eejeejƒfd
eejeedd�ejƒfdeejejeƒdfdejdfgdefdejdfdejdfdejfdejfdefdejfdefdejfdejfdejfgdœZ dd„ Z!dS )r.   z�
    Generic Smarty template lexer.

    Just highlights smarty code between the preprocessor directives, other
    data is left untouched by the lexer.
    ÚSmartyúhttps://www.smarty.net/Úsmartyú*.tplzapplication/x-smartyrh   ú[^{]+z(\{)(\*.*?\*)(\})z(\{php\})(.*?)(\{/php\})T)Zstartinlinez(\{)(/?[a-zA-Z_]\w*)(\s*)ú\{ú\s+ú#pushú\}ú#popz#[a-zA-Z_]\w*#z\$[a-zA-Z_]\w*(\.\w+)*z[~!%^&*()+=|\[\]:;,.<>/?@-]ú(true|false|null)\bú>[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?ú"(\\\\|\\[^\\]|[^"\\])*"ú'(\\\\|\\[^\\]|[^'\\])*'ú[a-zA-Z_]\w*)Úrootr•   c                 C   sX   d}t  d| ¡r|d7 }t  d| ¡r,|d7 }t  d| ¡r@|d7 }t  d| ¡rT|d7 }|S )Nç        z\{if\s+.*?\}.*?\{/if\}ç333333Ã?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}ç{®Gáz„?©r�   Úsearch©r}   Úrvrn   rn   ro   r†   À   s    zSmartyLexer.analyse_textN)"r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   Ú	filenamesrŽ   r�   r�   Ú	MULTILINEÚDOTALLÚflagsr!   r   r   rz   r   r   r   ÚFunctionr   ÚVariabler   r   ÚConstantr    r   ÚDoubleÚSingleÚ	Attributer~   r†   rn   rn   rn   ro   r.   “   sL   ÿÿÿÿ
÷

ÿôôr.   c                   @   s’  e Zd ZdZdZdZdgZddgZdZe	j
e	jB ZdZd	efd
eejeejƒfdeejeƒfde d eejejejeƒdfde d eejejejƒfdedfgeejfdedfde d eeejƒdfdedfedƒgdefdedfde d ejfedƒgdefedƒdedfgdedfdefd efd!ejfd"ejfd#efd$efd%ejfdedfd&edfd'edfdedfdedfdedfgd(œZ d)d*„ Z!d+S ),rS   z›
    Generic Velocity template lexer.

    Just highlights velocity directives and variable references, other
    data is left untouched by the lexer.
    ÚVelocityúhttps://velocity.apache.org/Úvelocityú*.vmú*.fhtmlrh   r¡   z[^{#$]+z(#)(\*.*?\*)(#)z
(##)(.*?$)z(#\{?)(z)(\}?)(\s?\()Údirectiveparamsz)(\}|\b)z\$!?\{?Úvariablez\(Ú
funcparamsz(\.)(ú)rš   r›   rœ   z=(&&|\|\||==?|!=?|[-<>+*%&|^/])|\b(eq|ne|gt|lt|ge|le|not|in)\bz\[Úrangeoperatorz\bz\.\.z\]r™   z[,:]rŸ   r    z0[xX][0-9a-fA-F]+[Ll]?z
\b[0-9]+\br�   ú\)r˜   )r¢   rº   r¹   r½   r»   c                 C   sd   d}t  d| t j¡r|d7 }t  d| t j¡r4|d7 }t  d| t j¡rL|d7 }t  d| ¡r`|d7 }|S )	Nr£   z #\{?macro\}?\(.*?\).*?#\{?end\}?ç      Ð?z#\{?if\}?\(.+?\).*?#\{?end\}?r¤   z"#\{?foreach\}?\(.+?\).*?#\{?end\}?z6\$!?\{?[a-zA-Z_]\w*(\([^)]*\))?(\.\w+(\([^)]*\))?)*\}?r¥   ©r�   r§   r¬   r¨   rn   rn   ro   r†     s    ÿzVelocityLexer.analyse_textN)"r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   rª   r�   r�   r«   r¬   r­   Ú
identifierr!   r   r   rz   r   r®   r   r¯   r   r   r   r   r   r±   r²   r    r   r°   r~   r†   rn   rn   rn   ro   rS   Í   sx   ÿ
ÿ
þ
ÿõ
ÿú	ÿûýòÞ4rS   c                       s@   e Zd ZdZdZdgZdZddgZdgZdZ	‡ fd	d
„Z
‡  ZS )rT   za
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `HtmlLexer`.

    zHTML+Velocityzhtml+velocityrh   ú*.htmlr¸   ztext/html+velocityrµ   c                    s   t ƒ jttfi |¤Ž d S ©N)Úsuperrk   r   rS   ©rl   rm   ©Ú	__class__rn   ro   rk   /  s    zVelocityHtmlLexer.__init__)r‡   rˆ   r‰   rŠ   r‹   r�   r�   Úalias_filenamesrŽ   rŒ   rk   Ú__classcell__rn   rn   rÆ   ro   rT   !  s   rT   c                       sH   e Zd ZdZdZdgZdZddgZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )rU   z`
    Subclass of the `VelocityLexer` that highlights unlexed data
    with the `XmlLexer`.

    zXML+Velocityzxml+velocityrh   ú*.xmlr·   zapplication/xml+velocityrµ   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rS   rÅ   rÆ   rn   ro   rk   A  s    zVelocityXmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S ©Nr¥   r„   )rS   r†   r$   r¨   rn   rn   ro   r†   D  s    zVelocityXmlLexer.analyse_text©r‡   rˆ   r‰   rŠ   r‹   r�   r�   rÈ   rŽ   rŒ   rk   r†   rÉ   rn   rn   rÆ   ro   rU   3  s   rU   c                   @   s„  e Zd ZdZdZddgZddgZdZdZe	j
e	jB Zd	efd
ejdfdefdeejeeeejeejeeeejƒfdeejeeeejeejeeeejƒfdeejeeeejƒdfdeejeeƒdfdefgdeeeejƒfdeeeeeejƒfdejfdefdejfdejfdejfdejfdejfdefdefgdefdeeejƒd fed!ƒgdefd"eeejƒd fed!ƒd#efgd$œZd%d&„ Z d'S )(r3   a  
    Generic `Django <https://www.djangoproject.com/documentation/templates/>`_
    and `Jinja <https://jinja.palletsprojects.com>`_ template lexer.

    It just highlights django/jinja code between the preprocessor directives,
    other data is left untouched by the lexer.
    zDjango/JinjaÚdjangoÚjinjazapplication/x-django-templatingzapplication/x-jinjaú5https://www.djangoproject.com/documentation/templatesrh   r—   ú\{\{Úvarz	\{#.*?#\}zJ(\{%)(-?\s*)(comment)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endcomment)(\s*-?)(%\})úB(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})z'(\{%)(-?\s*)(filter)(\s+)([a-zA-Z_]\w*)Úblockú(\{%)(-?\s*)([a-zA-Z_]\w*)r˜   z(\|)(\s*)([a-zA-Z_]\w*)z#(is)(\s+)(not)?(\s+)?([a-zA-Z_]\w*)z%(_|true|false|none|True|False|None)\bzm(in|as|reversed|recursive|not|and|or|is|if|else|import|with(?:(?:out)?\s*context)?|scoped|ignore\s+missing)\bz(loop|block|super|forloop)\bz[a-zA-Z_][\w-]*z\.\w+ú:?"(\\\\|\\[^\\]|[^"\\])*"ú:?'(\\\\|\\[^\\]|[^'\\])*'z ([{}()\[\]+\-*/%,:~]|[><=]=?|!=)rž   r™   ú
(-?)(\}\})rœ   Úvarnamesú	(-?)(%\})Ú.)r¢   rØ   rÑ   rÓ   c                 C   sP   d}t  d| ¡d ur|d7 }t  d| ¡d ur4|d7 }t  d| ¡d urL|d7 }|S )Nr£   z\{%\s*(block|extends)r„   z\{%\s*if\s*.*?%\}çš™™™™™¹?z\{\{.*?\}\}r¦   r¨   rn   rn   ro   r†   •  s    zDjangoLexer.analyse_textN)!r‡   rˆ   r‰   rŠ   r‹   r�   rŽ   rŒ   r�   r�   r’   ÚSr­   r!   r   rz   r   r   r   r   r®   r   ÚPseudoÚBuiltinr¯   r   r±   r²   r    r   r   r~   r†   rn   rn   rn   ro   r3   K  s|   
þþþþþÿéÿÿþÿñýüÏ9r3   c                   @   sô   e Zd ZdZdZdZdgZddgZdgZdZ	d	d
e
fdeeje
ejejeeƒejƒfdeejejejeeƒejƒfdeejejeeƒejƒfdeejejeeƒejƒfdejfdeejeeƒejƒfdefdeejeeƒeƒfdeeeƒfg
iZdS )r=   zh
    Generic myghty templates lexer. Code that isn't Myghty
    markup is yielded as `Token.Other`.
    ÚMyghtyúhttp://www.myghty.org/Úmyghtyz*.mytÚautodelegatezapplication/x-myghtyú0.6r¢   r™   ú3(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)z#(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)z(<&[^|])(.*?)(,.*?)?(&>)ú(?s)(<&\|)(.*?)(,.*?)?(&>)ú</&>ú(?s)(<%!?)(.*?)(%>)ú^#[^\n]*(\n|\Z)ú^(%)([^\n]*)(\n|\Z)áË  (?sx)
                 (.+?)               # anything, followed by:
                 (?:
                  (?<=\n)(?=[%#]) |  # an eval or comment line
                  (?=</?[%&]) |      # a substitution or block or
                                     # call start or end
                                     # - don't consume
                  (\\\n) |           # an escaped newline
                  \Z                 # end of string
                 )N)r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   rª   rŽ   r�   r   r   r   ÚTagr®   r   r   r   r   r!   r   r~   rn   rn   rn   ro   r=      sL   
ÿÿ
ÿÿÿÿÿÿ	÷îÿr=   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	r>   z^
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `HtmlLexer`.
    zHTML+Myghtyzhtml+myghtyztext/html+myghtyrà   rã   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r=   rÅ   rÆ   rn   ro   rk   Ú  s    zMyghtyHtmlLexer.__init__©r‡   rˆ   r‰   rŠ   r‹   r�   rŽ   rŒ   r�   rk   rÉ   rn   rn   rÆ   ro   r>   Î  s   r>   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	r?   z]
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtyrà   rã   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r=   rÅ   rÆ   rn   ro   rk   ê  s    zMyghtyXmlLexer.__init__rì   rn   rn   rÆ   ro   r?   Þ  s   r?   c                       s<   e Zd ZdZdZddgZg d¢ZdZdZ‡ fdd	„Z	‡  Z
S )
rA   zd
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Myghtyzjavascript+myghtyz	js+myghty)zapplication/x-javascript+myghtyztext/x-javascript+myghtyztext/javascript+mygthyrà   rã   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r=   rÅ   rÆ   rn   ro   rk   ü  s    zMyghtyJavascriptLexer.__init__rì   rn   rn   rÆ   ro   rA   î  s   rA   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	r@   z]
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.
    z
CSS+Myghtyz
css+myghtyztext/css+myghtyrà   rã   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r=   rÅ   rÆ   rn   ro   rk     s    zMyghtyCssLexer.__init__rì   rn   rn   rÆ   ro   r@      s   r@   c                   @   s  e Zd ZdZdZdZdgZg d¢ZdgZdZ	dd	e
fd
eejejejƒfdeeje
ejejeeƒejƒfdeejdddeeƒejƒfdeejejeeƒejƒfdeejejeeƒejƒfdejfdeejeeƒejƒfdefdeejeeƒeƒfdeeeƒeƒfgiZdd„ ZdS )rB   zl
    Generic mason templates lexer. Stolen from Myghty lexer. Code that isn't
    Mason markup is HTML.
    ÚMasonzhttp://www.masonhq.com/Úmason)z*.mz*.mhtmlz*.mcz*.miÚautohandlerÚdhandlerzapplication/x-masonú1.4r¢   r™   z(?s)(<%doc>)(.*?)(</%doc>)rä   z%(?s)(<%(\w+)(.*?)(>))(.*?)(</%\2\s*>)Nz(?s)(<&[^|])(.*?)(,.*?)?(&>)rå   ræ   rç   rè   ré   rê   c                 C   s6   d}t  d| ¡d urd}nt  d| t j¡d ur2d}|S )Nr£   z</%(class|doc|init)>g      ð?z<&.+&>g)\�Âõ(¼?rÀ   )r}   Úresultrn   rn   ro   r†   =  s    zMasonLexer.analyse_text)r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   rª   rŽ   r�   r   r   r   rë   r   Ú	Multiliner®   r   r   r	   r!   r   r   r~   r†   rn   rn   rn   ro   rB     sP   ÿ
ÿÿÿÿÿÿÿ	÷íÿ!rB   c                   @   s@  e Zd ZdZdZdZdgZdgZdgZdZ	de
ejejeeƒfd	e
ejejeeƒeƒfd
e
ejejejƒfdejfde
ejejƒdfde
ejejejƒfdejdfde
ejeeƒejƒfde
ejeeƒejƒfde
eeƒfdefgdejfdejfedƒgde
ejeeƒfdejdfdefgdedfdedfdedfgdœZdS )rC   zd
    Generic mako templates lexer. Code that isn't Mako
    markup is yielded as `Token.Other`.
    ÚMakoúhttp://www.makotemplates.org/Úmakoz*.maozapplication/x-makoú0.7z(\s*)(%)(\s*end(?:\w+))(\n|\Z)z(\s*)(%)([^\n]*)(\n|\Z)z(\s*)(##[^\n]*)(\n|\Z)z(?s)<%doc>.*?</%doc>z(<%)([\w.:]+)r‚   z(</%)([\w.:]+)(>)z<%(?=([\w.:]+))Ú	ondeftagsz(?s)(<%(?:!?))(.*?)(%>)z(\$\{)(.*?)(\})a\  (?sx)
                (.+?)                # anything, followed by:
                (?:
                 (?<=\n)(?=%|\#\#) | # an eval or comment line
                 (?=\#\*) |          # multiline comment
                 (?=</?%) |          # a python block
                                     # call start or end
                 (?=\$\{) |          # a substitution
                 (?<=\n)(?=\s*%) |
                                     # - don't consume
                 (\\\n) |            # an escaped newline
                 \Z                  # end of string
                )
            r™   rs   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   rz   r   r!   r   r   r²   ró   r   rÞ   r   r   r³   r   r~   rn   rn   rn   ro   rC   F  sd   ÿÿÿÿÿ
ÿÿóá"ýÿ
üýÓrC   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	rD   z\
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.
    z	HTML+Makoz	html+makoztext/html+makorõ   r÷   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rC   rÅ   rÆ   rn   ro   rk   ”  s    zMakoHtmlLexer.__init__rì   rn   rn   rÆ   ro   rD   ˆ  s   rD   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	rE   z[
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Makozxml+makozapplication/xml+makorõ   r÷   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rC   rÅ   rÆ   rn   ro   rk   ¤  s    zMakoXmlLexer.__init__rì   rn   rn   rÆ   ro   rE   ˜  s   rE   c                       s<   e Zd ZdZdZddgZg d¢ZdZdZ‡ fdd	„Z	‡  Z
S )
rF   zb
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Makozjavascript+makozjs+mako)zapplication/x-javascript+makoztext/x-javascript+makoztext/javascript+makorõ   r÷   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rC   rÅ   rÆ   rn   ro   rk   ¶  s    zMakoJavascriptLexer.__init__rì   rn   rn   rÆ   ro   rF   ¨  s   rF   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	rG   z[
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.
    zCSS+Makozcss+makoztext/css+makorõ   r÷   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rC   rÅ   rÆ   rn   ro   rk   Æ  s    zMakoCssLexer.__init__rì   rn   rn   rÆ   ro   rG   º  s   rG   c                   @   s   e Zd ZdZdd„ ZdS )ÚCheetahPythonLexerzI
    Lexer for handling Cheetah's special $ tokens in Python syntax.
    c                 c   sN   t f i | j¤Ž}| |¡D ].\}}}|tjkr<|dkr<tj}|||fV  qd S )Nú$)r   rm   r{   r"   r   r   rz   )rl   r}   ZpylexerÚposÚtype_Úvaluern   rn   ro   r{   Ñ  s
    z)CheetahPythonLexer.get_tokens_unprocessedN)r‡   rˆ   r‰   rŠ   r{   rn   rn   rn   ro   rþ   Ì  s   rþ   c                   @   s¦   e Zd ZdZdZdZddgZddgZdd	gZd
Z	dde
eƒfdefdejfdejfde
ejeeƒejƒfde
ejeeƒƒfde
ejeeƒejƒfdefdefg	iZdS )rI   zô
    Generic cheetah templates lexer. Code that isn't Cheetah
    markup is yielded as `Token.Other`.  This also works for
    `spitfire templates`_ which use the same syntax.

    .. _spitfire templates: http://code.google.com/p/spitfire/
    ÚCheetahúhttp://www.cheetahtemplate.org/ÚcheetahÚspitfirez*.tmplz*.sptzapplication/x-cheetahzapplication/x-spitfirerh   r¢   z(##[^\n]*)$z#[*][\s\S]*?[*]#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   rz   r   rþ   r!   r   r~   rn   rn   rn   ro   rI   Ù  sB   ÿÿÿÿÿÿùéÿrI   c                       s<   e Zd ZdZdZg d¢ZddgZdZdZ‡ fdd	„Z	‡  Z
S )
rJ   z_
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `HtmlLexer`.
    zHTML+Cheetah)zhtml+cheetahzhtml+spitfireÚhtmlcheetahztext/html+cheetahztext/html+spitfirer  rh   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rI   rÅ   rÆ   rn   ro   rk     s    zCheetahHtmlLexer.__init__rì   rn   rn   rÆ   ro   rJ     s   rJ   c                       s<   e Zd ZdZdZddgZddgZdZdZ‡ fd	d
„Z	‡  Z
S )rK   z^
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Cheetahzxml+cheetahzxml+spitfirezapplication/xml+cheetahzapplication/xml+spitfirer  rh   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rI   rÅ   rÆ   rn   ro   rk   "  s    zCheetahXmlLexer.__init__rì   rn   rn   rÆ   ro   rK     s   rK   c                       s<   e Zd ZdZdZg d¢Zg d¢ZdZdZ‡ fdd„Z	‡  Z
S )	rL   ze
    Subclass of the `CheetahLexer` that highlights unlexed data
    with the `JavascriptLexer`.
    zJavaScript+Cheetah)zjavascript+cheetahz
js+cheetahzjavascript+spitfirezjs+spitfire)z application/x-javascript+cheetahztext/x-javascript+cheetahztext/javascript+cheetahz!application/x-javascript+spitfireztext/x-javascript+spitfireztext/javascript+spitfirer  rh   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rI   rÅ   rÆ   rn   ro   rk   8  s    zCheetahJavascriptLexer.__init__rì   rn   rn   rÆ   ro   rL   &  s   rL   c                
   @   sÂ   e Zd ZdZdZdZdgZddgZdZde	fd	e
eeƒfd
e
eejƒdfedƒde	fgdedfdeeƒdfde
eeeeƒƒdfdedfde
eeeƒdfgde
ejeeƒejƒfdejfgdœZdS )r:   z8
    A lexer that highlights genshi text templates.
    zGenshi Textúhttps://genshi.edgewall.org/Ú
genshitextzapplication/x-genshi-textztext/x-genshirh   z[^#$\s]+z^(\s*)(##.*)$z	^(\s*)(#)Ú	directiverº   z[#$\s]z\nrœ   z(?:def|for|if)\s+.*z (choose|when|with)([^\S\n]+)(.*)z(choose|otherwise)\bz(end\w*)([^\S\n]*)(.*)ú(?<!\$)(\$\{)(.+?)(\})z(?<!\$)(\$)([a-zA-Z_][\w.]*))r¢   r
  rº   N)r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   rŽ   r�   r!   r   r   r   rz   r   r   r   r   r   r¯   r~   rn   rn   rn   ro   r:   <  s8   ûÿú	ÿÿýðr:   c                   @   sH  e Zd ZdZejZdefdee	j
eeƒe	j
ƒfdefdejdfdejdfed	ƒd
efgdefdejdfdejdfgdeeeeƒeƒdfdeeeeƒeƒdfdedfgdefdejdfdejdfdejdfgdedfdedfdedfgdedfedƒdefgdedfedƒdefgdefed	ƒgdee	j
eeƒe	j
ƒfdejfgdœ	ZdS ) ÚGenshiMarkupLexerzX
    Base lexer for Genshi markup, used by `HtmlGenshiLexer` and
    `GenshiLexer`.
    z[^<$]+z(<\?python)(.*?)(\?>)z'<\s*(script|style)\s*.*?>.*?<\s*/\1\s*>z<\s*py:[a-zA-Z0-9]+Úpytagz<\s*[a-zA-Z0-9:.]+r‚   rº   z[<$]r™   z[\w:-]+\s*=Úpyattrrù   rœ   z(")(.*?)(")z(')(.*?)(')rü   zpy:[\w-]+\s*=rý   ú"úattr-dstringú'úattr-sstringz[^\s>]*Ústringsz[^"'$]+r  z(?<!\$)(\$)([a-zA-Z_][\w\.]*))	r¢   r  r  r‚   rý   r  r  r  rº   N)r‡   rˆ   r‰   rŠ   r�   r¬   r­   r!   r   r   rz   r   r   r   rë   r   r   r³   r   r¯   r~   rn   rn   rn   ro   r  `  s`   ÿ

÷

ýý


üýýýþÿÿýÑr  c                       sJ   e Zd ZdZdZddgZdZg d¢ZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r9   zŠ
    A lexer that highlights `genshi <https://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid HTML templates.
    zHTML+Genshizhtml+genshizhtml+kidrh   ©rÂ   ú*.htmú*.xhtmlztext/html+genshir  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r  rÅ   rÆ   rn   ro   rk   ­  s    zHtmlGenshiLexer.__init__c                 C   sF   d}t  d| ¡d ur|d7 }t  d| ¡d ur4|d7 }|t | ¡ d S ©Nr£   z	\$\{.*?\}çš™™™™™É?zpy:(.*?)=["\']r¥   )r�   r§   r   r†   r¨   rn   rn   ro   r†   °  s    zHtmlGenshiLexer.analyse_textrÌ   rn   rn   rÆ   ro   r9      s   r9   c                       sP   e Zd ZdZdZg d¢ZdgZdZdgZddgZ	d	Z
‡ fd
d„Zdd„ Z‡  ZS )r8   z‰
    A lexer that highlights `genshi <https://genshi.edgewall.org/>`_ and
    `kid <http://kid-templating.org/>`_ kid XML templates.
    ÚGenshi)ÚgenshiÚkidz
xml+genshizxml+kidz*.kidrh   rÊ   zapplication/x-genshizapplication/x-kidr  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r  rÅ   rÆ   rn   ro   rk   Ç  s    zGenshiLexer.__init__c                 C   sF   d}t  d| ¡d ur|d7 }t  d| ¡d ur4|d7 }|t | ¡ d S r  )r�   r§   r   r†   r¨   rn   rn   ro   r†   Ê  s    zGenshiLexer.analyse_text©r‡   rˆ   r‰   rŠ   r‹   r�   rª   r�   rÈ   rŽ   rŒ   rk   r†   rÉ   rn   rn   rÆ   ro   r8   ¹  s   r8   c                       sJ   e Zd ZdZdZg d¢ZdZdgZg d¢ZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )r<   zK
    A lexer that highlights javascript code in genshi text templates.
    zJavaScript+Genshi Text)zjs+genshitextz	js+genshizjavascript+genshitextzjavascript+genshirh   ú*.js)zapplication/x-javascript+genshiztext/x-javascript+genshiztext/javascript+genshiúhttps://genshi.edgewall.orgc                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r:   rÅ   rÆ   rn   ro   rk   â  s    zJavascriptGenshiLexer.__init__c                 C   s   t  | ¡d S ©Nçš™™™™™©?©r8   r†   r…   rn   rn   ro   r†   å  s    z"JavascriptGenshiLexer.analyse_textrÌ   rn   rn   rÆ   ro   r<   Ó  s   r<   c                       sH   e Zd ZdZdZddgZdZdgZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r;   zK
    A lexer that highlights CSS definitions in genshi text templates.
    zCSS+Genshi Textzcss+genshitextz
css+genshirh   ú*.cssztext/css+genshir  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r:   rÅ   rÆ   rn   ro   rk   õ  s    zCssGenshiLexer.__init__c                 C   s   t  | ¡d S r  r!  r…   rn   rn   ro   r†   ø  s    zCssGenshiLexer.analyse_textrÌ   rn   rn   rÆ   ro   r;   é  s   r;   c                       sP   e Zd ZdZdZg d¢ZdgZdZg d¢ZdgZ	dZ
‡ fd	d
„Zdd„ Z‡  ZS )r*   z�
    Subclass of the ERB lexer that highlights the unlexed data with the
    html lexer.

    Nested Javascript and CSS is highlighted too.
    ÚRHTML)Úrhtmlzhtml+erbz	html+rubyz*.rhtmlrh   r  ztext/html+rubyrf   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r)   rÅ   rÆ   rn   ro   rk     s    zRhtmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S ©Nr¥   g      à?)r)   r†   r#   r¨   rn   rn   ro   r†     s    zRhtmlLexer.analyse_textr  rn   rn   rÆ   ro   r*   ü  s   r*   c                       sH   e Zd ZdZdZddgZdZdgZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r+   zo
    Subclass of `ErbLexer` which highlights data outside preprocessor
    directives with the `XmlLexer`.
    zXML+Rubyzxml+rubyzxml+erbrh   rÊ   zapplication/xml+rubyrf   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r)   rÅ   rÆ   rn   ro   rk   %  s    zXmlErbLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rË   )r)   r†   r$   r¨   rn   rn   ro   r†   (  s    zXmlErbLexer.analyse_textrÌ   rn   rn   rÆ   ro   r+     s   r+   c                       sH   e Zd ZdZdZddgZdZdgZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r,   zS
    Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
    zCSS+Rubyzcss+rubyzcss+erbrh   r"  ztext/css+rubyrf   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r)   rÅ   rÆ   rn   ro   rk   ;  s    zCssErbLexer.__init__c                 C   s   t  | ¡d S r  ©r)   r†   r…   rn   rn   ro   r†   >  s    zCssErbLexer.analyse_textrÌ   rn   rn   rÆ   ro   r,   /  s   r,   c                       sJ   e Zd ZdZdZg d¢ZdZdgZg d¢ZdZ	‡ fdd	„Z
d
d„ Z‡  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+erbrh   r  )zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyrf   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r)   rÅ   rÆ   rn   ro   rk   Q  s    zJavascriptErbLexer.__init__c                 C   s   t  | ¡d S r  r&  r…   rn   rn   ro   r†   T  s    zJavascriptErbLexer.analyse_textrÌ   rn   rn   rÆ   ro   r-   B  s   r-   c                       sP   e Zd ZdZdZdgZdgZdZg d¢Zg d¢Z	dZ
‡ fd	d
„Zdd„ Z‡  ZS )r%   zˆ
    Subclass of `PhpLexer` that highlights unhandled data with the `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+PHPzhtml+phpz*.phtmlrh   )ú*.phprÂ   r  r  ú
*.php[345])zapplication/x-phpzapplication/x-httpd-phpzapplication/x-httpd-php3zapplication/x-httpd-php4zapplication/x-httpd-php5úhttps://www.php.netc                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   k  s    zHtmlPhpLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r%  )r   r†   r#   r¨   rn   rn   ro   r†   n  s    zHtmlPhpLexer.analyse_textr  rn   rn   rÆ   ro   r%   X  s   r%   c                       sH   e Zd ZdZdZdgZdZg d¢ZdgZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )r&   zT
    Subclass of `PhpLexer` that highlights unhandled data with the `XmlLexer`.
    zXML+PHPzxml+phprh   )rÊ   r'  r(  zapplication/xml+phpr)  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   �  s    zXmlPhpLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rË   )r   r†   r$   r¨   rn   rn   ro   r†   „  s    zXmlPhpLexer.analyse_textrÌ   rn   rn   rÆ   ro   r&   u  s   r&   c                       sF   e Zd ZdZdZdgZdZdgZdgZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )r'   zU
    Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
    zCSS+PHPzcss+phprh   r"  ztext/css+phpr)  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   —  s    zCssPhpLexer.__init__c                 C   s   t  | ¡d S r  ©r   r†   r…   rn   rn   ro   r†   š  s    zCssPhpLexer.analyse_textrÌ   rn   rn   rÆ   ro   r'   ‹  s   r'   c                       sJ   e Zd ZdZdZddgZdZdgZg d¢ZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r(   z`
    Subclass of `PhpLexer` which highlights unmatched data with the
    `JavascriptLexer`.
    zJavaScript+PHPzjavascript+phpzjs+phprh   r  )zapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phpr)  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   ­  s    zJavascriptPhpLexer.__init__c                 C   s
   t  | ¡S rÃ   r*  r…   rn   rn   ro   r†   °  s    zJavascriptPhpLexer.analyse_textrÌ   rn   rn   rÆ   ro   r(   ž  s   r(   c                       sH   e Zd ZdZdZdgZdZg d¢ZdgZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )r/   z‘
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Smartyzhtml+smartyrh   )rÂ   r  r  r–   ztext/html+smartyr”   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r.   rÅ   rÆ   rn   ro   rk   Ã  s    zHtmlSmartyLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r%  )r.   r†   r#   r¨   rn   rn   ro   r†   Æ  s    zHtmlSmartyLexer.analyse_textrÌ   rn   rn   rÆ   ro   r/   ´  s   r/   c                       sH   e Zd ZdZdZdgZdZddgZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r0   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Smartyz
xml+smartyrh   rÊ   r–   zapplication/xml+smartyr”   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r.   rÅ   rÆ   rn   ro   rk   Ú  s    zXmlSmartyLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rË   )r.   r†   r$   r¨   rn   rn   ro   r†   Ý  s    zXmlSmartyLexer.analyse_textrÌ   rn   rn   rÆ   ro   r0   Í  s   r0   c                       sH   e Zd ZdZdZdgZdZddgZdgZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r1   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `CssLexer`.
    z
CSS+Smartyz
css+smartyrh   r"  r–   ztext/css+smartyr”   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r.   rÅ   rÆ   rn   ro   rk   ñ  s    zCssSmartyLexer.__init__c                 C   s   t  | ¡d S r  ©r.   r†   r…   rn   rn   ro   r†   ô  s    zCssSmartyLexer.analyse_textrÌ   rn   rn   rÆ   ro   r1   ä  s   r1   c                       sL   e Zd ZdZdZddgZdZddgZg d¢Zd	Z	‡ fd
d„Z
dd„ Z‡  ZS )r2   zd
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Smartyzjavascript+smartyz	js+smartyrh   r  r–   )zapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartyr”   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r.   rÅ   rÆ   rn   ro   rk     s    zJavascriptSmartyLexer.__init__c                 C   s   t  | ¡d S r  r+  r…   rn   rn   ro   r†   
  s    z"JavascriptSmartyLexer.analyse_textrÌ   rn   rn   rÆ   ro   r2   ø  s   r2   c                       sT   e Zd ZdZdZg d¢Zg d¢ZdZg d¢ZddgZ	d	Z
‡ fd
d„Zdd„ Z‡  ZS )r4   z‘
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `HtmlLexer`.

    Nested Javascript and CSS is highlighted too.
    zHTML+Django/Jinja)zhtml+djangoz
html+jinjaÚ
htmldjango)z	*.html.j2z*.htm.j2z
*.xhtml.j2z*.html.jinja2z*.htm.jinja2z*.xhtml.jinja2rh   r  ztext/html+djangoztext/html+jinjarÏ   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r3   rÅ   rÆ   rn   ro   rk     s    zHtmlDjangoLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r%  )r3   r†   r#   r¨   rn   rn   ro   r†   !  s    zHtmlDjangoLexer.analyse_textr  rn   rn   rÆ   ro   r4     s   r4   c                       sR   e Zd ZdZdZddgZddgZdZdgZd	d
gZ	dZ
‡ fdd„Zdd„ Z‡  ZS )r6   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `XmlLexer`.
    zXML+Django/Jinjaz
xml+djangoz	xml+jinjaz*.xml.j2z*.xml.jinja2rh   rÊ   zapplication/xml+djangozapplication/xml+jinjarÏ   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r3   rÅ   rÆ   rn   ro   rk   6  s    zXmlDjangoLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rË   )r3   r†   r$   r¨   rn   rn   ro   r†   9  s    zXmlDjangoLexer.analyse_textr  rn   rn   rÆ   ro   r6   (  s   r6   c                       sR   e Zd ZdZdZddgZddgZdZdgZd	d
gZ	dZ
‡ fdd„Zdd„ Z‡  ZS )r5   z]
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `CssLexer`.
    zCSS+Django/Jinjaz
css+djangoz	css+jinjaz*.css.j2z*.css.jinja2rh   r"  ztext/css+djangoztext/css+jinjarÏ   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r3   rÅ   rÆ   rn   ro   rk   N  s    zCssDjangoLexer.__init__c                 C   s   t  | ¡d S r  ©r3   r†   r…   rn   rn   ro   r†   Q  s    zCssDjangoLexer.analyse_textr  rn   rn   rÆ   ro   r5   @  s   r5   c                       sR   e Zd ZdZdZg d¢ZddgZdZdgZg d¢Z	d	Z
‡ fd
d„Zdd„ Z‡  ZS )r7   zd
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Django/Jinja)zjavascript+djangoz	js+djangozjavascript+jinjazjs+jinjaz*.js.j2z*.js.jinja2rh   r  )zapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjarÏ   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r3   rÅ   rÆ   rn   ro   rk   i  s    zJavascriptDjangoLexer.__init__c                 C   s   t  | ¡d S r  r-  r…   rn   rn   ro   r†   l  s    z"JavascriptDjangoLexer.analyse_textr  rn   rn   rÆ   ro   r7   U  s   r7   c                   @   sF   e Zd ZdZdedfdefdefdefgdedfd	eeƒfgd
œZdS )ÚJspRootLexerzt
    Base for the `JspLexer`. Yields `Token.Other` for area outside of
    JSP tags.

    .. versionadded:: 0.7
    ú<%\S?ÚseczC</?jsp:(forward|getProperty|include|plugin|setProperty|useBean).*?>ú[^<]+ú<rt   rœ   ú[\w\W]+?(?=%>|\Z)©r¢   r0  N)	r‡   rˆ   r‰   rŠ   r   r!   r   r
   r~   rn   rn   rn   ro   r.  p  s   	ÿú	
ý÷r.  c                       sF   e Zd ZdZdZdgZdgZdgZdZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rH   z&
    Lexer for Java Server Pages.
    zJava Server PageÚjspz*.jspzapplication/x-jspz.https://projects.eclipse.org/projects/ee4j.jspr÷   c                    s   t ƒ jttfi |¤Ž d S rÃ   ©rÄ   rk   r   r.  rÅ   rÆ   rn   ro   rk   ”  s    zJspLexer.__init__c                 C   s:   t  | ¡d }t| ƒr|d7 }d| v r6d| v r6|d7 }|S ©Nr¥   r„   rs   rt   rÛ   )r
   r†   r$   r¨   rn   rn   ro   r†   —  s    zJspLexer.analyse_text©r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŽ   rŒ   r�   rk   r†   rÉ   rn   rn   rÆ   ro   rH   ‰  s   rH   c                   @   s  e Zd ZdZdZdgZdgZdgZdZdZ	e
jZdefd	ejd
fdefdejfdeeejedeeƒfdeeejedeeeƒeƒfdeeejedeeƒeƒfdeeejƒfdeedeeƒejddeƒfdefg
dejfd	ejdfdejdfdejfgdœZdd„ ZdS )rM   z7
    For files using the Evoque templating system.
    ÚEvoqueÚevoquez*.evoquezapplication/x-evoqueúhttps://gizmojo.org/templatingú1.1z[^#$]+z#\[Úcommentz\$\$z\$\w+:[^$\n]*\$z'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})Nz>(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+)?(.*?)((?(4)%)\})z!(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})z(\$)(else|rof|fi)z%(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})ú#z[^\]#]rš   z\]#rœ   z[\]#])r¢   r=  c                 C   s   d| v rdS dS )z.Evoque templates use $evoque, which is unique.z$evoquerp   Nrn   r…   rn   rn   ro   r†   Ô  s    zEvoqueLexer.analyse_text)r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŽ   rŒ   r�   r�   r¬   r­   r!   r   ró   r   r   r   rÞ   r   r   r   r~   r†   rn   rn   rn   ro   rM      sT   
ÿÿ
ÿþÿÿ
ÿÿä

üá'rM   c                       sF   e Zd ZdZdZdgZdgZdgZdZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rN   z^
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML+Evoquezhtml+evoquerÂ   ztext/html+evoquer;  r<  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rM   rÅ   rÆ   rn   ro   rk   å  s    zEvoqueHtmlLexer.__init__c                 C   s
   t  | ¡S rÃ   ©rM   r†   r…   rn   rn   ro   r†   è  s    zEvoqueHtmlLexer.analyse_text©r‡   rˆ   r‰   rŠ   r‹   r�   rÈ   rŽ   rŒ   r�   rk   r†   rÉ   rn   rn   rÆ   ro   rN   Ù  s   rN   c                       sF   e Zd ZdZdZdgZdgZdgZdZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rO   z]
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Evoquez
xml+evoquerÊ   zapplication/xml+evoquer;  r<  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rM   rÅ   rÆ   rn   ro   rk   ø  s    zEvoqueXmlLexer.__init__c                 C   s
   t  | ¡S rÃ   r?  r…   rn   rn   ro   r†   û  s    zEvoqueXmlLexer.analyse_textr@  rn   rn   rÆ   ro   rO   ì  s   rO   c                   @   sð   e Zd ZdZdZdgZg Zg ZdZdZ	e
jZdejfdejfdefd	efd
efdefdefdefdefdejdfdejfdefdefdejfdejfdeejeeƒfdejfdefdefgdejfdejfdejfdejfdejdfgdœZd S )!rP   z
    Coldfusion statements
    ÚcfstatementÚcfsú5https://www.adobe.com/products/coldfusion-family.htmlrh   z//.*?\nz/\*[\s\S]*?\*/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¢   rD  N)r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŽ   rŒ   r�   r�   Ú
IGNORECASEr­   r   r²   ró   r   r   r±   r    r   r°   r   r   r®   r   r   r¯   ZInterpr~   rn   rn   rn   ro   rP   ÿ  sR   
þÿÿç
ûärP   c                
   @   sÜ   e Zd ZdZdZdgZg Zg ZdZde	fe
dƒde	fgdejd	fd
efdejdfdeejeeƒejƒfdeejeeƒejƒfgde	fdeeeeƒeƒfdejdfe
dƒde	fde	fgdejdfdejdfdejfgdœZdS )ÚColdfusionMarkupLexerz 
    Coldfusion markup only
    Z
ColdfusionÚcfrC  r1  Ú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¢   rI  rK  rJ  N)r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŽ   rŒ   r!   r   r   ró   r   rÞ   r   r   rP   r   r~   rn   rn   rn   ro   rG  2  sD   ý

ÿüùÿ
ø

ýãrG  c                       s@   e Zd ZdZdZdgZddgZdgZdZdZ	‡ fd	d
„Z
‡  ZS )rQ   z#
    Coldfusion markup in html
    zColdfusion HTMLÚcfmz*.cfmz*.cfmlzapplication/x-coldfusionrC  rh   c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rG  rÅ   rÆ   rn   ro   rk   l  s    zColdfusionHtmlLexer.__init__©r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŽ   rŒ   r�   rk   rÉ   rn   rn   rÆ   ro   rQ   a  s   rQ   c                       s<   e Zd ZdZdZdgZdgZg ZdZdZ	‡ fdd„Z
‡  ZS )	rR   z-
    Coldfusion markup/script components
    zColdfusion CFCÚcfcz*.cfcrC  ú2.0c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   rQ   rP   rÅ   rÆ   rn   ro   rk   {  s    zColdfusionCFCLexer.__init__rM  rn   rn   rÆ   ro   rR   p  s   rR   c                       sF   e Zd ZdZdZdgZdgZdgZdZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rV   z)
    Lexer for Scalate Server Pages.
    zScalate Server PageÚsspz*.sspzapplication/x-sspz"https://scalate.github.io/scalate/rñ   c                    s   t ƒ jttfi |¤Ž d S rÃ   r6  rÅ   rÆ   rn   ro   rk   Š  s    zSspLexer.__init__c                 C   sD   d}t  d| ¡r|d7 }t| ƒr(|d7 }d| v r@d| v r@|d7 }|S )Nr£   zval \w+\s*:g333333ã?r  rs   rt   rÛ   )r�   r§   r$   r¨   rn   rn   ro   r†   �  s    zSspLexer.analyse_textr8  rn   rn   rÆ   ro   rV     s   rV   c                   @   s@   e Zd ZdZdedfdefdefgdedfdeeƒfgd	œZd
S )ÚTeaTemplateRootLexerz
    Base for the `TeaTemplateLexer`. Yields `Token.Other` for area outside of
    code blocks.

    .. versionadded:: 1.5
    r/  r0  r1  r2  rt   rœ   r3  r4  N)	r‡   rˆ   r‰   rŠ   r   r!   r   r   r~   rn   rn   rn   ro   rQ  ˜  s   	ý
ýúrQ  c                       sF   e Zd ZdZdZdgZdgZdgZdZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rW   z"
    Lexer for Tea Templates.
    ÚTeaÚteaz*.teaz
text/x-teaz$https://github.com/teatrove/teatrovez1.5c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rQ  rÅ   rÆ   rn   ro   rk   ¹  s    zTeaTemplateLexer.__init__c                 C   s:   t  | ¡d }t| ƒr|d7 }d| v r6d| v r6|d7 }|S r7  )r   r†   r$   r¨   rn   rn   ro   r†   ¼  s    zTeaTemplateLexer.analyse_textr8  rn   rn   rÆ   ro   rW   ®  s   rW   c                       sJ   e Zd ZdZdZdgZdZg d¢Zg d¢ZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rX   z”
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `HtmlLexer`.

    Nested JavaScript and CSS is also highlighted.
    z
HTML+Lassoz
html+lassoú1.6)rÂ   r  r  ú*.lassoú*.lasso[89]ú*.inclú*.incú*.las)ztext/html+lassozapplication/x-httpd-lassozapplication/x-httpd-lasso[89]úhttps://www.lassosoft.comc                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   ×  s    zLassoHtmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r%  )r   r†   r#   r¨   rn   rn   ro   r†   Ú  s    zLassoHtmlLexer.analyse_textrÌ   rn   rn   rÆ   ro   rX   Å  s   rX   c                       sH   e Zd ZdZdZdgZdZg d¢ZdgZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rY   z_
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.
    z	XML+Lassoz	xml+lassorT  )rÊ   rU  rV  rW  rX  rY  zapplication/xml+lassorZ  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   ï  s    zLassoXmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rË   )r   r†   r$   r¨   rn   rn   ro   r†   ò  s    zLassoXmlLexer.analyse_textrÌ   rn   rn   rÆ   ro   rY   á  s   rY   c                       sF   e Zd ZdZdZdgZdZdgZdgZdZ	‡ fdd	„Z
d
d„ Z‡  ZS )rZ   z_
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.
    z	CSS+Lassoz	css+lassorT  r"  ztext/css+lassorZ  c                    s"   d|d< t ƒ jttfi |¤Ž d S ©NTZrequiredelimiters)rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk     s    zLassoCssLexer.__init__c                 C   s6   t  | ¡d }t d| ¡r"|d7 }d| v r2|d7 }|S )Nr   z
\w+:[^;]+;rÛ   zpadding:)r   r†   r�   r§   r¨   rn   rn   ro   r†   
  s    zLassoCssLexer.analyse_textrÌ   rn   rn   rÆ   ro   rZ   ù  s   rZ   c                       sJ   e Zd ZdZdZddgZdZdgZg d¢ZdZ	‡ fd	d
„Z
dd„ Z‡  ZS )r[   zf
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.
    zJavaScript+Lassozjavascript+lassozjs+lassorT  r  )zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassorZ  c                    s"   d|d< t ƒ jttfi |¤Ž d S r[  )rÄ   rk   r   r   rÅ   rÆ   rn   ro   rk   "  s    zLassoJavascriptLexer.__init__c                 C   s   t  | ¡d }|S r  )r   r†   r¨   rn   rn   ro   r†   &  s    z!LassoJavascriptLexer.analyse_textrÌ   rn   rn   rÆ   ro   r[     s   r[   c                   @   sN  e Zd ZdZdZdZdgZdZdefde	fde
e	jeƒd	fd
e
e	jejejƒd	fde
e	jeƒd	fgdefde	jdfde
ee	jƒdfde
ejeƒfde
eeeƒfde
eeejƒfde
eeeƒdfedƒgdefdedfde
eeejeƒfde
eeeedd�ƒfdejfedƒgdejfdejfdejfgedƒdejfd ejfd!efgd"œZd#S )$r\   z±
    Generic handlebars template lexer.

    Highlights only the Handlebars template tags (stuff between `{{` and `}}`).
    Everything else is left for a delegating lexer.
    Ú
Handlebarsúhttps://handlebarsjs.com/Ú
handlebarsrO  r—   z\{\{!.*\}\}z(\{\{\{)(\s*)r‚   z(\{\{)([#~/]+)([^\s}]*)ú(\{\{)(\s*)r™   z\}\}\}rœ   z
(~?)(\}\})z([^\s}]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()údynamic-partialÚgenericr¾   z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)rº   ©r   z[\w-]+z[()/@a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+rÕ   rÖ   rž   )r¢   r‚   r`  rº   ra  N)r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   r�   r!   r   r   ÚSpecialr   rz   r    r³   r   r   r   r¯   r   r   r   r   r®   r   r±   r²   r~   rn   rn   rn   ro   r\   +  s^   ÿô
ÿðÿ
ÿöýÿúÍr\   c                       sB   e Zd ZdZdZdgZddgZddgZdZd	Z	‡ fd
d„Z
‡  ZS )r]   zb
    Subclass of the `HandlebarsLexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML+Handlebarszhtml+handlebarsz*.handlebarsz*.hbsztext/html+handlebarsztext/x-handlebars-templater]  rO  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r\   rÅ   rÆ   rn   ro   rk   „  s    zHandlebarsHtmlLexer.__init__rM  rn   rn   rÆ   ro   r]   w  s   r]   c                       sD   e Zd ZdZdZg d¢Zg d¢ZddgZdZdZ	‡ fd	d
„Z
‡  ZS )r^   z‹
    Subclass of the `DjangoLexer` that highlights unlexed data with the
    `YamlLexer`.

    Commonly used in Saltstack salt states.
    z
YAML+Jinja)z
yaml+jinjaÚsaltÚsls)z*.slsz	*.yaml.j2z*.yml.j2z*.yaml.jinja2z*.yml.jinja2ztext/x-yaml+jinjaz
text/x-slsú!https://jinja.palletsprojects.comrO  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r3   rÅ   rÆ   rn   ro   rk   —  s    zYamlJinjaLexer.__init__rM  rn   rn   rÆ   ro   r^   ˆ  s   r^   c                   @   sr  e Zd ZdZdZdZdgZdgZdZde	fde
eeƒdfd	e
eeeed
d�ƒdfde	fgdejdfde
ejeƒeddd
ƒfde
ejeeƒdfde
ejeeedd�eeƒdfde
ejeeƒdfde
ejeeƒdfde
ejdeeƒdfde
ejdeeƒdfde
ejeeed
d�eeƒdfd e
ejeƒd!fg
edƒd"edfd#ed$fgedƒd"ed%fd&e
ejeeƒd'fgd#edfed(ƒed)ƒgedƒedƒd*e
eed
d�eeeeed
d�eeƒfd+efd,ejfd-e
eed
d�eejeeed
d�ƒfed
ƒedƒged
ƒed.ƒgd/e
eedeƒdfd0e
eejeƒdfgd"edfgd1ed%fgd2edfgedƒd3e
ejeeƒfd4e
eeeedd�eeƒfed5ƒed6ƒed7ƒd8efged9ƒd:e	fged9ƒedƒd:e	fgd1ed%fed)ƒgd1ed%fed;ƒgd<ejfgd=ejfd>efgd?ejfd@ejfgdAejfdBej fged7ƒed5ƒed6ƒedƒgdCefgdDe
eeejeeƒd%fd:e!fgde	fdEe
eeejeeƒdfde	fgdFœZ"dS )Gr_   z%
    Lexer for Liquid templates.
    Úliquidz.https://www.rubydoc.info/github/Shopify/liquidz*.liquidrO  r—   z
(\{%)(\s*)útag-or-blockz(\{\{)(\s*)([^\s}]+)ra  rb  Úoutputr˜   z(if|unless|elsif|case)(?=\s+)Ú	conditionz(when)(\s+)ú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*)úvariable-tag-markupz([^\s%]+)(\s*)ú
tag-markupú\}\}z\|Úfilters)rœ   rœ   z([^\s|:]+)(:?)(\s*)úfilter-markupú
end-of-tagúdefault-param-markupz/([^\s=!><]+)(\s*)([=!><]=?)(\s*)(\S+)(\s*)(%\})z\b!z\bnot\bz*([\w.\'"]+)(\s+)(contains)(\s+)([\w.\'"]+)úend-at-whitespacez(\s*)((=|!|>|<)=?)(\s*)z(\s*)(\bcontains\b)(\s*)z%\}r™   z([^\s=:]+)(\s*)(=|:)z(\{\{)(\s*)([^\s}])(\s*)(\}\})rD  ÚnumberÚkeywordú,úparam-markuprÚ   úvariable-param-markupz\b(false|true)\br¡   z(?<=\w)\.(?=\w)z'[^']*'z"[^"]*"z\d+\.\d+rE  z[ \t]+z (\{%)(\s*)(endcomment)(\s*)(%\})z(\{%)(\s*)(endraw)(\s*)(%\}))r¢   rh  ri  rq  rr  rj  zgeneric-valueÚoperatorrs  rk  ru  ry  rt  rz  ro  rn  rw  rº   rD  rv  ra  rl  r=  rm  )#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~   rn   rn   rn   ro   r_   ›  s>  þø

ÿÿÿþÿÿÿÿÿýâ"üÿü	ýþÿÿÿñþÿÿýÿÿÿÿÿÿóþýþþÿþþþüÿÿþüÿþû€ Çr_   c                   @   s¶  e Zd ZdZdZdgZdgZdZdZe	j
e	jB ZdZdZd	e d
 Zee Zdefdejdfdefdeejeeeejeejeeeejƒfdeejeeeejeejeeeejƒfde› d�eejeeeejƒdfdeejeeƒdfdefgde› d�eeeejƒfde› d�eeeeeejƒfdejfdefdejfeejfde ejfdefdejfdej fdefd efgd!efd"eeejƒd#fe!d$ƒgd!efd%eeejƒd#fe!d$ƒd&e"fgd'œZ#d(S ))r`   z”
    Twig template lexer.

    It just highlights Twig code between the preprocessor directives,
    other data is left untouched by the lexer.
    ÚTwigÚtwigzapplication/x-twigúhttps://twig.symfony.comrO  z[\\\w-]|[^\x00-\x7f]z(?:[\\_a-zA-Z]|[^\x00-\x7f])z(?:z)*r—   rÐ   rÑ   z\{\#.*?\#\}rÒ   zL(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})z(\{%)(-?\s*)(filter)(\s+)(r¼   r‚   rÔ   r˜   z
(\|)(\s*)(z(is)(\s+)(not)?(\s*)(z(?i)(true|false|none|null)\bz–(in|not|and|b-and|or|b-or|b-xor|isif|elseif|else|importconstant|defined|divisibleby|empty|even|iterable|odd|sameasmatches|starts\s+with|ends\s+with)\bz(loop|block|parent)\bz\.z\.[0-9]+rÕ   rÖ   z4([{}()\[\]+\-*/,:~%]|\.\.|\?|:|\*\*|\/\/|!=|[><=]=?)rž   r™   r×   rœ   rØ   rÙ   rÚ   )r¢   rØ   rÑ   r‚   N)$r‡   rˆ   r‰   rŠ   r‹   r�   rŽ   rŒ   r�   r�   r’   rÜ   r­   Z_ident_charZ_ident_beginZ
_ident_endZ_ident_innerr!   r   rz   r   r   r   r   r®   r   rÝ   rÞ   r¯   r    r   r±   r²   r   r   r~   rn   rn   rn   ro   r`   h  s„   
þþþþ
þÿê
ÿ
ÿüÿîýüÍr`   c                       s>   e Zd ZdZdZdgZdgZdgZdZdZ	‡ fdd	„Z
‡  ZS )
ra   z\
    Subclass of the `TwigLexer` that highlights unlexed data with the
    `HtmlLexer`.
    z	HTML+Twigz	html+twigz*.twigztext/html+twigr‚  rO  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r`   rÅ   rÆ   rn   ro   rk   È  s    zTwigHtmlLexer.__init__rM  rn   rn   rÆ   ro   ra   »  s   ra   c                   @   s  e Zd ZdZdZdZdgZdZdefde	e
jeƒdfd	e	eejeeeeƒd
fde	eejeeƒfde	eejeeeƒd
fde	eejeƒfgdefde
jdfdejfdejfdejfdefdejfdejfde	eeeeeeeeƒfg	dedfdedfdedfgdœZdS )rb   zø
    Generic angular2 template lexer.

    Highlights only the Angular template tags (stuff between `{{` and `}}` and
    special attributes: '(event)=', '[property]=', '[(twoWayBinding)]=').
    Everything else is left for a delegating lexer.
    ÚAngular2ú(https://angular.io/guide/template-syntaxÚng2z2.1z	[^{([*#]+r_  ÚngExpressionz&([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)rý   z([([]+)([\w:.-]+)([\])]+)(\s*)z([*#])([\w:.-]+)(\s*)(=)(\s*)z([*#])([\w:.-]+)(\s*)z\s+(\|\s+)?rp  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   rz   r   r   r   r³   r   r   ÚBooleanr±   r²   r    r¯   r~   rn   rn   rn   ro   rb   Ì  sP   þÿÿÿð
ÿÿðýØrb   c                       s8   e Zd ZdZdZdgZdgZdZdZ‡ fdd„Z	‡  Z
S )	rc   z`
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML + Angular2zhtml+ng2z*.ng2r„  rO  c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   rb   rÅ   rÆ   rn   ro   rk   	  s    zAngular2HtmlLexer.__init__)r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŒ   r�   rk   rÉ   rn   rn   rÆ   ro   rc   
	  s   rc   c                       sB   e Zd ZdZdZdgZg d¢ZdZdZ‡ fdd„Z	d	d
„ Z
‡  ZS )rd   z
    Templated SQL lexer.
    z	SQL+Jinjaz	sql+jinja)z*.sqlz*.sql.j2z*.sql.jinja2rf  z2.13c                    s   t ƒ jttfi |¤Ž d S rÃ   )rÄ   rk   r   r3   rÅ   rÆ   rn   ro   rk   %	  s    zSqlJinjaLexer.__init__c                 C   sD   d}t  d| ¡r|d7 }t  d| ¡r,|d7 }t  d| ¡r@|d7 }|S )Nr£   z\{\{\s*ref\(.*\)\s*\}\}r„   z\{\{\s*source\(.*\)\s*\}\}r¿   z\{%-?\s*macro \w+\(.*\)\s*-?%\}r¤   r¦   r¨   rn   rn   ro   r†   (	  s    zSqlJinjaLexer.analyse_text)r‡   rˆ   r‰   rŠ   r‹   r�   rª   rŒ   r�   rk   r†   rÉ   rn   rn   rÆ   ro   rd   	  s   rd   )wrŠ   r�   Zpygments.lexers.htmlr   r   Zpygments.lexers.javascriptr   r   Zpygments.lexers.cssr   Zpygments.lexers.phpr   Zpygments.lexers.pythonr   Zpygments.lexers.perlr	   Zpygments.lexers.jvmr
   r   Zpygments.lexers.datar   Zpygments.lexers.sqlr   Zpygments.lexerr   r   r   r   r   r   r   r   r   Zpygments.tokenr   r   r   r   r   r   r   r   r   r    r!   r"   Zpygments.utilr#   r$   Ú__all__r)   r.   rS   rT   rU   r3   r=   r>   r?   rA   r@   rB   rC   rD   rE   rF   rG   rþ   rI   rJ   rK   rL   r:   r  r9   r8   r<   r;   r*   r+   r,   r-   r%   r&   r'   r(   r/   r0   r1   r2   r4   r6   r5   r7   r.  rH   rM   rN   rO   rP   rG  rQ   rR   rV   rQ  rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   rn   rn   rn   ro   Ú<module>   s¨   
,8`:TU.6B-$@93/L NS>