U
    祡ceM                     @   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/htmlz*.htmlz*.htmz*.xhtml*.xsltz	text/htmlzapplication/xhtml+xml[^<&]+&\S*?;\<\!\[CDATA\[.*?\]\]\>
<!--.*?-->	<\?.*?\?><![^>]*>z(<)(\s*)(script)(\s*))script-contenttagz(<)(\s*)(style)(\s*))style-contentr'   z(<)(\s*)([\w:.-]+)r'   z"(<)(\s*)(/)(\s*)([\w:.-]+)(\s*)(>)\s+z([\w:-]+\s*)(=)(\s*)attr[\w:-]+z(/?)(\s*)(>)#popz (<)(\s*)(/)(\s*)(script)(\s*)(>)z.+?(?=<\s*/\s*script\s*>)z.+?\nz.+z(<)(\s*)(/)(\s*)(style)(\s*)(>)z.+?(?=<\s*/\s*style\s*>)".*?"'.*?'[^\s>]+)rootr'   r&   r(   r*   c                 C   s   t | rdS d S )Ng      ?)r   text r3   8/tmp/pip-unpacked-wheel-6wad6tea/pygments/lexers/html.pyanalyse_texte   s    zHtmlLexer.analyse_textN)__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesre
IGNORECASEDOTALLflagsr   r   Entityr	   Preproc	Multiliner   r   Tag	Attributer
   r   r   r   r   tokensr5   r3   r3   r3   r4   r      s    

<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[\[\]>]r)   z(%|&)[^;]*;z<!--commentz	[(|)*,?+]z"[^"]*"z
\'[^\']*\'z[^-]+z-->r,   -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)r0   rI   rN   rJ   rK   rL   rM   c                 C   s(   t | s$d| ks d| ks d| kr$dS d S )Nz	<!ELEMENTz	<!ATTLISTz<!ENTITY皙?r   r1   r3   r3   r4   r5      s    zDtdLexer.analyse_textN)r6   r7   r8   r9   r?   	MULTILINErA   rB   r:   r<   r=   r>   r   r   r   r   r   rF   rC   Constantr	   r
   r   DoubleSingleZReservedrG   rH   r5   r3   r3   r3   r4   r   j   s       
Dc                	   @   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).
    XMLxmlz*.xml*.xslz*.rssr   z*.xsdz*.wsdlz*.wsfztext/xmlzapplication/xmlzimage/svg+xmlzapplication/rss+xmlzapplication/atom+xmlr    r!   r"   r#   r$   r%   z<\s*[\w:.-]+r'   z<\s*/\s*[\w:.-]+\s*>r)   z[\w.:-]+\s*=r*   z/?\s*>r,   r-   r.   r/   )r0   r'   r*   c                 C   s   t | rdS d S )Ng?rR   r1   r3   r3   r4   r5      s    zXmlLexer.analyse_textN)r6   r7   r8   r9   r?   rS   rA   rB   r:   r<   r=   r>   r   r   rC   r	   rD   rE   rF   rG   r   rH   r5   r3   r3   r3   r4   r      s@   
  


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xsltrY   r   z*.xplzapplication/xsl+xmlzapplication/xslt+xmlzapply-importszapply-templates	attributezattribute-setzcall-templatechooserN   copyzcopy-ofzdecimal-formatrJ   fallbackzfor-eachifimportr   keymessageznamespace-aliasnumberZ	otherwiseoutputparamzpreserve-spacezprocessing-instructionsortzstrip-spaceZ
stylesheettemplater2   Z	transformzvalue-ofvariablewhenz
with-paramc                 c   s`   t | |D ]N\}}}td|}|tjkrN|rN|d| jkrN|t|fV  q|||fV  qd S )Nz</?xsl:([^>]*)/?>?   )	r   get_tokens_unprocessedr?   matchr   rF   groupEXTRA_KEYWORDSr   )selfr2   indextokenvaluemr3   r3   r4   rj     s
    z XsltLexer.get_tokens_unprocessedc                 C   s   t | rd| krdS d S )Nz<xslrQ   rR   r1   r3   r3   r4   r5     s    zXsltLexer.analyse_textN)r6   r7   r8   r9   r:   r<   r=   r>   rm   rj   r5   r3   r3   r3   r4   r      sV   
                           	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|)[ \t]*\n[ \t]*	\.[\w:-]+r'   	\#[\w:-]+[&!]?==plain([&!]?[=~])(*\n)r0   css%[\w:-]+!!!*\nr,   (/)(\[*?\])(/html-comment-block-#haml-comment-block(-)(:filter-blockeval-or-plain\{(,\n|)*?\}\[*?\]\(html-attributes	/[ \t]*\n#pop:2[<>]{1,2}(?=[ \t=])([^#\n]|#[^{\n]|(\\\\)*\\#\{)+(#\{)(*?)(\})\nr)   [\w:-]+[ \t]*=html-attribute-valuer+   \)[ \t]+\w+@\w+\$\w+'(\\\\|\\[^\\]|[^'\\\n])*'"(\\\\|\\[^\\]|[^"\\\n])*"+)r0   r|   r   contentr'   ry   r   r   r   r   r   N)&r6   r7   r8   r9   r:   r<   r=   r>   r?   r@   rB   _dotZ
_comma_dotr   r   r   ClassFunctionr   r   r   r   r   r   rF   	Namespacer	   Specialr   rD   	Decoratorr   InterpolrG   VariableInstanceGlobalrH   r3   r3   r3   r4   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.rt   ru   rv   r'   rw   rx   ry   rz   r{   r0   r|   r}   r~   r   r,   r   r   r   r   r   scaml-comment-block(-@\s*)(import)?(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   r   r0   r|   r   r   r'   ry   r   r   r   r   r   N)&r6   r7   r8   r9   r:   r<   r=   r>   r?   r@   rB   r   r   r   r   r   r   r   r   r   r   r   r   rF   r   r	   r   r   rD   r   r   r   r   rG   r   r   r   rH   r3   r3   r3   r4   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-jader   rt   ru   rv   r'   rw   rx   ry   rz   r{   r0   r|   r~   r   r,   r   r   r   r   r   r   r   r   r   r   r+   z\|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   N)&r6   r7   r8   r9   r:   r<   r=   r>   r?   r@   rB   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r   rD   r   r   rF   r   r   rG   r   r   r   rH   r3   r3   r3   r4   r     s   


 








)'r9   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	JadeLexerr3   r3   r3   r4   <module>   s(   
 $
 NX+%opk