o
    \h'                    @   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 dd deZjG dd deZkG dd deZlG dd deZmG dd deZnG dd deZoG dd deZpG dd deZqG dd deZrG dd deZsG dd deZtG dd deZuG dd deZvdS )z
    pygments.lexers.templates
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for various template engines' markup.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)	HtmlLexerXmlLexer)JavascriptLexer
LassoLexer)CssLexer)PhpLexer)PythonLexer)	PerlLexer)	JavaLexerTeaLangLexer)	YamlLexer)SqlLexer)	LexerDelegatingLexer
RegexLexerbygroupsincludeusingthisdefaultcombined)ErrorPunctuation
WhitespaceTextCommentOperatorKeywordNameStringNumberOtherToken)html_doctype_matcheslooks_like_xml)@HtmlPhpLexerXmlPhpLexerCssPhpLexerJavascriptPhpLexerErbLexer
RhtmlLexerXmlErbLexerCssErbLexerJavascriptErbLexerSmartyLexerHtmlSmartyLexerXmlSmartyLexerCssSmartyLexerJavascriptSmartyLexerDjangoLexerHtmlDjangoLexerCssDjangoLexerXmlDjangoLexerJavascriptDjangoLexerGenshiLexerHtmlGenshiLexerGenshiTextLexerCssGenshiLexerJavascriptGenshiLexerMyghtyLexerMyghtyHtmlLexerMyghtyXmlLexerMyghtyCssLexerMyghtyJavascriptLexer
MasonLexer	MakoLexerMakoHtmlLexerMakoXmlLexerMakoJavascriptLexerMakoCssLexerJspLexerCheetahLexerCheetahHtmlLexerCheetahXmlLexerCheetahJavascriptLexerEvoqueLexerEvoqueHtmlLexerEvoqueXmlLexerColdfusionLexerColdfusionHtmlLexerColdfusionCFCLexerVelocityLexerVelocityHtmlLexerVelocityXmlLexerSspLexerTeaTemplateLexerLassoHtmlLexerLassoXmlLexerLassoCssLexerLassoJavascriptLexerHandlebarsLexerHandlebarsHtmlLexerYamlJinjaLexerLiquidLexer	TwigLexerTwigHtmlLexerAngular2LexerAngular2HtmlLexerSqlJinjaLexerc                   @   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} |di || _tj| fi | d S )Nr   )	RubyLexer )pygments.lexers.rubyri   
ruby_lexerr   __init__)selfoptionsri   rj   rj   \/home/air/segue/gemini/backup/venv/lib/python3.10/site-packages/pygments/lexers/templates.pyrm   E   s   zErbLexer.__init__c                 c   s   | j |}|  d }}z	 |dkr(| }|t|fV  |t|7 }d}n|dkr| }|dv rA|t|fV  |d7 }d}n|dkrc|tj|fV  | }|d t|fV  |dt| 7 }d}n|dv r|tj|fV  |t|7 }| }d}| j	|D ]\}}	}
|| |	|
fV  q|t|7 }d}nc|d	v r|t
|fV  |t|7 }d}nP|tj|d fV  d}| j	|dd
 D ]\}}	}
|d | |	|
fV  q|t|7 }d}n"|dkr| }|d	vr|t|fV  n|tj|fV  |t|7 }d}q ty   Y d
S w )z
        Since ERB doesn't allow "<%" and other tags inside of ruby
        blocks we have to use a split approach here that fails for
        that too.
        r   T   )z<%%z%%>   z<%#   )<%z<%=z<%-)%>z-%>N)	_block_resplitreversepopr!   lenr   Preprocrl   get_tokens_unprocessedr   
IndexError)rn   texttokensstateidxvaltagdatar_idxr_tokenr_valuerj   rj   rp   r|   J   sn   
7zErbLexer.get_tokens_unprocessedc                 C   s   d| v r
d| v rdS d S d S )Nrt   ru   皙?rj   r~   rj   rj   rp   analyse_text   s   zErbLexer.analyse_textN)__name__
__module____qualname____doc__nameurlaliases	mimetypesversion_addedrecompileMrv   rm   r|   r   rj   rj   rj   rp   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)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| r*|d7 }|S )N        z\{if\s+.*?\}.*?\{/if\}333333?z\{include\s+file=.*?\}z \{foreach\s+.*?\}.*?\{/foreach\}z	\{\$.*?\}{Gz?r   searchr~   rvrj   rj   rp   r      s   zSmartyLexer.analyse_textN)"r   r   r   r   r   r   r   	filenamesr   r   r   	MULTILINEDOTALLflagsr!   r   r   r{   r   r   r   Functionr   Variabler   r   Constantr    r   DoubleSingle	Attributer   r   rj   rj   rj   rp   r.      sN    


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r|d7 }t d| t jr&|d7 }t d| r0|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   rj   rj   rp   r     s   zVelocityLexer.analyse_textN)"r   r   r   r   r   r   r   r   r   r   r   r   r   
identifierr!   r   r   r{   r   r   r   r   r   r   r   r   r   r   r   r    r   r   r   r   rj   rj   rj   rp   rS      sz    



	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                       t  jttfi | d S N)superrm   r   rS   rn   ro   	__class__rj   rp   rm   /     zVelocityHtmlLexer.__init__)r   r   r   r   r   r   r   alias_filenamesr   r   rm   __classcell__rj   rj   r   rp   rT   !  s    rT   c                       H   e Zd ZdZdZdgZdZddgZdgZdZ	 fd	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                    r   r   )r   rm   r   rS   r   r   rj   rp   rm   A  r   zVelocityXmlLexer.__init__c                 C   "   t | d }t| r|d7 }|S Nr   r   )rS   r   r$   r   rj   rj   rp   r   D     zVelocityXmlLexer.analyse_textr   r   r   r   r   r   r   r   r   r   rm   r   r   rj   rj   r   rp   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-jinja5https://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r|d7 }t d| d ur&|d7 }|S )Nr   z\{%\s*(block|extends)r   z\{%\s*if\s*.*?%\}皙?z\{\{.*?\}\}r   r   rj   rj   rp   r     s   zDjangoLexer.analyse_textN)!r   r   r   r   r   r   r   r   r   r   r   Sr   r!   r   r{   r   r   r   r   r   r   PseudoBuiltinr   r   r   r   r    r   r   r   r   rj   rj   rj   rp   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   rj   rj   rj   rp   r=     sN    

	r=   c                       8   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                    r   r   )r   rm   r   r=   r   r   rj   rp   rm     r   zMyghtyHtmlLexer.__init__r   r   r   r   r   r   r   r   r   rm   r   rj   rj   r   rp   r>         r>   c                       r   )	r?   z]
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `XmlLexer`.
    z
XML+Myghtyz
xml+myghtyzapplication/xml+myghtyr   r   c                    r   r   )r   rm   r   r=   r   r   rj   rp   rm     r   zMyghtyXmlLexer.__init__r   rj   rj   r   rp   r?     r   r?   c                       <   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                    r   r   )r   rm   r   r=   r   r   rj   rp   rm     r   zMyghtyJavascriptLexer.__init__r   rj   rj   r   rp   rA         rA   c                       r   )	r@   z]
    Subclass of the `MyghtyLexer` that highlights unlexed data
    with the `CssLexer`.
    z
CSS+Myghtyz
css+myghtyztext/css+myghtyr   r   c                    r   r   )r   rm   r   r=   r   r   rj   rp   rm     r   zMyghtyCssLexer.__init__r   rj   rj   r   rp   r@      r   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   s8   d}t d| d urd}|S t d| t jd urd}|S )Nr   z</%(class|doc|init)>g      ?z<&.+&>g)\(?r   )r~   resultrj   rj   rp   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   rj   rj   rj   rp   rB     sR    
	!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   rt   z'(?<=<%)(include|inherit|namespace|page)z((?:\w+)\s*=)(\s*)(".*?")/?\s*>r   ".*?"'.*?'[^\s>]+)r   r  r   attrN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r{   r   r!   r   r   r   r  r   r   r   r   r   r   r   rj   rj   rj   rp   rC   F  sf    
"

rC   c                       r   )	rD   z\
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `HtmlLexer`.
    z	HTML+Makoz	html+makoztext/html+makor  r  c                    r   r   )r   rm   r   rC   r   r   rj   rp   rm     r   zMakoHtmlLexer.__init__r   rj   rj   r   rp   rD     r   rD   c                       r   )	rE   z[
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `XmlLexer`.
    zXML+Makozxml+makozapplication/xml+makor  r  c                    r   r   )r   rm   r   rC   r   r   rj   rp   rm     r   zMakoXmlLexer.__init__r   rj   rj   r   rp   rE     r   rE   c                       r   )
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                    r   r   )r   rm   r   rC   r   r   rj   rp   rm     r   zMakoJavascriptLexer.__init__r   rj   rj   r   rp   rF     r   rF   c                       r   )	rG   z[
    Subclass of the `MakoLexer` that highlights unlexed data
    with the `CssLexer`.
    zCSS+Makozcss+makoztext/css+makor  r  c                    r   r   )r   rm   r   rC   r   r   rj   rp   rm     r   zMakoCssLexer.__init__r   rj   rj   r   rp   rG     r   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   sP    t di | j}||D ]\}}}|tjkr|dkrtj}|||fV  qd S )N$rj   )r   ro   r|   r"   r   r   r{   )rn   r~   pylexerpostype_valuerj   rj   rp   r|     s   z)CheetahPythonLexer.get_tokens_unprocessedN)r   r   r   r   r|   rj   rj   rj   rp   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#[*](.|\n)*?[*]#z#end[^#\n]*(?:#|$)z#slurp$z(#[a-zA-Z]+)([^#\n]*)(#|$)z(\$)([a-zA-Z_][\w.]*\w)z(?s)(\$\{!?)(.*?)(\})a  (?sx)
                (.+?)               # anything, followed by:
                (?:
                 (?=\#[#a-zA-Z]*) | # an eval comment
                 (?=\$[a-zA-Z_{]) | # a substitution
                 \Z                 # end of string
                )
            r   N)r   r   r   r   r   r   r   r   r   r   r   r   r{   r   r  r!   r   r   rj   rj   rj   rp   rI     sD    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                    r   r   )r   rm   r   rI   r   r   rj   rp   rm     r   zCheetahHtmlLexer.__init__r   rj   rj   r   rp   rJ         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                    r   r   )r   rm   r   rI   r   r   rj   rp   rm   "  r   zCheetahXmlLexer.__init__r   rj   rj   r   rp   rK     r  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                    r   r   )r   rm   r   rI   r   r   rj   rp   rm   8  r   zCheetahJavascriptLexer.__init__r   rj   rj   r   rp   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   r{   r   r   r   r   r   r   r   rj   rj   rj   rp   r:   <  s:    	
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   r{   r   r   r   r   r   r   r   r   r   r   rj   rj   rj   rp   r  `  sb    







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                    r   r   )r   rm   r   r  r   r   rj   rp   rm     r   zHtmlGenshiLexer.__init__c                 C   F   d}t d| d ur|d7 }t d| d ur|d7 }|t|  d S Nr   z	\$\{.*?\}皙?zpy:(.*?)=["\']r   )r   r   r   r   r   rj   rj   rp   r        zHtmlGenshiLexer.analyse_textr   rj   rj   r   rp   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                    r   r   )r   rm   r   r  r   r   rj   rp   rm     r   zGenshiLexer.__init__c                 C   r'  r(  )r   r   r   r   r   rj   rj   rp   r     r*  zGenshiLexer.analyse_textr   r   r   r   r   r   r   r   r   r   r   rm   r   r   rj   rj   r   rp   r8     s    r8   c                       J   e Zd ZdZdZg dZdZdgZg dZdZ	 fd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                    r   r   )r   rm   r   r:   r   r   rj   rp   rm     r   zJavascriptGenshiLexer.__init__c                 C      t | d S N皙?r8   r   r   rj   rj   rp   r        z"JavascriptGenshiLexer.analyse_textr   rj   rj   r   rp   r<     s    r<   c                       H   e Zd ZdZdZddgZdZdgZdgZdZ	 fd	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+genshir1  c                    r   r   )r   rm   r   r:   r   r   rj   rp   rm     r   zCssGenshiLexer.__init__c                 C   r2  r3  r5  r   rj   rj   rp   r     r6  zCssGenshiLexer.analyse_textr   rj   rj   r   rp   r;         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                    r   r   )r   rm   r   r)   r   r   rj   rp   rm     r   zRhtmlLexer.__init__c                 C   r   Nr   g      ?)r)   r   r#   r   rj   rj   rp   r     s   zRhtmlLexer.analyse_textr.  rj   rj   r   rp   r*     s    r*   c                       r7  )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                    r   r   )r   rm   r   r)   r   r   rj   rp   rm   %  r   zXmlErbLexer.__init__c                 C   r   r   )r)   r   r$   r   rj   rj   rp   r   (  r   zXmlErbLexer.analyse_textr   rj   rj   r   rp   r+     s    r+   c                       r7  )r,   zS
    Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
    zCSS+Rubyzcss+rubyzcss+erbrh   r8  ztext/css+rubyrf   c                    r   r   )r   rm   r   r)   r   r   rj   rp   rm   ;  r   zCssErbLexer.__init__c                 C   r2  r3  r)   r   r   rj   rj   rp   r   >  r6  zCssErbLexer.analyse_textr   rj   rj   r   rp   r,   /  r9  r,   c                       r/  )r-   z^
    Subclass of `ErbLexer` which highlights unlexed data with the
    `JavascriptLexer`.
    zJavaScript+Ruby)zjavascript+rubyzjs+rubyzjavascript+erbzjs+erbrh   r0  )zapplication/x-javascript+rubyztext/x-javascript+rubyztext/javascript+rubyrf   c                    r   r   )r   rm   r   r)   r   r   rj   rp   rm   Q  r   zJavascriptErbLexer.__init__c                 C   r2  r3  r=  r   rj   rj   rp   r   T  r6  zJavascriptErbLexer.analyse_textr   rj   rj   r   rp   r-   B      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                    r   r   )r   rm   r   r   r   r   rj   rp   rm   k  r   zHtmlPhpLexer.__init__c                 C   r   r<  )r   r   r#   r   rj   rj   rp   r   n  r   zHtmlPhpLexer.analyse_textr.  rj   rj   r   rp   r%   X  s    r%   c                       H   e Zd ZdZdZdgZdZg dZdgZdZ	 fd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+phprA  c                    r   r   )r   rm   r   r   r   r   rj   rp   rm     r   zXmlPhpLexer.__init__c                 C   r   r   )r   r   r$   r   rj   rj   rp   r     r   zXmlPhpLexer.analyse_textr   rj   rj   r   rp   r&   u  s    r&   c                       F   e Zd ZdZdZdgZdZdgZdgZdZ	 fdd	Z
d
d Z  ZS )r'   zU
    Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
    zCSS+PHPzcss+phprh   r8  ztext/css+phprA  c                    r   r   )r   rm   r   r   r   r   rj   rp   rm     r   zCssPhpLexer.__init__c                 C   r2  r3  r   r   r   rj   rj   rp   r     r6  zCssPhpLexer.analyse_textr   rj   rj   r   rp   r'     s    r'   c                       J   e Zd ZdZdZddgZdZdgZg dZdZ	 fd	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   r0  )zapplication/x-javascript+phpztext/x-javascript+phpztext/javascript+phprA  c                    r   r   )r   rm   r   r   r   r   rj   rp   rm     r   zJavascriptPhpLexer.__init__c                 C   
   t | S r   rD  r   rj   rj   rp   r        
zJavascriptPhpLexer.analyse_textr   rj   rj   r   rp   r(     r>  r(   c                       rB  )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                    r   r   )r   rm   r   r.   r   r   rj   rp   rm     r   zHtmlSmartyLexer.__init__c                 C   r   r<  )r.   r   r#   r   rj   rj   rp   r     r   zHtmlSmartyLexer.analyse_textr   rj   rj   r   rp   r/     s    r/   c                       r   )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                    r   r   )r   rm   r   r.   r   r   rj   rp   rm     r   zXmlSmartyLexer.__init__c                 C   r   r   )r.   r   r$   r   rj   rj   rp   r     r   zXmlSmartyLexer.analyse_textr   rj   rj   r   rp   r0         r0   c                       r   )r1   z]
    Subclass of the `SmartyLexer` that highlights unlexed data with the
    `CssLexer`.
    z
CSS+Smartyz
css+smartyrh   r8  r   ztext/css+smartyr   c                    r   r   )r   rm   r   r.   r   r   rj   rp   rm     r   zCssSmartyLexer.__init__c                 C   r2  r3  r.   r   r   rj   rj   rp   r     r6  zCssSmartyLexer.analyse_textr   rj   rj   r   rp   r1     rH  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   r0  r   )zapplication/x-javascript+smartyztext/x-javascript+smartyztext/javascript+smartyr   c                    r   r   )r   rm   r   r.   r   r   rj   rp   rm     r   zJavascriptSmartyLexer.__init__c                 C   r2  r3  rI  r   rj   rj   rp   r   
  r6  z"JavascriptSmartyLexer.analyse_textr   rj   rj   r   rp   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                    r   r   )r   rm   r   r3   r   r   rj   rp   rm     r   zHtmlDjangoLexer.__init__c                 C   r   r<  )r3   r   r#   r   rj   rj   rp   r   !  r   zHtmlDjangoLexer.analyse_textr.  rj   rj   r   rp   r4     s    r4   c                       R   e Zd ZdZdZddgZddgZdZdgZd	d
gZ	dZ
 fd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                    r   r   )r   rm   r   r3   r   r   rj   rp   rm   6  r   zXmlDjangoLexer.__init__c                 C   r   r   )r3   r   r$   r   rj   rj   rp   r   9  r   zXmlDjangoLexer.analyse_textr.  rj   rj   r   rp   r6   (      r6   c                       rK  )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   r8  ztext/css+djangoztext/css+jinjar   c                    r   r   )r   rm   r   r3   r   r   rj   rp   rm   N  r   zCssDjangoLexer.__init__c                 C   r2  r3  r3   r   r   rj   rj   rp   r   Q  r6  zCssDjangoLexer.analyse_textr.  rj   rj   r   rp   r5   @  rL  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   r0  )zapplication/x-javascript+djangozapplication/x-javascript+jinjaztext/x-javascript+djangoztext/x-javascript+jinjaztext/javascript+djangoztext/javascript+jinjar   c                    r   r   )r   rm   r   r3   r   r   rj   rp   rm   i  r   zJavascriptDjangoLexer.__init__c                 C   r2  r3  rM  r   rj   rj   rp   r   l  r6  z"JavascriptDjangoLexer.analyse_textr.  rj   rj   r   rp   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).*?>[^<]+<ru   r   [\w\W]+?(?=%>|\Z)r   rP  N)	r   r   r   r   r   r!   r   r
   r   rj   rj   rj   rp   rN  p  s    		

rN  c                       F   e Zd ZdZdZdgZdgZdgZdZdZ	 fd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                    r   r   r   rm   r   rN  r   r   rj   rp   rm     r   zJspLexer.__init__c                 C   :   t | d }t| r|d7 }d| v rd| v r|d7 }|S Nr   r   rt   ru   r   )r
   r   r$   r   rj   rj   rp   r        zJspLexer.analyse_textr   r   r   r   r   r   r   r   r   r   rm   r   r   rj   rj   r   rp   rH         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   ra  c                 C   s   d| v rdS dS )z.Evoque templates use $evoque, which is unique.z$evoquerq   Nrj   r   rj   rj   rp   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   rj   rj   rj   rp   rM     sV    




'rM   c                       rU  )rN   z^
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML+Evoquezhtml+evoquer   ztext/html+evoquer_  r`  c                    r   r   )r   rm   r   rM   r   r   rj   rp   rm     r   zEvoqueHtmlLexer.__init__c                 C   rF  r   rM   r   r   rj   rj   rp   r     rG  zEvoqueHtmlLexer.analyse_textr   r   r   r   r   r   r   r   r   r   rm   r   r   rj   rj   r   rp   rN         rN   c                       rU  )rO   z]
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
    `XmlLexer`.
    z
XML+Evoquez
xml+evoquer   zapplication/xml+evoquer_  r`  c                    r   r   )r   rm   r   rM   r   r   rj   rp   rm     r   zEvoqueXmlLexer.__init__c                 C   rF  r   rc  r   rj   rj   rp   r     rG  zEvoqueXmlLexer.analyse_textrd  rj   rj   r   rp   rO     re  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cfs5https://www.adobe.com/products/coldfusion-family.htmlrh   z//.*?\nz/\*(?:.|\n)*?\*/z\+\+|--z
[-+*/^&=!]z<=|>=|<|>|==zmod\bz"(eq|lt|gt|lte|gte|not|is|and|or)\bz\|\||&&z\?r  stringr	  \d+z(if|else|len|var|xml|default|break|switch|component|property|function|do|try|catch|in|continue|for|return|while|required|any|array|binary|boolean|component|date|guid|numeric|query|string|struct|uuid|case)\br   zD(application|session|client|cookie|super|this|variables|arguments)\bz([a-z_$][\w.]*)(\s*)(\()z[a-z_$][\w.]*z[()\[\]{};:,.\\]r   z""z#.+?#z[^"#]+rb  r   )r   ri  N)r   r   r   r   r   r   r   r   r   r   r   
IGNORECASEr   r   r   r  r   r   r   r    r   r   r   r   r   r   r   r   Interpr   rj   rj   rj   rp   rP     sT    


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
    
Coldfusioncfrh  rQ  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)<[^<>]*rb  r   z--->z([^<-]|<(?!!---)|-(?!-->))+)r   rp  rr  rq  N)r   r   r   r   r   r   r   r   r   r!   r   r   r  r   r   r   r   rP   r   r   rj   rj   rj   rp   rm  2  sF    





rm  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-coldfusionrh  rh   c                    r   r   )r   rm   r   rm  r   r   rj   rp   rm   l  r   zColdfusionHtmlLexer.__init__r   r   r   r   r   r   r   r   r   r   rm   r   rj   rj   r   rp   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*.cfcrh  2.0c                    r   r   )r   rm   rQ   rP   r   r   rj   rp   rm   {  r   zColdfusionCFCLexer.__init__rt  rj   rj   r   rp   rR   p  s    rR   c                       rU  )rV   z)
    Lexer for Scalate Server Pages.
    zScalate Server Pagesspz*.sspzapplication/x-sspz"https://scalate.github.io/scalate/r   c                    r   r   rW  r   r   rj   rp   rm     r   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)  rt   ru   r   )r   r   r$   r   rj   rj   rp   r     s   zSspLexer.analyse_textr[  rj   rj   r   rp   rV     r\  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
    rO  rP  rQ  rR  ru   r   rS  rT  N)	r   r   r   r   r   r!   r   r   r   rj   rj   rj   rp   rx    s    	

rx  c                       rU  )rW   z"
    Lexer for Tea Templates.
    Teateaz*.teaz
text/x-teaz$https://github.com/teatrove/teatrovez1.5c                    r   r   )r   rm   r   rx  r   r   rj   rp   rm     r   zTeaTemplateLexer.__init__c                 C   rX  rY  )r   r   r$   r   rj   rj   rp   r     rZ  zTeaTemplateLexer.analyse_textr[  rj   rj   r   rp   rW     r\  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                    r   r   )r   rm   r   r   r   r   rj   rp   rm     r   zLassoHtmlLexer.__init__c                 C   r   r<  )r   r   r#   r   rj   rj   rp   r     r   zLassoHtmlLexer.analyse_textr   rj   rj   r   rp   rX     s    rX   c                       rB  )rY   z_
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `XmlLexer`.
    z	XML+Lassoz	xml+lassor{  )r   r|  r}  r~  r  r  zapplication/xml+lassor  c                    r   r   )r   rm   r   r   r   r   rj   rp   rm     r   zLassoXmlLexer.__init__c                 C   r   r   )r   r   r$   r   rj   rj   rp   r     r   zLassoXmlLexer.analyse_textr   rj   rj   r   rp   rY     s    rY   c                       rC  )rZ   z_
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `CssLexer`.
    z	CSS+Lassoz	css+lassor{  r8  ztext/css+lassor  c                    "   d|d< t  jttfi | d S NTrequiredelimiters)r   rm   r   r   r   r   rj   rp   rm        zLassoCssLexer.__init__c                 C   s6   t | d }td| r|d7 }d| v r|d7 }|S )Nr4  z
\w+:[^;]+;r   zpadding:)r   r   r   r   r   rj   rj   rp   r   
  s   zLassoCssLexer.analyse_textr   rj   rj   r   rp   rZ     s    rZ   c                       rE  )r[   zf
    Subclass of the `LassoLexer` which highlights unhandled data with the
    `JavascriptLexer`.
    zJavaScript+Lassozjavascript+lassozjs+lassor{  r0  )zapplication/x-javascript+lassoztext/x-javascript+lassoztext/javascript+lassor  c                    r  r  )r   rm   r   r   r   r   rj   rp   rm   "  r  zLassoJavascriptLexer.__init__c                 C   s   t | d }|S r3  )r   r   r   rj   rj   rp   r   &  s   z!LassoJavascriptLexer.analyse_textr   rj   rj   r   rp   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/
handlebarsrv  r   z\{\{!.*\}\}z(\{\{\{)(\s*)r   z(\{\{)([#~/]+)([^\s}]*)(\{\{)(\s*)r   z\}\}\}r   z
(~?)(\}\})z([^\s}]+)(=)z(>)(\s*)(@partial-block)z(#?>)(\s*)([\w-]+)z(>)(\s*)(\()dynamic-partialgenericr   z(lookup)(\s+)(\.|this)(\s+)z(lookup)(\s+)(\S+)r   r   z[\w-]+z[()/@a-zA-Z][\w-]*z\.[\w-]+z(this\/|\.\/|(\.\.\/)+)[\w-]+r   r   r   )r   r   r  r   r  N)r   r   r   r   r   r   r   r   r!   r   r   Specialr   r{   r    r   r   r   r   r   r   r   r   r   r   r   r   r   r   rj   rj   rj   rp   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  rv  c                    r   r   )r   rm   r   r\   r   r   rj   rp   rm     r   zHandlebarsHtmlLexer.__init__rt  rj   rj   r   rp   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.comrv  c                    r   r   )r   rm   r   r3   r   r   rj   rp   rm     r   zYamlJinjaLexer.__init__rt  rj   rj   r   rp   r^     s    r^   c                   @   s  e Zd ZdZdZdZdgZdgZdZi dde	fde
eed	fd
e
eeeedddfde	fgd	dejdfde
ejeedddfde
ejeedfde
ejeeed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
dedd#edfd$ed%fgd%edd#ed&fd'e
ejeed(fgd(d$edfed)ed*gdededd+e
eed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d/eded0gd1d2e
eededfd3e
eejedfgd)d#edfgdd4ed&fgd0d5edfgd6edd7e
ejeefd8e
eeeeddeefed9ed:ed;d<efgd*ed6d=e	fgd>ed6edd=e	fgd"d4ed&fed*gd d4ed&fed>gd;d?ejfgd@ejfdAefgdBejfdCejfgdDejfdEej fged;ed9ed:edgdFefgdGe
eeejeed&fd=e!fgde	fdHe
eeejeedfde	fgdIZ"dS )Jr_   z%
    Lexer for Liquid templates.
    liquidz.https://www.rubydoc.info/github/Shopify/liquidz*.liquidrv  r   r   z
(\{%)(\s*)ztag-or-blockz(\{\{)(\s*)([^\s}]+)r  r  outputr   z(if|unless|elsif|case)(?=\s+)	conditionz(when)(\s+)zend-of-block
whitespacez(else)(\s*)(%\})r   z!(capture)(\s+)([^\s%]+)(\s*)(%\})r   z(comment)(\s*)(%\})ra  z(raw)(\s*)(%\})rawz(end(case|unless|if))(\s*)(%\})Nz(end([^\s%]+))(\s*)(%\})z"(cycle)(\s+)(?:([^\s:]*)(:))?(\s*)zvariable-tag-markupz([^\s%]+)(\s*)z
tag-markup\}\}z\|filters)r   r   z([^\s|:]+)(:?)(\s*)zfilter-markupz
end-of-tagzdefault-param-markupz/([^\s=!><]+)(\s*)([=!><]=?)(\s*)(\S+)(\s*)(%\})z\b!z\bnot\bz*([\w.\'"]+)(\s+)(contains)(\s+)([\w.\'"]+)zgeneric-valuezend-at-whitespaceoperatorz(\s*)((=|!|>|<)=?)(\s*)z(\s*)(\bcontains\b)(\s*)z%\}r   zparam-markupz([^\s=:]+)(\s*)(=|:)z(\{\{)(\s*)([^\s}])(\s*)(\}\})ri  numberkeyword,r   zvariable-param-markupz\b(false|true)\br   z(?<=\w)\.(?=\w)z'[^']*'z"[^"]*"z\d+\.\d+rj  z[ \t]+z (\{%)(\s*)(endcomment)(\s*)(%\})z(\{%)(\s*)(endraw)(\s*)(%\}))r   ri  r  r  r  ra  r  )#r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Reservedr   r   r   r   r   r   Wordr   r   r   r   r   r   r    FloatIntegerr   r   rj   rj   rj   rp   r_     s   

-4<BTY`dhm}   	       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.comrv  z[\\\w-]|[^\x00-\x7f]z(?:[\\_a-z]|[^\x00-\x7f])z(?:z)*r   r   r   z\{\#.*?\#\}r   zL(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})z(\{%)(-?\s*)(filter)(\s+)(r   r   r   r   z
(\|)(\s*)(z(is)(\s+)(not)?(\s*)(z(?i)(true|false|none|null)\bz(in|not|and|b-and|or|b-or|b-xor|isif|elseif|else|importconstant|defined|divisibleby|empty|even|iterable|odd|sameasmatches|starts\s+with|ends\s+with)\bz(loop|block|parent)\bz\.z\.[0-9]+r   r   z4([{}()\[\]+\-*/,:~%]|\.\.|\?|:|\*\*|\/\/|!=|[><=]=?)r   r   r   r   r   r   r   )r   r   r   r   N)$r   r   r   r   r   r   r   r   r   r   r   r   r   _ident_char_ident_begin
_ident_end_ident_innerr!   r   r{   r   r   r   r   r   r   r   r   r   r    r   r   r   r   r   r   rj   rj   rj   rp   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  rv  c                    r   r   )r   rm   r   r`   r   r   rj   rp   rm     r   zTwigHtmlLexer.__init__rt  rj   rj   r   rp   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+)?r  r   z:?(true|false)r   r   r   z[a-zA-Z][\w-]*(\(.*\))?z\.[\w-]+(\(.*\))?z-(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)r  r	  r
  )r   r  r  N)r   r   r   r   r   r   r   r   r!   r   r   r{   r   r   r   r   r   r   Booleanr   r   r    r   r   rj   rj   rj   rp   rb     sR    

rb   c                       r   )	rc   z`
    Subclass of the `Angular2Lexer` that highlights unlexed data with the
    `HtmlLexer`.
    zHTML + Angular2zhtml+ng2z*.ng2r  rv  c                    r   r   )r   rm   r   rb   r   r   rj   rp   rm   	  r   zAngular2HtmlLexer.__init__)r   r   r   r   r   r   r   r   r   rm   r   rj   rj   r   rp   rc   
	  r   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                    r   r   )r   rm   r   r3   r   r   rj   rp   rm   %	  r   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   rj   rj   rp   r   (	  s   zSqlJinjaLexer.analyse_text)r   r   r   r   r   r   r   r   r   rm   r   r   rj   rj   r   rp   rd   	  s    rd   )wr   r   pygments.lexers.htmlr   r   pygments.lexers.javascriptr   r   pygments.lexers.cssr   pygments.lexers.phpr   pygments.lexers.pythonr   pygments.lexers.perlr	   pygments.lexers.jvmr
   r   pygments.lexers.datar   pygments.lexers.sqlr   pygments.lexerr   r   r   r   r   r   r   r   r   pygments.tokenr   r   r   r   r   r   r   r   r   r    r!   r"   pygments.utilr#   r$   __all__r)   r.   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   rN  rH   rM   rN   rO   rP   rm  rQ   rR   rV   rx  rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   rj   rj   rj   rp   <module>   s    
,8`:TU.6B-$@93/L NS>