�
|�e� � �� � d Z ddlZddlmZmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ dd lmZmZ dd
lmZ ddlmZ ddlmZmZmZmZmZmZmZmZm Z dd
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- ddl.m/Z/m0Z0 g d�Z1 G d� de� Z2 G d� de� Z3 G d� de� Z4 G d� de� Z5 G d� de� Z6 G d� de� Z7 G d� de� Z8 G d� de� Z9 G d � d!e� Z: G d"� d#e� Z; G d$� d%e� Z< G d&� d'e� Z= G d(� d)e� Z> G d*� d+e� Z? G d,� d-e� Z@ G d.� d/e� ZA G d0� d1e� ZB G d2� d3e� ZC G d4� d5e� ZD G d6� d7e� ZE G d8� d9e� ZF G d:� d;e� ZG G d<� d=e� ZH G d>� d?e� ZI G d@� dAe� ZJ G dB� dCe� ZK G dD� dEe� ZL G dF� dGe� ZM G dH� dIe� ZN G dJ� dKe� ZO G dL� dMe� ZP G dN� dOe� ZQ G dP� dQe� ZR G dR� dSe� ZS G dT� dUe� ZT G dV� dWe� ZU G dX� dYe� ZV G dZ� d[e� ZW G d\� d]e� ZX G d^� d_e� ZY G d`� dae� ZZ G db� dce� Z[ G dd� dee� Z\ G df� dge� Z] G dh� die� Z^ G dj� dke� Z_ G dl� dme� Z` G dn� doe� Za G dp� dqe� Zb G dr� dse� Zc G dt� due� Zd G dv� dwe� Ze G dx� dye� Zf G dz� d{e� Zg G d|� d}e� Zh G d~� de� Zi G d�� d�e� Zj G d�� d�e� Zk G d�� d�e� Zl G d�� d�e� Zm G d�� d�e� Zn G d�� d�e� Zo G d�� d�e� Zp G d�� d�e� Zq G d�� d�e� Zr G d�� d�e� Zs G d�� d�e� Zt G d�� d�e� Zu G d�� d�e� Zvy)�z�
pygments.lexers.templates
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various template engines' markup.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)� HtmlLexer�XmlLexer)�JavascriptLexer�
LassoLexer)�CssLexer)�PhpLexer)�PythonLexer)� PerlLexer)� JavaLexer�TeaLangLexer)� YamlLexer)�SqlLexer) �Lexer�DelegatingLexer�
RegexLexer�bygroups�include�using�this�default�combined)�Error�Punctuation�
Whitespace�Text�Comment�Operator�Keyword�Name�String�Number�Other�Token)�html_doctype_matches�looks_like_xml)@�HtmlPhpLexer�XmlPhpLexer�CssPhpLexer�JavascriptPhpLexer�ErbLexer�
RhtmlLexer�XmlErbLexer�CssErbLexer�JavascriptErbLexer�SmartyLexer�HtmlSmartyLexer�XmlSmartyLexer�CssSmartyLexer�JavascriptSmartyLexer�DjangoLexer�HtmlDjangoLexer�CssDjangoLexer�XmlDjangoLexer�JavascriptDjangoLexer�GenshiLexer�HtmlGenshiLexer�GenshiTextLexer�CssGenshiLexer�JavascriptGenshiLexer�MyghtyLexer�MyghtyHtmlLexer�MyghtyXmlLexer�MyghtyCssLexer�MyghtyJavascriptLexer�
MasonLexer� MakoLexer�
MakoHtmlLexer�MakoXmlLexer�MakoJavascriptLexer�MakoCssLexer�JspLexer�CheetahLexer�CheetahHtmlLexer�CheetahXmlLexer�CheetahJavascriptLexer�EvoqueLexer�EvoqueHtmlLexer�EvoqueXmlLexer�ColdfusionLexer�ColdfusionHtmlLexer�ColdfusionCFCLexer�
VelocityLexer�VelocityHtmlLexer�VelocityXmlLexer�SspLexer�TeaTemplateLexer�LassoHtmlLexer�
LassoXmlLexer�
LassoCssLexer�LassoJavascriptLexer�HandlebarsLexer�HandlebarsHtmlLexer�YamlJinjaLexer�LiquidLexer� TwigLexer�
TwigHtmlLexer�
Angular2Lexer�Angular2HtmlLexer�
SqlJinjaLexerc �p � e Zd ZdZdZdZdgZdgZ ej dej � Zd� Zd� Z
d � Zy
)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`.
�ERBzhttps://github.com/ruby/erb�erbzapplication/x-ruby-templatingz*(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)c �V � ddl m} |di |��| _ t j | fi |�� y )Nr )� RubyLexer� )�pygments.lexers.rubyrj �
ruby_lexerr �__init__)�self�optionsrj s �;/usr/lib/python3/dist-packages/pygments/lexers/templates.pyrn zErbLexer.__init__D s% � �2�#�.�g�.���
���t�'�w�'� c # �j K � | j j |� }|j � dx}} |dk( r-|j � }|t |f�� |t |� z
}d}�n�|dk( �rl|j � }|dv r|t |f�� |dz
}d}�n�|dk( rH|t j |f�� |j � }|dz t |f�� |dt |� z z
}d}�nA|dv rt|t j |f�� |t |� z
}|j � }d}| j j |� D ] \ }} }
||z | |
f�� � |t |� z
}d}n�|dv r|t |f�� |t |� z
}d}n�|t j |d f�� d}| j j |dd � D ] \ }} }
|dz |z | |
f�� � |t |� z
}d}nJ|dk( rE|j � }|dvr|t |f�� n|t j |f�� |t |� z
}d}���# t $ r Y y w xY w�w)
z�
Since ERB doesn't allow "<%" and other tags inside of ruby
blocks we have to use a split approach here that fails for
that too.
r � )z<%%z%%>� z<%#� )�<%z<%=z<%-)�%>z-%>N)� _block_re�split�reverse�popr" |