B
    beM                 @   s"  d Z ddlZddl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 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 dd	lmZ d
ddddddg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Z%e%Z&dS )z
    pygments.lexers.html
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for HTML, XML and related markup.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerExtendedRegexLexerincludebygroupsdefaultusing)TextCommentOperatorKeywordNameStringPunctuation)looks_like_xmlhtml_doctype_matches)JavascriptLexer)
ScalaLexer)CssLexer_indentation_starts_block)	RubyLexer	HtmlLexerDtdLexerXmlLexer	XsltLexer	HamlLexer
ScamlLexerPugLexerc               @   s  e Zd ZdZdZdZdgZddddgZd	d
gZe	j
e	jB Z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eeejedfdeeeejedfdeeeejdfdeeeeeejeefg
defdeejeedfdejfdeeeedfgdeeeeeejeedfdeefd eedfd!eedfgd"eeeeeejeedfd#eefd eedfd!eedfgd$edfd%edfd&edfgd'Zd(d) Zd*S )+r   zo
    For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
    by the appropriate lexer.
    ZHTMLzhttps://html.spec.whatwg.org/Zhtmlz*.htmlz*.htmz*.xhtmlz*.xsltz	text/htmlzapplication/xhtml+xmlz[^<&]+z&\S*?;z\<\!\[CDATA\[.*?\]\]\>z
<!--.*?-->z	<\?.*?\?>z<![^>]*>z(<)(\s*)(script)(\s*))zscript-contenttagz(<)(\s*)(style)(\s*))zstyle-contentr   z(<)(\s*)([\w:.-]+)r   z"(<)(\s*)(/)(\s*)([\w:.-]+)(\s*)(>)z\s+z([\w:-]+\s*)(=)(\s*)attrz[\w:-]+z(/?)(\s*)(>)z#popz (<)(\s*)(/)(\s*)(script)(\s*)(>)z.+?(?=<\s*/\s*script\s*>)z.+?\nz.+z(<)(\s*)(/)(\s*)(style)(\s*)(>)z.+?(?=<\s*/\s*style\s*>)z".*?"z'.*?'z[^\s>]+)rootr   zscript-contentzstyle-contentr   c             C   s   t | rdS d S )Ng      ?)r   )text r"   3lib/python3.7/site-packages/pygments/lexers/html.pyanalyse_texte   s    zHtmlLexer.analyse_textN)__name__
__module____qualname____doc__nameZurlaliases	filenames	mimetypesre
IGNORECASEDOTALLflagsr   r   Entityr	   Preproc	Multiliner   r   Tag	Attributer
   r   r   r   r   tokensr$   r"   r"   r"   r#   r      sZ   

c               @   s  e Zd ZdZejejB ZdZdgZ	dgZ
dgZeddeeeejdfd	eeeejd
fdeeeejdfdeeeejdfdeeejeefdeeeejfdejfdefg	defdejfdedfdefdejfdejfgdefdedfdefgeddejfdejfd edfgedd!ejfd"ejfd#ejfdejfd edfgedd$ejfdejfd edfgedd%ejfdejfd edfgd&Zd'd( Zd)S )*r   zR
    A lexer for DTDs (Document Type Definitions).

    .. versionadded:: 1.5
    ZDTDZdtdz*.dtdzapplication/xml-dtdcommonz(<!ELEMENT)(\s+)(\S+)elementz(<!ATTLIST)(\s+)(\S+)attlistz(<!ENTITY)(\s+)(\S+)entityz(<!NOTATION)(\s+)(\S+)notationz(<!\[)([^\[\s]+)(\s*)(\[)z(<!DOCTYPE)(\s+)([^>\s]+)zPUBLIC|SYSTEMz[\[\]>]z\s+z(%|&)[^;]*;z<!--commentz	[(|)*,?+]z"[^"]*"z
\'[^\']*\'z[^-]+z-->z#pop-zEMPTY|ANY|#PCDATAz[^>\s|()?+*,]+>z?CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITIES|ENTITY|NOTATIONz#REQUIRED|#IMPLIED|#FIXEDzxml:space|xml:langzSYSTEM|PUBLIC|NDATAzSYSTEM|PUBLIC)r    r7   r<   r8   r9   r:   r;   c             C   s(   t | s$d| ks d| ks d| kr$dS d S )Nz	<!ELEMENTz	<!ATTLISTz<!ENTITYg?)r   )r!   r"   r"   r#   r$      s    zDtdLexer.analyse_textN)r%   r&   r'   r(   r-   	MULTILINEr/   r0   r)   r*   r+   r,   r   r   r   r   r   r4   r1   ZConstantr	   r
   r   DoubleSingleZReservedr5   r6   r$   r"   r"   r"   r#   r   j   sd   



c            	   @   s   e Zd ZdZejejB ZdZdgZ	dddddd	d
gZ
dddddgZ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jdfdejfgdefdejdfdejdfgdefdedfdedfd edfgd!Zd"d# Zd$S )%r   z=
    Generic lexer for XML (eXtensible Markup Language).
    ZXMLZxmlz*.xmlz*.xslz*.rssz*.xsltz*.xsdz*.wsdlz*.wsfztext/xmlzapplication/xmlzimage/svg+xmlzapplication/rss+xmlzapplication/atom+xmlz[^<&]+z&\S*?;z\<\!\[CDATA\[.*?\]\]\>z
<!--.*?-->z	<\?.*?\?>z<![^>]*>z<\s*[\w:.-]+r   z<\s*/\s*[\w:.-]+\s*>z\s+z[\w.:-]+\s*=r   z/?\s*>z#popz".*?"z'.*?'z[^\s>]+)r    r   r   c             C   s   t | rdS d S )Ng?)r   )r!   r"   r"   r#   r$      s    zXmlLexer.analyse_textN)r%   r&   r'   r(   r-   r?   r/   r0   r)   r*   r+   r,   r   r   r1   r	   r2   r3   r4   r5   r   r6   r$   r"   r"   r"   r#   r      s0   



c            #   @   s   e Zd ZdZdZdgZdddgZddgZd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+h#Zd,d- Z	d.d/ Z
d0S )1r   z7
    A lexer for XSLT.

    .. versionadded:: 0.10
    ZXSLTZxsltz*.xslz*.xsltz*.xplzapplication/xsl+xmlzapplication/xslt+xmlzapply-importszapply-templatesZ	attributezattribute-setzcall-templateZchooser<   copyzcopy-ofzdecimal-formatr8   fallbackzfor-eachifimportr   keymessageznamespace-aliasZnumberZ	otherwiseoutputZparamzpreserve-spacezprocessing-instructionsortzstrip-spaceZ
stylesheettemplater!   Z	transformzvalue-ofvariableZwhenz
with-paramc             c   sd   x^t | |D ]N\}}}td|}|tjkrP|rP|d| jkrP|t|fV  q|||fV  qW d S )Nz</?xsl:([^>]*)/?>?   )	r   get_tokens_unprocessedr-   matchr   r4   groupEXTRA_KEYWORDSr   )selfr!   indextokenvaluemr"   r"   r#   rM     s
    z XsltLexer.get_tokens_unprocessedc             C   s   t | rd| krdS d S )Nz<xslg?)r   )r!   r"   r"   r#   r$     s    zXsltLexer.analyse_textN)r%   r&   r'   r(   r)   r*   r+   r,   rP   rM   r$   r"   r"   r"   r#   r      s   



	c               @   sh  e Zd ZdZdZdgZdgZdgZej	Z
dZde d Zd	efd
efgdejdfdejdfgdedfde d eeeedfedgeddejdfde d ejdfde d e d eeejedfde d eeddfde d eejddfde d eeeedfde d eejd dfed!g	edd"e d# eefd$e d% eefd&ed'fd(ed)fd*efed!gd+efd,e d- eej eeej fd.edfgd/efd0ej!d1fd2ej!fd3edfgd4efd5ej"dfd6ej"j#dfd7ej"j$dfd8edfd9edfged: efd.edfged: ejfd.edfgd+ejfd,e d- eej eeej fd.edfgd;Z%d<S )=r   z5
    For Haml markup.

    .. versionadded:: 1.3
    ZHamlZhamlz*.hamlztext/x-hamlz(?: \|\n(?=.* \|)|.)z
(?:,\s*\n|)z[ \t]*\nz[ \t]*z	\.[\w:-]+r   z	\#[\w:-]+z[&!]?==plainz([&!]?[=~])(z*\n)r    cssz%[\w:-]+z!!!z*\nz#popz(/)(\[z*?\])(/zhtml-comment-blockz-#zhaml-comment-blockz(-)(:zfilter-blockzeval-or-plainz\{(,\n|z)*?\}z\[z*?\]z\(zhtml-attributesz	/[ \t]*\nz#pop:2z[<>]{1,2}(?=[ \t=])z([^#\n]|#[^{\n]|(\\\\)*\\#\{)+z(#\{)(z*?)(\})z\nz\s+z[\w:-]+[ \t]*=zhtml-attribute-valuez[\w:-]+z\)z[ \t]+z\w+z@\w+z\$\w+z'(\\\\|\\[^\\]|[^'\\\n])*'z"(\\\\|\\[^\\]|[^"\\\n])*"+)r    rX   zeval-or-plaincontentr   rW   zhtml-attributeszhtml-attribute-valuezhtml-comment-blockzhaml-comment-blockzfilter-blockN)&r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r0   _dotZ
_comma_dotr   r   r   ClassFunctionr   r   r   r   r   r   r4   	Namespacer	   Specialr   r2   	Decoratorr   Interpolr5   VariableInstanceGlobalr6   r"   r"   r"   r#   r     s|   













c               @   sx  e Zd ZdZdZdgZdgZdgZej	Z
dZdefdefgd	ejd
fdejd
fgdedfde d eeeedfedgeddejd
fde d ejdfde d e d eeejedfde d eeddfde d eejddfde d eeeeedfde d eeeedfde d eejddfed g
edd!e d" eefd#e d$ eefd%ed&fd'ed(fd)efed gd*efd+e d, eej eeej fd-edfgd.efd/ej!d0fd1ej!fd2edfgd3efd4ej"dfd5ej"j#dfd6ej"j$dfd7edfd8edfged9 efd-edfged9 ejfd-edfgd*ejfd+e d, eej eeej fd-edfgd:Z%d;S )<r   zt
    For `Scaml markup <http://scalate.fusesource.org/>`_.  Scaml is Haml for Scala.

    .. versionadded:: 1.4
    ZScamlZscamlz*.scamlztext/x-scaml.z[ \t]*\nz[ \t]*z	\.[\w:-]+r   z	\#[\w:-]+z[&!]?==rW   z([&!]?[=~])(z*\n)r    rX   z%[\w:-]+z!!!z*\nz#popz(/)(\[z*?\])(rY   zhtml-comment-blockz-#zscaml-comment-blockz(-@\s*)(import)?(z(-)(rZ   zfilter-blockzeval-or-plainz\{(,\n|z)*?\}z\[z*?\]z\(zhtml-attributesz	/[ \t]*\nz#pop:2z[<>]{1,2}(?=[ \t=])z([^#\n]|#[^{\n]|(\\\\)*\\#\{)+z(#\{)(z*?)(\})z\nz\s+z[\w:-]+[ \t]*=zhtml-attribute-valuez[\w:-]+z\)z[ \t]+z\w+z@\w+z\$\w+z'(\\\\|\\[^\\]|[^'\\\n])*'z"(\\\\|\\[^\\]|[^"\\\n])*"r[   )r    rX   zeval-or-plainr\   r   rW   zhtml-attributeszhtml-attribute-valuezhtml-comment-blockzscaml-comment-blockzfilter-blockN)&r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r0   r]   r   r   r   r^   r_   r   r   r   r   r   r   r4   r`   r	   ra   r   r2   r   rb   r   rc   r5   rd   re   rf   r6   r"   r"   r"   r#   r     s   














c               @   s  e Zd ZdZdZddgZddgZddgZej	Z
d	Zd
efdefgdejdfdejdfgdedfde d eeeedfedgedde d ejdfde d e d eeejedfde d eeddfde d eejddfde d eeeeedfde d eeeedfd e d eejd!dfd"ejdfd#ed$fg
edd%e d& eefd'e d( eefd)ed*fd+ed,fd-efed$gd.efd/e d0 eej eeej fd1edfgd2efd3ej!d4fd"ej!fd5edfgd6efd7ej"dfd8ej"j#dfd9ej"j$dfd:edfd;edfged< efd1edfged< ejfd1edfgd.ejfd/e d0 eej eeej fd1edfgd=Z%d>S )?r   z
    For Pug markup.
    Pug is a variant of Scaml, see:
    http://scalate.fusesource.org/documentation/scaml-reference.html

    .. versionadded:: 1.4
    ZPugZpugZjadez*.pugz*.jadez
text/x-pugztext/x-jaderg   z[ \t]*\nz[ \t]*z	\.[\w:-]+r   z	\#[\w:-]+z[&!]?==rW   z([&!]?[=~])(z*\n)r    rX   z!!!z*\nz#popz(/)(\[z*?\])(rY   zhtml-comment-blockz-#zscaml-comment-blockz(-@\s*)(import)?(z(-)(rZ   zfilter-blockz[\w:-]+z\|zeval-or-plainz\{(,\n|z)*?\}z\[z*?\]z\(zhtml-attributesz	/[ \t]*\nz#pop:2z[<>]{1,2}(?=[ \t=])z([^#\n]|#[^{\n]|(\\\\)*\\#\{)+z(#\{)(z*?)(\})z\nz\s+z[\w:-]+[ \t]*=zhtml-attribute-valuez\)z[ \t]+z\w+z@\w+z\$\w+z'(\\\\|\\[^\\]|[^'\\\n])*'z"(\\\\|\\[^\\]|[^"\\\n])*"r[   )r    rX   zeval-or-plainr\   r   rW   zhtml-attributeszhtml-attribute-valuezhtml-comment-blockzscaml-comment-blockzfilter-blockN)&r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r0   r]   r   r   r   r^   r_   r   r   r   r   r   r   r`   r	   ra   r   r2   r   rb   r4   r   rc   r5   rd   re   rf   r6   r"   r"   r"   r#   r     s~   















)'r(   r-   Zpygments.lexerr   r   r   r   r   r   Zpygments.tokenr   r	   r
   r   r   r   r   Zpygments.utilr   r   Zpygments.lexers.javascriptr   Zpygments.lexers.jvmr   Zpygments.lexers.cssr   r   r   Zpygments.lexers.rubyr   __all__r   r   r   r   r   r   r   Z	JadeLexerr"   r"   r"   r#   <module>	   s$    $
NX+%opk