
    |e$O                     \   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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 g d
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      Z&e&Z' G d de      Z(y)z
    pygments.lexers.html
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for HTML, XML and related markup.

    :copyright: Copyright 2006-2023 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
Whitespace)looks_like_xmlhtml_doctype_matches)JavascriptLexer)
ScalaLexer)CssLexer_indentation_starts_block)	RubyLexer)	HtmlLexerDtdLexerXmlLexer	XsltLexer	HamlLexer
ScamlLexerPugLexerUrlEncodedLexerc                      e Zd ZdZdZdZdgZg dZddgZe	j                  e	j                  z  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% Zy&)'r   zo
    For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
    by the appropriate lexer.
    HTMLzhttps://html.spec.whatwg.org/html)z*.htmlz*.htmz*.xhtml*.xsltz	text/htmlzapplication/xhtml+xmlz[^<&]+&\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                     t        |       ryy )Ng      ?)r   texts    6/usr/lib/python3/dist-packages/pygments/lexers/html.pyanalyse_textzHtmlLexer.analyse_texte   s    % &    N)__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesre
IGNORECASEDOTALLflagsr	   r   Entityr
   Preproc	Multiliner   r   Tag	Attributer   r   r   r   r   tokensr9    r:   r8   r   r      s3   
 D
)ChG8I56IMMBII%E t$&8G--.7??+)%k448&( %k448%'
 #k42E;2k4dDHHd!#$#
, TN$ht~~x&N(h{D+FO
 1k4dDHHd!#$*, *5+AB
 u_-v6E/*F3
 0k4dDHHd!##)+ )%/:
 uX/E(OV,
 ff%ff%(
k:Fxr:   r   c                   x   e Zd ZdZej
                  ej                  z  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j0                  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j2                  fdej4                  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j4                  fd edfgd&Zd' Zy())r   zR
    A lexer for DTDs (Document Type Definitions).

    .. versionadded:: 1.5
    DTD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-->r0   -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)r4   rR   rW   rS   rT   rU   rV   c                 6    t        |       sd| v sd| v sd| v ryy y )Nz	<!ELEMENTz	<!ATTLISTz<!ENTITY皙?r   r6   s    r8   r9   zDtdLexer.analyse_text   s.    d#4;$#6*:L ;M $r:   N)r;   r<   r=   r>   rD   	MULTILINErF   rG   r?   rA   rB   rC   r   r   r   r	   r   rK   rH   Constantr
   r   r   DoubleSingleReservedrL   rM   r9   rN   r:   r8   r   r   j   sV    LL299$EDgG	I&'I H%$19>%$19>$$4h@&$1:?)$++tW=? *$13w//0!#
* TNT[[)Wi(8$'FMM*
 gGV$'N
 H!7#3#34)7F#	
 HO)7+;+;<"G$4$45/7F#
 H#W%5%56,7F#	
 Hw//0/7F#	
yBFHr:   r   c            
          e Zd ZdZej
                  ej                  z  ZdZdgZ	g dZ
g dZde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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 Zy)r   z=
    Generic lexer for XML (eXtensible Markup Language).
    XMLxml)z*.xml*.xslz*.rssr$   z*.xsdz*.wsdlz*.wsf)ztext/xmlzapplication/xmlzimage/svg+xmlzapplication/rss+xmlzapplication/atom+xmlz[^<&\s]+z[^<&\S]+r%   r&   r'   r(   r)   z<\s*[\w:.-]+r+   z<\s*/\s*[\w:.-]+\s*>r-   z[\w.:-]+\s*=r.   z/?\s*>r0   r1   r2   r3   )r4   r+   r.   c                     t        |       ryy )Ng?r\   r6   s    r8   r9   zXmlLexer.analyse_text   s    $  r:   N)r;   r<   r=   r>   rD   r]   rF   rG   r?   rA   rB   rC   r	   r   r   rH   r
   rI   rJ   rK   rL   r   rM   r9   rN   r:   r8   r   r      s	    LL299$EDgG$I@I
 $*%$&8G--.7??+)dhh.$dhh/

 Z dnnf5&)
 Z ff%ff%(	
#F2r:   r   c                   >    e Zd ZdZdZdgZg dZddgZh dZd Z	d	 Z
y
)r   z7
    A lexer for XSLT.

    .. versionadded:: 0.10
    XSLTxslt)re   r$   z*.xplzapplication/xsl+xmlzapplication/xslt+xml>#   copy-offor-eachvalue-of
with-paramstrip-spaceapply-importsattribute-setcall-templatedecimal-formatpreserve-spaceapply-templatesnamespace-aliasprocessing-instructionifkeycopysortr7   whenparamchooseimportnumberoutputrW   rS   r   messagefallbacktemplatevariable	attribute	otherwise	transform
stylesheetc              #      K   t         j                  | |      D ]`  \  }}}t        j                  d|      }|t        j
                  u r+|r)|j                  d      | j                  v r|t        |f Z|||f b y w)Nz</?xsl:([^>]*)/?>?   )	r   get_tokens_unprocessedrD   matchr   rK   groupEXTRA_KEYWORDSr   )selfr7   indextokenvaluems         r8   r   z XsltLexer.get_tokens_unprocessed  sw     #+#B#B4#N 	*E5%-u5A Q1771:9L9L+LWe++UE))	*s   A;A=c                 &    t        |       rd| v ryy y )Nz<xslr[   r\   r6   s    r8   r9   zXsltLexer.analyse_text  s    $FdN %3r:   N)r;   r<   r=   r>   r?   rA   rB   rC   r   r   r9   rN   r:   r8   r   r      s6     DhG,I&(>?I	N*r:   r   c                      e Zd ZdZdZdgZdgZdgZej                  Z
dZdez   dz   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z   dz    ee ee            df ed      g ed      dej0                  dfdez   dz   ej2                  dfdez   dz   ez   dz    eeej6                  e      dfdez   dz    eed      dfdez   dz    eej:                  d      dfdez   dz    ee ee            dfdez   dz    eej<                  d       df ed!      g	 ed      d"ez   d#z    ee      fd$ez   d%z    ee      fd&ed'fd(ed)fd*ef ed!      gd+efd,ez   d-z    eej@                   ee      ej@                        fd.edfgd/efd0ejB                  d1fd2ejB                  fd3edfgd4efd5ejD                  dfd6ejD                  jF                  dfd7ejD                  jH                  dfd8edfd9edfged:z   efd.edfged:z   ej:                  fd.edfgd+ej<                  fd,ez   d-z    eej@                   ee      ej@                        fd.edfgd;Z%y<)=r   z5
    For Haml markup.

    .. versionadded:: 1.3
    Hamlhamlz*.hamlztext/x-hamlz(?: \|\n(?=.* \|)|.)z
(?:,\s*\n|)[ \t]*\n[ \t]*	\.[\w:-]+r+   	\#[\w:-]+[&!]?==plain([&!]?[=~])(*\n)r4   css%[\w:-]+!!!*\nr0   (/)(\[*?\])(/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])*"+)r4   r   r   contentr+   r   r   r   r   r   r   N)&r;   r<   r=   r>   r?   rA   rB   rC   rD   rE   rG   _dot
_comma_dotr	   r   r   ClassFunctionr   r   r   r   r   r   rK   	Namespacer
   Specialr   rI   	Decoratorr   InterpolrL   VariableInstanceGlobalrM   rN   r:   r8   r   r     su    DhG
IIMME #D %+J $%
 4::u-4==%0
 g.z)G3k5#34 G
 EN$((E*d]V#T^^V<	)D07:gw8 D[6!=:N#OT\F"M'//2F%HIOQz!G+k5#34 D[6!=#PO$!
( EN$)5+;<T\G#U9%56D+,;1#[1O$
 /5
*foouY'7IKD&!	
 TN0FG(D&!	
 T]]F+dmm,,f5t}}++V4*FF;*FF;!
 CZ!D&!
 CZ)D&!
 /?
*foouY'7IKD&!	
cWFr:   r   c                      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z   dz    ee ee            df ed      g ed      dej.                  d
fdez   dz   ej0                  dfdez   dz   ez   dz    eeej4                  e      dfdez   dz    eed      dfdez   dz    eej8                  d      dfdez   dz    eee ee            dfdez   dz    ee ee            dfdez   dz    eej<                  d      df ed       g
 ed      d!ez   d"z    ee      fd#ez   d$z    ee      fd%ed&fd'ed(fd)ef ed       gd*efd+ez   d,z    eej@                   ee      ej@                        fd-edfgd.efd/ejB                  d0fd1ejB                  fd2edfgd3efd4ejD                  dfd5ejD                  jF                  dfd6ejD                  jH                  dfd7edfd8edfged9z   efd-edfged9z   ej8                  fd-edfgd*ej<                  fd+ez   d,z    eej@                   ee      ej@                        fd-edfgd:Z%y;)<r   zt
    For `Scaml markup <http://scalate.fusesource.org/>`_.  Scaml is Haml for Scala.

    .. versionadded:: 1.4
    Scamlscamlz*.scamlztext/x-scaml.r   r   r   r+   r   r   r   r   r   r4   r   r   r   r   r0   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   r4   r   r   r   r+   r   r   r   r   r   r   N)&r;   r<   r=   r>   r?   rA   rB   rC   rD   rE   rG   r   r	   r   r   r   r   r   r   r   r   r   r   rK   r   r
   r   r   rI   r   r   r   r   rL   r   r   r   rM   rN   r:   r8   r   r     s    DiGI IMME
 D $%
 4::u-4==%0
 g.t#g-k5#45 G
 EN$((E*d]V#T^^V<	)D07:gw8 D[6!=:N#OT\F"M'//2G%IJPR!D(72k7E*,=> t^g%k5#45 D[6!=#PO$'
. EN$)5+<=T\G#U:%67D+,;1#[1O$
 /5
*foouZ'8&//JLD&!	
 TN0FG(D&!	
 T]]F+dmm,,f5t}}++V4*FF;*FF;!
 CZ!D&!
 CZ)D&! 
 /?
*foouZ'8&//JLD&!	
iZFr:   r   c                      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z   dz    ee ee            df ed      g ed      dez   dz   ej.                  dfdez   dz   ez   dz    eeej2                  e      dfdez   dz    eed      dfdez   dz    eej6                  d      dfdez   dz    eee ee            dfdez   dz    ee ee            dfd ez   dz    eej:                  d!      dfd"ej<                  dfd#ed$fg
 ed      d%ez   d&z    ee      fd'ez   d(z    ee      fd)ed*fd+ed,fd-ef ed$      gd.efd/ez   d0z    eej@                   ee      ej@                        fd1edfgd2efd3ejB                  d4fd"ejB                  fd5edfgd6efd7ejD                  dfd8ejD                  jF                  dfd9ejD                  jH                  dfd:edfd;edfged<z   efd1edfged<z   ej6                  fd1edfgd.ej:                  fd/ez   d0z    eej@                   ee      ej@                        fd1edfgd=Z%y>)?r   z
    For Pug markup.
    Pug is a variant of Scaml, see:
    http://scalate.fusesource.org/documentation/scaml-reference.html

    .. versionadded:: 1.4
    Pugpugjadez*.pugz*.jadez
text/x-pugztext/x-jader   r   r   r   r+   r   r   r   r   r   r4   r   r   r   r0   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)&r;   r<   r=   r>   r?   rA   rB   rC   rD   rE   rG   r   r	   r   r   r   r   r   r   r   r   r   r   r   r
   r   r   rI   r   r   rK   r   r   rL   r   r   r   rM   rN   r:   r8   r   r     s    DfoG(#I}-IMMED $%
 4::u-4==%0
 g.t#g-k5#45@G	
 ENd]V#T^^V<	)D07:gw8 D[6!=:N#OT\F"M'//2G%IJPR!D(72k7E*,=> t^g%k5#45 D[6!=#P5)D/*'
. EN$)5+<=T\G#U:%67D+,;1#[1O$
 /5
*foouZ'8&//JLD&!	
 TN0FG(D&!	
 T]]F+dmm,,f5t}}++V4*FF;*FF;!
 CZ!D&!
 CZ)D&! 
 /?
*foouZ'8&//JLD&!	
gYFr:   r   c                   T    e Zd ZdZdZdgZdgZdd eej                  e
ee      fgiZy)r    z?
    Lexer for urlencoded data

    .. versionadded:: 2.16
    
urlencodedz!application/x-www-form-urlencodedr4   z([^&=]*)(=)([^=&]*)(&?)N)r;   r<   r=   r>   r?   rA   rC   r   r   rK   r   r   r   rM   rN   r:   r8   r    r    `  sE     DnG45I 	&8V[(YZ
Fr:   r    ))r>   rD   pygments.lexerr   r   r   r   r   r   pygments.tokenr	   r
   r   r   r   r   r   r   pygments.utilr   r   pygments.lexers.javascriptr   pygments.lexers.jvmr   pygments.lexers.cssr   r   r   pygments.lexers.rubyr   __all__r   r   r   r   r   r   r   	JadeLexerr    rN   r:   r8   <module>r      s    
    > 6 * E E *8K
 K\Uz Up)z )X" "Jl" l^m# m`j! jV 	j r:   