3
.ßL]UK  ã               @   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-2019 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               @   sx  e 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d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dfd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gd#eeeeeejeeƒdfd$eeƒ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HTMLÚhtmlz*.htmlz*.htmz*.xhtmlz*.xsltz	text/htmlzapplication/xhtml+xmlz[^<&]+z&\S*?;z\<\!\[CDATA\[.*?\]\]\>z<!--Úcommentz	<\?.*?\?>z<![^>]*>z(<)(\s*)(script)(\s*)úscript-contentÚtagz(<)(\s*)(style)(\s*)ústyle-contentz(<)(\s*)([\w:.-]+)z"(<)(\s*)(/)(\s*)([\w:.-]+)(\s*)(>)z[^-]+z-->z#popú-z\s+z([\w:-]+\s*)(=)(\s*)Úattrz[\w:-]+z(/?)(\s*)(>)z (<)(\s*)(/)(\s*)(script)(\s*)(>)z.+?(?=<\s*/\s*script\s*>)z(<)(\s*)(/)(\s*)(style)(\s*)(>)z.+?(?=<\s*/\s*style\s*>)z".*?"z'.*?'z[^\s>]+)Úrootr   r!   zscript-contentzstyle-contentr$   c             C   s   t | ƒrdS d S )Ng      à?)r   )Útext© r'   ú:/tmp/pip-install-5sebvq2j/pygments/pygments/lexers/html.pyÚanalyse_text^   s    zHtmlLexer.analyse_textN)r    r!   )r"   r!   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚreÚ
IGNORECASEÚDOTALLÚflagsr   r   ÚEntityr	   ÚPreprocr   r   ÚTagÚ	Attributer
   r   r   r   r   Útokensr)   r'   r'   r'   r(   r      sV   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<!--r   z	[(|)*,?+]z"[^"]*"z
\'[^\']*\'z[^-]+z-->z#popr#   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%   r;   r   r<   r=   r>   r?   c             C   s*   t | ƒ r&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-   r2   Ú	MULTILINEr4   r5   r.   r/   r0   r1   r   r   r   r   r   r8   r6   ÚConstantr	   r
   r   ÚDoubleÚSingleZReservedr9   r:   r)   r'   r'   r'   r(   r   c   sd   



c            	   @   sî   e Zd ZdZejejB 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dfdejfdejfdejdfdejfgdefdedfde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*.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<!--r   z	<\?.*?\?>z<![^>]*>z<\s*[\w:.-]+r!   z<\s*/\s*[\w:.-]+\s*>z[^-]+z-->z#popr#   z\s+z[\w.:-]+\s*=r$   z/?\s*>z".*?"z'.*?'z[^\s>]+)r%   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-   r2   rA   r4   ÚUNICODEr5   r.   r/   r0   r1   r   r   r6   r	   r7   r8   r9   r   r:   r)   r'   r'   r'   r(   r   »   s6   



c            $   @   sD   e Zd ZdZdZdgZdddgZddgZed1ƒZ	d,d-„ Z
d.d/„ Zd0S )2r   z7
    A lexer for XSLT.

    .. versionadded:: 0.10
    ZXSLTZxsltz*.xslz*.xsltz*.xplzapplication/xsl+xmlzapplication/xslt+xmlúapply-importsúapply-templatesÚ	attributeúattribute-setúcall-templateÚchooser   Úcopyúcopy-ofúdecimal-formatr<   Úfallbackúfor-eachÚifÚimportr   ÚkeyÚmessageúnamespace-aliasÚnumberÚ	otherwiseÚoutputÚparamúpreserve-spaceúprocessing-instructionÚsortústrip-spaceÚ
stylesheetÚtemplater&   Ú	transformúvalue-ofÚvariableÚwhenú
with-paramc             c   sd   x^t j| |ƒD ]N\}}}tjd|ƒ}|tjkrP|rP|jdƒ| jkrP|t|fV  q|||fV  qW d S )Nz</?xsl:([^>]*)/?>?é   )	r   Úget_tokens_unprocessedr2   Úmatchr   r8   ÚgroupÚEXTRA_KEYWORDSr   )Úselfr&   ÚindexÚtokenÚvalueÚmr'   r'   r(   rh     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)#rH   rI   rJ   rK   rL   rM   r   rN   rO   rP   r<   rQ   rR   rS   rT   r   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   r&   rb   rc   rd   re   rf   )r*   r+   r,   r-   r.   r/   r0   r1   Úsetrk   rh   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%   rt   zeval-or-plainÚcontentr!   rs   zhtml-attributeszhtml-attribute-valuezhtml-comment-blockzhaml-comment-blockzfilter-blockN)&r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r5   Ú_dotZ
_comma_dotr   r   r   ÚClassÚFunctionr   r   r   r   r   r   r8   Ú	Namespacer	   ÚSpecialr   r7   Ú	Decoratorr   ÚInterpolr9   ÚVariableÚInstanceÚGlobalr:   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[&!]?==rs   z([&!]?[=~])(z*\n)r%   rt   z%[\w:-]+z!!!z*\nz#popz(/)(\[z*?\])(ru   zhtml-comment-blockz-#zscaml-comment-blockz(-@\s*)(import)?(z(-)(rv   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])*"rw   )r%   rt   zeval-or-plainrx   r!   rs   zhtml-attributeszhtml-attribute-valuezhtml-comment-blockzscaml-comment-blockzfilter-blockN)&r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r5   ry   r   r   r   rz   r{   r   r   r   r   r   r   r8   r|   r	   r}   r   r7   r   r~   r   r   r9   r€   r�   r‚   r:   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-jaderƒ   z[ \t]*\nz[ \t]*z	\.[\w:-]+r!   z	\#[\w:-]+z[&!]?==rs   z([&!]?[=~])(z*\n)r%   rt   z!!!z*\nz#popz(/)(\[z*?\])(ru   zhtml-comment-blockz-#zscaml-comment-blockz(-@\s*)(import)?(z(-)(rv   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])*"rw   )r%   rt   zeval-or-plainrx   r!   rs   zhtml-attributeszhtml-attribute-valuezhtml-comment-blockzscaml-comment-blockzfilter-blockN)&r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r5   ry   r   r   r   rz   r{   r   r   r   r   r   r   r|   r	   r}   r   r7   r   r~   r8   r   r   r9   r€   r�   r‚   r:   r'   r'   r'   r(   r   ï  s~   















)'r-   r2   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$    $
FX0%opk