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`.
    ZERBúhttps://github.com/ruby/erbZ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.rubyrg   Ú
ruby_lexerr   Ú__init__)ÚselfÚoptionsrg   © rl   úX/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/pygments/lexers/templates.pyri   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   ÚPreprocrh   Úget_tokens_unprocessedr   Ú
IndexError)rj   ÚtextÚtokensÚstateÚidxÚvalÚtagÚdataZr_idxZr_tokenZr_valuerl   rl   rm   ry   J   sf    


ÿ
ÿ

zErbLexer.get_tokens_unprocessedc                 C   s   d| v rd| v rdS d S )Nrq   rr   çš™™™™™Ù?rl   ©r{   rl   rl   rm   Úanalyse_textŽ   s    zErbLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ	mimetypesÚversion_addedÚreÚcompileÚMrs   ri   ry   r„   rl   rl   rl   rm   r)   3   s   	Dr)   c                   @   sò   e Zd ZdZdZdZdgZdgZdgZ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.
    ZSmartyúhttps://www.smarty.net/Úsmartyú*.tplzapplication/x-smartyrf   ú[^{]+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{   Úrvrl   rl   rm   r„   À   s    zSmartyLexer.analyse_textN)"r…   r†   r‡   rˆ   r‰   rŠ   r‹   Ú	filenamesrŒ   r�   rŽ   Ú	MULTILINEÚDOTALLÚflagsr!   r   r   rx   r   r   r   ÚFunctionr   ÚVariabler   r   ÚConstantr    r   ÚDoubleÚSingleÚ	Attributer|   r„   rl   rl   rl   rm   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.
    ZVelocityúhttps://velocity.apache.org/Zvelocityú*.vmú*.fhtmlrf   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¥   rl   rl   rm   r„     s    ÿzVelocityLexer.analyse_textN)"r…   r†   r‡   rˆ   r‰   rŠ   r‹   r§   r�   rŽ   r¨   r©   rª   Ú
identifierr!   r   r   rx   r   r«   r   r¬   r   r   r   r   r   r®   r¯   r    r   r­   r|   r„   rl   rl   rl   rm   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+velocityrf   ú*.htmlr³   ztext/html+velocityr±   c                    s   t ƒ jttfi |¤Ž d S ©N)Úsuperri   r   rS   ©rj   rk   ©Ú	__class__rl   rm   ri   /  s    zVelocityHtmlLexer.__init__)r…   r†   r‡   rˆ   r‰   r‹   r�   Úalias_filenamesrŒ   rŠ   ri   Ú__classcell__rl   rl   rÁ   rm   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+velocityrf   ú*.xmlr²   zapplication/xml+velocityr±   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   rS   rÀ   rÁ   rl   rm   ri   A  s    zVelocityXmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S ©Nr¢   r‚   )rS   r„   r$   r¥   rl   rl   rm   r„   D  s    zVelocityXmlLexer.analyse_text©r…   r†   r‡   rˆ   r‰   r‹   r�   rÃ   rŒ   rŠ   ri   r„   rÄ   rl   rl   rÁ   rm   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/JinjaZdjangoZjinjazapplication/x-django-templatingzapplication/x-jinjaú5https://www.djangoproject.com/documentation/templatesrf   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¥   rl   rl   rm   r„   •  s    zDjangoLexer.analyse_textN)!r…   r†   r‡   rˆ   r‰   r‹   rŒ   rŠ   r�   rŽ   r�   ÚSrª   r!   r   rx   r   r   r   r   r«   r   ÚPseudoÚBuiltinr¬   r   r®   r¯   r    r   r   r|   r„   rl   rl   rl   rm   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`.
    ZMyghtyúhttp://www.myghty.org/Zmyghtyz*.mytZ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|   rl   rl   rl   rm   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¿   ri   r   r=   rÀ   rÁ   rl   rm   ri   Ú  s    zMyghtyHtmlLexer.__init__©r…   r†   r‡   rˆ   r‰   r‹   rŒ   rŠ   r�   ri   rÄ   rl   rl   rÁ   rm   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¿   ri   r   r=   rÀ   rÁ   rl   rm   ri   ê  s    zMyghtyXmlLexer.__init__râ   rl   rl   rÁ   rm   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¿   ri   r   r=   rÀ   rÁ   rl   rm   ri   ü  s    zMyghtyJavascriptLexer.__init__râ   rl   rl   rÁ   rm   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¿   ri   r   r=   rÀ   rÁ   rl   rm   ri     s    zMyghtyCssLexer.__init__râ   rl   rl   rÁ   rm   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.
    ZMasonzhttp://www.masonhq.com/Zmason)z*.mz*.mhtmlz*.mcz*.miZautohandlerZ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{   Úresultrl   rl   rm   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„   rl   rl   rl   rm   rB     sP   ÿ
ÿÿÿÿÿÿÿ	÷íÿ!rB   c                   @   s@  e Zd ZdZdZdZdgZdgZdgZd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`.
    ZMakoúhttp://www.makotemplates.org/Z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–   rq   z'(?<=<%)(include|inherit|namespace|page)z((?:\w+)\s*=)(\s*)(".*?")ú/?\s*>r™   ú".*?"ú'.*?'ú[^\s>]+)rŸ   rè   r€   ÚattrN)r…   r†   r‡   rˆ   r‰   rŠ   r‹   r§   rŒ   r�   r   r   r   r   rx   r   r!   r   r   r¯   rå   r   r×   r   r   r°   r   r|   rl   rl   rl   rm   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¿   ri   r   rC   rÀ   rÁ   rl   rm   ri   ”  s    zMakoHtmlLexer.__init__râ   rl   rl   rÁ   rm   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¿   ri   r   rC   rÀ   rÁ   rl   rm   ri   ¤  s    zMakoXmlLexer.__init__râ   rl   rl   rÁ   rm   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¿   ri   r   rC   rÀ   rÁ   rl   rm   ri   ¶  s    zMakoJavascriptLexer.__init__râ   rl   rl   rÁ   rm   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¿   ri   r   rC   rÀ   rÁ   rl   rm   ri   Æ  s    zMakoCssLexer.__init__râ   rl   rl   rÁ   rm   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   rk   ry   r"   r   r   rx   )rj   r{   ZpylexerÚposÚtype_Úvaluerl   rl   rm   ry   Ñ  s
    z)CheetahPythonLexer.get_tokens_unprocessedN)r…   r†   r‡   rˆ   ry   rl   rl   rl   rm   rî   Ì  s   rî   c                   @   s¦   e Zd ZdZdZdZddgZddgZdd	gZd
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/
    ZCheetahúhttp://www.cheetahtemplate.org/ZcheetahZspitfirez*.tmplz*.sptzapplication/x-cheetahzapplication/x-spitfirerf   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   rx   r   rî   r!   r   r|   rl   rl   rl   rm   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+spitfireZhtmlcheetahztext/html+cheetahztext/html+spitfireró   rf   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   rI   rÀ   rÁ   rl   rm   ri     s    zCheetahHtmlLexer.__init__râ   rl   rl   rÁ   rm   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ó   rf   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   rI   rÀ   rÁ   rl   rm   ri   "  s    zCheetahXmlLexer.__init__râ   rl   rl   rÁ   rm   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ó   rf   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   rI   rÀ   rÁ   rl   rm   ri   8  s    zCheetahJavascriptLexer.__init__râ   rl   rl   rÁ   rm   rL   &  s   rL   c                
   @   sÂ   e Zd ZdZdZdZdgZddgZd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/Z
genshitextzapplication/x-genshi-textztext/x-genshirf   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   rx   r   r   r   r   r   r¬   r|   rl   rl   rl   rm   r:   <  s8   ûÿú	ÿÿýðr:   c                   @   sH  e Zd ZdZejZdefdee	j
eeƒe	j
ƒfdefdejdfdejdfed	ƒd
efgdefdejdfdejdfgdeeeeƒeƒdfdeeeeƒeƒdfdedfgdefdejdfdejdfdejdfgdedfdedfdedfgdedfedƒdefgdedfedƒdefgdefed	ƒgdee	j
eeƒe	j
ƒfdejfgdœ	ZdS ) ÚGenshiMarkupLexerzX
    Base lexer for Genshi markup, used by `HtmlGenshiLexer` and
    `GenshiLexer`.
    z[^<$]+z(<\?python)(.*?)(\?>)z'<\s*(script|style)\s*.*?>.*?<\s*/\1\s*>z<\s*py:[a-zA-Z0-9]+Úpytagz<\s*[a-zA-Z0-9:.]+r€   rµ   z[<$]r–   z[\w:-]+\s*=Úpyattrré   r™   z(")(.*?)(")z(')(.*?)(')rì   zpy:[\w-]+\s*=rí   ú"úattr-dstringú'úattr-sstringz[^\s>]*Ústringsz[^"'$]+rö   z(?<!\$)(\$)([a-zA-Z_][\w\.]*))	rŸ   rø   rù   r€   rí   rû   rý   rþ   rµ   N)r…   r†   r‡   rˆ   rŽ   r©   rª   r!   r   r   rx   r   r   r   rá   r   r   r°   r   r¬   r|   rl   rl   rl   rm   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+kidrf   ©r½   ú*.htmú*.xhtmlztext/html+genshirô   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r÷   rÀ   rÁ   rl   rm   ri   ­  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¥   rl   rl   rm   r„   °  s    zHtmlGenshiLexer.analyse_textrÇ   rl   rl   rÁ   rm   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.
    ZGenshi)ÚgenshiZkidz
xml+genshizxml+kidz*.kidrf   rÅ   zapplication/x-genshizapplication/x-kidrô   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r÷   rÀ   rÁ   rl   rm   ri   Ç  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¥   rl   rl   rm   r„   Ê  s    zGenshiLexer.analyse_text©r…   r†   r‡   rˆ   r‰   r‹   r§   r�   rÃ   rŒ   rŠ   ri   r„   rÄ   rl   rl   rÁ   rm   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+genshirf   ú*.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¿   ri   r   r:   rÀ   rÁ   rl   rm   ri   â  s    zJavascriptGenshiLexer.__init__c                 C   s   t  | ¡d S ©Nçš™™™™™©?©r8   r„   rƒ   rl   rl   rm   r„   å  s    z"JavascriptGenshiLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+genshirf   ú*.cssztext/css+genshir  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r:   rÀ   rÁ   rl   rm   ri   õ  s    zCssGenshiLexer.__init__c                 C   s   t  | ¡d S r  r
  rƒ   rl   rl   rm   r„   ø  s    zCssGenshiLexer.analyse_textrÇ   rl   rl   rÁ   rm   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.
    ZRHTML)Zrhtmlzhtml+erbz	html+rubyz*.rhtmlrf   rÿ   ztext/html+rubyre   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r)   rÀ   rÁ   rl   rm   ri     s    zRhtmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S ©Nr¢   g      à?)r)   r„   r#   r¥   rl   rl   rm   r„     s    zRhtmlLexer.analyse_textr  rl   rl   rÁ   rm   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+erbrf   rÅ   zapplication/xml+rubyre   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r)   rÀ   rÁ   rl   rm   ri   %  s    zXmlErbLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rÆ   )r)   r„   r$   r¥   rl   rl   rm   r„   (  s    zXmlErbLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+erbrf   r  ztext/css+rubyre   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r)   rÀ   rÁ   rl   rm   ri   ;  s    zCssErbLexer.__init__c                 C   s   t  | ¡d S r  ©r)   r„   rƒ   rl   rl   rm   r„   >  s    zCssErbLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+erbrf   r  )zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyre   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r)   rÀ   rÁ   rl   rm   ri   Q  s    zJavascriptErbLexer.__init__c                 C   s   t  | ¡d S r  r  rƒ   rl   rl   rm   r„   T  s    zJavascriptErbLexer.analyse_textrÇ   rl   rl   rÁ   rm   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*.phtmlrf   )ú*.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¿   ri   r   r   rÀ   rÁ   rl   rm   ri   k  s    zHtmlPhpLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r  )r   r„   r#   r¥   rl   rl   rm   r„   n  s    zHtmlPhpLexer.analyse_textr  rl   rl   rÁ   rm   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+phprf   )rÅ   r  r  zapplication/xml+phpr  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r   rÀ   rÁ   rl   rm   ri   �  s    zXmlPhpLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rÆ   )r   r„   r$   r¥   rl   rl   rm   r„   „  s    zXmlPhpLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+phprf   r  ztext/css+phpr  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r   rÀ   rÁ   rl   rm   ri   —  s    zCssPhpLexer.__init__c                 C   s   t  | ¡d S r  ©r   r„   rƒ   rl   rl   rm   r„   š  s    zCssPhpLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+phprf   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¿   ri   r   r   rÀ   rÁ   rl   rm   ri   ­  s    zJavascriptPhpLexer.__init__c                 C   s
   t  | ¡S r¾   r  rƒ   rl   rl   rm   r„   °  s    zJavascriptPhpLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+smartyrf   )r½   r   r  r“   ztext/html+smartyr‘   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r.   rÀ   rÁ   rl   rm   ri   Ã  s    zHtmlSmartyLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r  )r.   r„   r#   r¥   rl   rl   rm   r„   Æ  s    zHtmlSmartyLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+smartyrf   rÅ   r“   zapplication/xml+smartyr‘   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r.   rÀ   rÁ   rl   rm   ri   Ú  s    zXmlSmartyLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rÆ   )r.   r„   r$   r¥   rl   rl   rm   r„   Ý  s    zXmlSmartyLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+smartyrf   r  r“   ztext/css+smartyr‘   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r.   rÀ   rÁ   rl   rm   ri   ñ  s    zCssSmartyLexer.__init__c                 C   s   t  | ¡d S r  ©r.   r„   rƒ   rl   rl   rm   r„   ô  s    zCssSmartyLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+smartyrf   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¿   ri   r   r.   rÀ   rÁ   rl   rm   ri     s    zJavascriptSmartyLexer.__init__c                 C   s   t  | ¡d S r  r  rƒ   rl   rl   rm   r„   
  s    z"JavascriptSmartyLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+jinjaZ
htmldjango)z	*.html.j2z*.htm.j2z
*.xhtml.j2z*.html.jinja2z*.htm.jinja2z*.xhtml.jinja2rf   rÿ   ztext/html+djangoztext/html+jinjarÈ   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r3   rÀ   rÁ   rl   rm   ri     s    zHtmlDjangoLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r  )r3   r„   r#   r¥   rl   rl   rm   r„   !  s    zHtmlDjangoLexer.analyse_textr  rl   rl   rÁ   rm   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.jinja2rf   rÅ   zapplication/xml+djangozapplication/xml+jinjarÈ   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r3   rÀ   rÁ   rl   rm   ri   6  s    zXmlDjangoLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rÆ   )r3   r„   r$   r¥   rl   rl   rm   r„   9  s    zXmlDjangoLexer.analyse_textr  rl   rl   rÁ   rm   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.jinja2rf   r  ztext/css+djangoztext/css+jinjarÈ   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r3   rÀ   rÁ   rl   rm   ri   N  s    zCssDjangoLexer.__init__c                 C   s   t  | ¡d S r  ©r3   r„   rƒ   rl   rl   rm   r„   Q  s    zCssDjangoLexer.analyse_textr  rl   rl   rÁ   rm   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.jinja2rf   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¿   ri   r   r3   rÀ   rÁ   rl   rm   ri   i  s    zJavascriptDjangoLexer.__init__c                 C   s   t  | ¡d S r  r  rƒ   rl   rl   rm   r„   l  s    z"JavascriptDjangoLexer.analyse_textr  rl   rl   rÁ   rm   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).*?>ú[^<]+ú<rr   r™   ú[\w\W]+?(?=%>|\Z)©rŸ   r  N)	r…   r†   r‡   rˆ   r   r!   r   r
   r|   rl   rl   rl   rm   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 PageZjspz*.jspzapplication/x-jspz.https://projects.eclipse.org/projects/ee4j.jsprç   c                    s   t ƒ jttfi |¤Ž d S r¾   ©r¿   ri   r   r  rÀ   rÁ   rl   rm   ri   ”  s    zJspLexer.__init__c                 C   s:   t  | ¡d }t| ƒr|d7 }d| v r6d| v r6|d7 }|S ©Nr¢   r‚   rq   rr   rÔ   )r
   r„   r$   r¥   rl   rl   rm   r„   —  s    zJspLexer.analyse_text©r…   r†   r‡   rˆ   r‰   r‹   r§   rŒ   rŠ   r�   ri   r„   rÄ   rl   rl   rÁ   rm   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.
    ZEvoqueZ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$evoquern   Nrl   rƒ   rl   rl   rm   r„   Ô  s    zEvoqueLexer.analyse_text)r…   r†   r‡   rˆ   r‰   r‹   r§   rŒ   rŠ   r�   rŽ   r©   rª   r!   r   rå   r   r   r   r×   r   r   r   r|   r„   rl   rl   rl   rm   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¿   ri   r   rM   rÀ   rÁ   rl   rm   ri   å  s    zEvoqueHtmlLexer.__init__c                 C   s
   t  | ¡S r¾   ©rM   r„   rƒ   rl   rl   rm   r„   è  s    zEvoqueHtmlLexer.analyse_text©r…   r†   r‡   rˆ   r‰   r‹   rÃ   rŒ   rŠ   r�   ri   r„   rÄ   rl   rl   rÁ   rm   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¿   ri   r   rM   rÀ   rÁ   rl   rm   ri   ø  s    zEvoqueXmlLexer.__init__c                 C   s
   t  | ¡S r¾   r"  rƒ   rl   rl   rm   r„   û  s    zEvoqueXmlLexer.analyse_textr#  rl   rl   rÁ   rm   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
    ZcfstatementZcfsú5https://www.adobe.com/products/coldfusion-family.htmlrf   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Ÿ   r%  N)r…   r†   r‡   rˆ   r‰   r‹   r§   rŒ   rŠ   r�   rŽ   Ú
IGNORECASErª   r   r¯   rå   r   r   r®   r    r   r­   r   r   r«   r   r   r¬   ZInterpr|   rl   rl   rl   rm   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Úcfr$  r  Útagsz<[^<>]*z<!---Ú	cfcommentz(?s)<!--.*?-->z<cfoutput.*?>Úcfoutputz((?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)zì(?s)(</?cf(?:component|include|if|else|elseif|loop|return|dbinfo|dump|abort|location|invoke|throw|file|savecontent|mailpart|mail|header|content|zip|image|lock|argument|try|catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)z[^#<]+z(#)(.*?)(#)z</cfoutput.*?>r™   z(?s)<[^<>]*r!  r—   z--->z([^<-]|<(?!!---)|-(?!-->))+)rŸ   r*  r,  r+  N)r…   r†   r‡   rˆ   r‰   r‹   r§   rŒ   rŠ   r!   r   r   rå   r   r×   r   r   rP   r   r|   rl   rl   rl   rm   r(  2  sD   ý

ÿüùÿ
ø

ýãr(  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 HTMLZcfmz*.cfmz*.cfmlzapplication/x-coldfusionr$  rf   c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r(  rÀ   rÁ   rl   rm   ri   l  s    zColdfusionHtmlLexer.__init__©r…   r†   r‡   rˆ   r‰   r‹   r§   rŒ   rŠ   r�   ri   rÄ   rl   rl   rÁ   rm   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 CFCZcfcz*.cfcr$  ú2.0c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   rQ   rP   rÀ   rÁ   rl   rm   ri   {  s    zColdfusionCFCLexer.__init__r-  rl   rl   rÁ   rm   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 PageZsspz*.sspzapplication/x-sspz"https://scalate.github.io/scalate/rã   c                    s   t ƒ jttfi |¤Ž d S r¾   r  rÀ   rÁ   rl   rm   ri   Š  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  rq   rr   rÔ   )rŽ   r¤   r$   r¥   rl   rl   rm   r„   �  s    zSspLexer.analyse_textr  rl   rl   rÁ   rm   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  r  r  r  rr   r™   r  r  N)	r…   r†   r‡   rˆ   r   r!   r   r   r|   rl   rl   rl   rm   r/  ˜  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 )rW   z"
    Lexer for Tea Templates.
    ZTeaZteaz*.teaz
text/x-teaz$https://github.com/teatrove/teatrovez1.5c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r/  rÀ   rÁ   rl   rm   ri   ¹  s    zTeaTemplateLexer.__init__c                 C   s:   t  | ¡d }t| ƒr|d7 }d| v r6d| v r6|d7 }|S r  )r   r„   r$   r¥   rl   rl   rm   r„   ¼  s    zTeaTemplateLexer.analyse_textr  rl   rl   rÁ   rm   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¿   ri   r   r   rÀ   rÁ   rl   rm   ri   ×  s    zLassoHtmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S r  )r   r„   r#   r¥   rl   rl   rm   r„   Ú  s    zLassoHtmlLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+lassor0  )rÅ   r1  r2  r3  r4  r5  zapplication/xml+lassor6  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r   rÀ   rÁ   rl   rm   ri   ï  s    zLassoXmlLexer.__init__c                 C   s"   t  | ¡d }t| ƒr|d7 }|S rÆ   )r   r„   r$   r¥   rl   rl   rm   r„   ò  s    zLassoXmlLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+lassor0  r  ztext/css+lassor6  c                    s"   d|d< t ƒ jttfi |¤Ž d S ©NTZrequiredelimiters)r¿   ri   r   r   rÀ   rÁ   rl   rm   ri     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¥   rl   rl   rm   r„   
  s    zLassoCssLexer.analyse_textrÇ   rl   rl   rÁ   rm   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+lassor0  r  )zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassor6  c                    s"   d|d< t ƒ jttfi |¤Ž d S r7  )r¿   ri   r   r   rÀ   rÁ   rl   rm   ri   "  s    zLassoJavascriptLexer.__init__c                 C   s   t  | ¡d }|S r  )r   r„   r¥   rl   rl   rm   r„   &  s    z!LassoJavascriptLexer.analyse_textrÇ   rl   rl   rÁ   rm   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.
    Z
Handlebarsúhttps://handlebarsjs.com/Z
handlebarsr.  r”   z\{\{!.*\}\}z(\{\{\{)(\s*)r€   z(\{\{)([#~/]+)([^\s}]*)ú(\{\{)(\s*)r–   z\}\}\}r™   z
(~?)(\}\})z([^\s}]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()údynamic-partialÚgenericr¹   z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)rµ   ©r}   z[\w-]+z[()/@a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+rÎ   rÏ   r›   )rŸ   r€   r:  rµ   r;  N)r…   r†   r‡   rˆ   r‰   rŠ   r‹   r�   r!   r   r   ÚSpecialr   rx   r    r°   r   r   r   r¬   r   r   r   r   r«   r   r®   r¯   r|   rl   rl   rl   rm   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-templater8  r.  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r\   rÀ   rÁ   rl   rm   ri   „  s    zHandlebarsHtmlLexer.__init__r-  rl   rl   rÁ   rm   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+jinjaZsaltZsls)z*.slsz	*.yaml.j2z*.yml.j2z*.yaml.jinja2z*.yml.jinja2ztext/x-yaml+jinjaz
text/x-slsú!https://jinja.palletsprojects.comr.  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r3   rÀ   rÁ   rl   rm   ri   —  s    zYamlJinjaLexer.__init__r-  rl   rl   rÁ   rm   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.
    Zliquidz.https://www.rubydoc.info/github/Shopify/liquidz*.liquidr.  r”   z
(\{%)(\s*)útag-or-blockz(\{\{)(\s*)([^\s}]+)r;  r<  Ú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*)(\}\})r%  ÚnumberÚkeywordú,úparam-markuprÓ   ú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@  rH  rI  rA  zgeneric-valueÚoperatorrJ  rB  rL  rP  rK  rQ  rF  rE  rN  rµ   r%  rM  r;  rC  r   rD  )#r…   r†   r‡   rˆ   r‰   rŠ   r‹   r§   r�   r   r   r   r   r   r   r   ZReservedr   r   rá   r   r«   r   ÚWordr°   r­   r¬   r   r¯   r®   r    ZFloatZIntegerr   r|   rl   rl   rl   rm   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.
    ZTwigZtwigzapplication/x-twigúhttps://twig.symfony.comr.  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   rx   r   r   r   r   r«   r   rÖ   r×   r¬   r    r   r®   r¯   r   r   r|   rl   rl   rl   rm   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+twigrT  r.  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r`   rÀ   rÁ   rl   rm   ri   È  s    zTwigHtmlLexer.__init__r-  rl   rl   rÁ   rm   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.
    ZAngular2ú(https://angular.io/guide/template-syntaxZng2z2.1z	[^{([*#]+r9  ÚngExpressionz&([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)rí   z([([]+)([\w:.-]+)([\])]+)(\s*)z([*#])([\w:.-]+)(\s*)(=)(\s*)z([*#])([\w:.-]+)(\s*)z\s+(\|\s+)?rG  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Ÿ   rV  rí   N)r…   r†   r‡   rˆ   r‰   rŠ   r‹   r�   r!   r   r   rx   r   r   r   r°   r   r   ÚBooleanr®   r¯   r    r¬   r|   rl   rl   rl   rm   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*.ng2rU  r.  c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   rb   rÀ   rÁ   rl   rm   ri   	  s    zAngular2HtmlLexer.__init__)r…   r†   r‡   rˆ   r‰   r‹   r§   rŠ   r�   ri   rÄ   rl   rl   rÁ   rm   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.jinja2r>  z2.13c                    s   t ƒ jttfi |¤Ž d S r¾   )r¿   ri   r   r3   rÀ   rÁ   rl   rm   ri   %	  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¥   rl   rl   rm   r„   (	  s    zSqlJinjaLexer.analyse_text)r…   r†   r‡   rˆ   r‰   r‹   r§   rŠ   r�   ri   r„   rÄ   rl   rl   rÁ   rm   rd   	  s   rd   )wrˆ   rŽ   Zpygments.lexers.htmlr   r   Zpygments.lexers.javascriptr   r   Zpygments.lexers.cssr   Zpygments.lexers.phpr   Zpygments.lexers.pythonr   Zpygments.lexers.perlr	   Zpygments.lexers.jvmr
   r   Zpygments.lexers.datar   Zpygments.lexers.sqlr   Zpygments.lexerr   r   r   r   r   r   r   r   r   Zpygments.tokenr   r   r   r   r   r   r   r   r   r    r!   r"   Zpygments.utilr#   r$   Ú__all__r)   r.   rS   rT   rU   r3   r=   r>   r?   rA   r@   rB   rC   rD   rE   rF   rG   rî   rI   rJ   rK   rL   r:   r÷   r9   r8   r<   r;   r*   r+   r,   r-   r%   r&   r'   r(   r/   r0   r1   r2   r4   r6   r5   r7   r  rH   rM   rN   rO   rP   r(  rQ   rR   rV   r/  rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   rl   rl   rl   rm   Ú<module>   s¨   
,8`:TU.6B-$@93/L NS>