3

V'íc­hã@s€dZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZddlmZm Z d	d
ddd
dddddddgZ!Gdd	„d	e	ƒZ"Gdd
„d
e	ƒZ#Gdd„de	ƒZ$Gdd„de	ƒZ%Gdd
„d
e	ƒZ&Gdd„de	ƒZ'Gdd„de'ƒZ(Gdd„de
ƒZ)Gdd„de
ƒZ*Gdd„de
ƒZ+Gdd„de	ƒZ,Gd d„de	ƒZ-dS)!zÖ
    pygments.lexers.markup
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for non-HTML markup languages.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
éN)ÚXmlLexer)ÚJavascriptLexer)ÚCssLexer)	Ú
RegexLexerÚDelegatingLexerÚincludeÚbygroupsÚusingÚthisÚ
do_insertionsÚdefaultÚwords)ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚGenericÚOtherÚ
Whitespace)Úget_bool_optÚ
ClassNotFoundÚBBCodeLexerÚ
MoinWikiLexerÚRstLexerÚTexLexerÚ
GroffLexerÚMozPreprocHashLexerÚMozPreprocPercentLexerÚMozPreprocXulLexerÚMozPreprocJavascriptLexerÚMozPreprocCssLexerÚ
MarkdownLexerÚTiddlyWiki5Lexerc@sheZdZdZdZdgZdgZdefdedfdefgd	efd
e	e
jee
ƒfde	ee
ƒfded
fgdœZdS)rzR
    A lexer that highlights BBCode(-like) syntax.

    .. versionadded:: 0.6
    ZBBCodeZbbcodez
text/x-bbcodez[^[]+z\[/?\w+Útagz\[z\s+z(\w+)(=)("?[^\s"\]]+"?)z(=)("?[^\s"\]]+"?)z\]z#pop)Úrootr'N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	mimetypesrrrrÚ	AttributerrÚtokens©r2r2ú:/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/markup.pyrs
c@sìeZdZdZdZddgZgZdgZej	ej
BZdefde
eeƒfde
ejeeƒejeƒfd	e
ejejƒd
fdefde
eejeƒfd
e
eejeƒfdefde
eeeƒfdefdefdefdefg
dejdfdedfdejfdejfgdœZdS)rzI
    For MoinMoin (and Trac) Wiki markup.

    .. versionadded:: 0.7
    zMoinMoin/Trac Wiki markupz	trac-wikiZmoinztext/x-trac-wikiz^#.*$z(!)(\S+)z^(=+)([^=]+)(=+)(\s*#.+)?$z(\{\{\{)(\n#!.+)?Ú	codeblockz(\'\'\'?|\|\||`|__|~~|\^|,,|::)z^( +)([.*-])( )z^( +)([a-z]{1,5}\.)( )z\[\[\w+.*?\]\]z(\[[^\s\]]+)(\s+[^\]]+?)?(\])z^----+$z[^\n\'\[{!_~^,|]+z\nÚ.z\}\}\}z#popz\{\{\{z#pushz[^{}]+)r(r4N)r)r*r+r,r-r.Ú	filenamesr/ÚreÚ	MULTILINEÚ
IGNORECASEÚflagsrrrrrÚHeadingr	r
rrÚBuiltinÚ	NamespaceÚPreprocr1r2r2r2r3r>s2
c@s€eZdZdZdZdZdddgZddgZd	d
gZe	j
Zdd„Zd
Z
dZde	jeƒe	je
ƒfZdeejeejeejeƒfdeejeejeƒfdeeeeeddƒfdeeeeeddƒfdeeeeeddƒfdeeeeeddƒfdeeeeeddƒfdeeeeeddƒfdefdeeeejeeeeddƒfdeeeejeeddƒfdeeeejeeddƒfdeeeejeejeeeeddƒfdejfd eeejeƒfd!eeeddeeddƒfd"ee j!ee e ee ƒfe"dƒgd#efd$e d%fd&ee e j#e ƒfd'e fd(eej$ej%ƒfd)eej%ej$ƒfd*ej&fd+ej'fd,e fd-ejfd.efd/efgd0e fd$ee d1fd2e fgd3œZ(d4d5„Z)d6d7„Z*d8S)9ran
    For reStructuredText markup.

    .. versionadded:: 0.7

    Additional options accepted:

    `handlecodeblocks`
        Highlight the contents of ``.. sourcecode:: language``,
        ``.. code:: language`` and ``.. code-block:: language``
        directives with a lexer for the given language (default:
        ``True``).

        .. versionadded:: 0.8
    ZreStructuredTextz(https://docutils.sourceforge.io/rst.htmlZrestructuredtextZrstÚrestz*.rstz*.restz
text/x-rstztext/prs.fallenstein.rstc
csÆddlm}|jdƒt|jdƒfV|jdƒt|jdƒfV|jdƒtj|jdƒfV|jdƒt|jdƒfV|jdƒt|jdƒfV|jdƒt|jdƒfV|jd	ƒt|jd	ƒfVd}|j	rìy||jdƒj
ƒƒ}Wntk
rêYnX|jd
ƒ}t|ƒ}||jdƒ|jdƒ|jd
ƒ}|dkr@|jd
ƒt
|fVdSg}|jdƒ}d}xX|D]P}	t|	ƒ|krž|jt|ƒdt|	d|…fgfƒ||	|d…7}n||	7}qXWt||j|ƒƒEdHdS)Nr)Úget_lexer_by_nameééééééééé	é
éTÚ)Úpygments.lexersr@ÚstartrÚgrouprrÚWordrÚhandlecodeblocksÚstriprÚlenrÚ
splitlinesÚappendrÚget_tokens_unprocessed)
ÚselfÚmatchr@ÚlexerZ	indentionZindention_sizeÚcodeZinsZ	codelinesÚliner2r2r3Ú_handle_sourcecode‚s:
"


"zRstLexer._handle_sourcecodeu'")]}>’”»!?u‐‑‒–— z((?=$)|(?=[-/:.,; \n\x00%s%s]))zH^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)(.+)(\n)(\1)(\n)zc^(\S.*)(\n)(={3,}|-{3,}|`{3,}|:{3,}|\.{3,}|\'{3,}|"{3,}|~{3,}|\^{3,}|_{3,}|\*{3,}|\+{3,}|#{3,})(\n)z!^(\s*)([-*+])( .+\n(?:\1  .+\n)*)Úinline)Ústatez1^(\s*)([0-9#ivxlcmIVXLCM]+\.)( .+\n(?:\1  .+\n)*)z4^(\s*)(\(?[0-9#ivxlcmIVXLCM]+\))( .+\n(?:\1  .+\n)*)z$^(\s*)([A-Z]+\.)( .+\n(?:\1  .+\n)+)z*^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1  .+\n)+)z^(\s*)(\|)( .+\n(?:\|  .+\n)*)zl^( *\.\.)(\s*)((?:source)?code(?:-block)?)(::)([ \t]*)([^\n]+)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*)?\n)+)z,^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))z'^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$z^( *\.\.)(\s*)(\[.+\])(.*?)$z9^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))z^ *\.\..*(\n( +.*\n|\n)+)?z+^( *)(:(?:\\\\|\\:|[^:\n])+:(?=\s))([ \t]*)z!^(\S.*(?<!::)\n)((?:(?: +.*)\n)+)z2(::)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\3.*)?\n)+)z\\.z``Úliteralz(`.+?)(<.+?>)(`__?)z`.+?`__?z(`.+?`)(:[a-zA-Z0-9:-]+?:)?z(:[a-zA-Z0-9:-]+?:)(`.+?`)z\*\*.+?\*\*z\*.+?\*z\[.*?\]_z<.+?>z
[^\\\n\[*`:]+r5z[^`]+z#popú`)r(r]r_cKs t|ddƒ|_tj|f|ŽdS)NrQT)rrQrÚ__init__)rWÚoptionsr2r2r3raszRstLexer.__init__cCs†|dd…dkr$|dd…dkr$dS|jdƒ}|jd|dƒ}|d
kr‚|dd|kr‚||ddkr‚||d||dkr‚d	SdS)NrBz..rCr5g333333Ó?Ú
rAz-=gà?éÿÿÿÿ)Úfind)ÚtextÚp1Úp2r2r2r3Úanalyse_texts 
zRstLexer.analyse_textN)+r)r*r+r,r-Úurlr.r6r/r7r8r:r\ZclosersZunicode_delimitersÚescapeZend_string_suffixrrr;rrr	r
rrrPrÚTagrr>ÚClassrÚEscaperZInterpolÚVariabler0ÚStrongÚEmphr1rarir2r2r2r3rksŒ
)c
@seZdZdZdZddgZdddgZdd	gZd
efde	j
fde	j
fgd
ejdfdedfdejdfdedfde
dfde
fedƒdefgde	jfedƒdefdefde	j
fgdedfdedfedƒgdedfdedfde	j
fedƒgde	jfd e
fedƒgd!œZd"d#„Zd$S)%rz<
    Lexer for the TeX and LaTeX typesetting languages.
    ZTeXZtexZlatexz*.texz*.auxz*.tocz
text/x-texztext/x-latexz%.*?\nz[{}]z[&_^]z\\\[Údisplaymathz\\\(Ú
inlinemathz\$\$z\$z\\([a-zA-Z]+|.)Úcommandz\\$Úgeneralz
[^\\$%&_^{}]+z[0-9]+z[-=!+*/()\[\]]z[^=!+*/()\[\]\\$%&_^{}0-9-]+z\\\)z#popÚmathz\\\]z\[.*?\]z\*)rur(rvrsrrrtcCs*x$dD]}|dt|ƒ…|krdSqWdS)Nú\documentclassú\inputú\documentstyleú\relaxT)rwrxryrz)rS)rfrNr2r2r3riFszTexLexer.analyse_textN)r)r*r+r,r-r.r6r/rrr<rÚBacktickrrrrorrr0rr1rir2r2r2r3rs@




c
@sÖeZdZdZdZdddgZdddd	gZd
dgZdee	e
ƒd
fded
fde	dfedƒge
dƒde	fde	dfgdefdejfdejfdejfdejfde	d
fgde	dfe
dƒdejfdefdefde	fgdœZdd „Zd!S)"rz¡
    Lexer for the (g)roff typesetting language, supporting groff
    extensions. Mainly useful for highlighting manpage sources.

    .. versionadded:: 0.6
    ZGroffZgroffZnroffZmanz*.[1-9]z*.manz*.1pz*.3pmzapplication/x-troffz
text/troffz	(\.)(\w+)Úrequestz\.z[^\\\n]+ÚtextlineÚescapesz\nz#popz	\\"[^\n]*z\\[fn]\wz\\\(.{2}z	\\.\[.*\]z\\.z\\\nz	"[^\n"]+"z\d+z\S+z\s+)r(r}r~r|cCs`|dd…dkrdS|dd…dkr(dS|dd…dkr<dS|dd…jƒr\|djƒr\d	SdS)
NrAr5FrCz.\"TrDz.TH gÍÌÌÌÌÌì?)ÚisalnumÚisspace)rfr2r2r3rizszGroffLexer.analyse_textN)r)r*r+r,r-r.r6r/rrrrrrrrrnÚDoublerr1rir2r2r2r3rMs2


c@sªeZdZdZdZegZgZgZdej	d*fde
fgdeej	eƒdfe
d+ƒej	dfge
d,ƒefdeeeƒfd efd!ejfd"ejfd#ejfd$efd%edfd&efd'efg
d(œZd)S)-r z†
    Lexer for Mozilla Preprocessor files (with '#' as the marker).

    Other data is left untouched.

    .. versionadded:: 2.0
    Zmozhashpreprocz^#ÚexprÚ	exprstartz.+z
(literal)(.*)z#pop:2ÚdefineÚundefÚifÚifdefÚifndefÚelseÚelifÚelifdefÚelifndefÚendifÚexpandÚfilterÚunfilterrÚincludesubstÚerrorz#popú!ú!=ú==ú&&ú||z
(defined)(\()z\)z[0-9]+z__\w+?__z@\w+?@z\w+z\nz\s+z\S)r(rƒr‚N)r‚rƒ)r„r…r†r‡rˆr‰rŠr‹rŒrrŽrrrr‘r’)r“r”r•r–r—)r)r*r+r,r-r.r6r/rr>rrrr
rrrrÚDecimalrrormr1r2r2r2r3r …s.


c@s:eZdZdZdZegZgZgZddej	d	fde
fgiZdS)
r!z†
    Lexer for Mozilla Preprocessor files (with '%' as the marker).

    Other data is left untouched.

    .. versionadded:: 2.0
    Zmozpercentpreprocr(z^%r‚rƒz.+N)r‚rƒ)r)r*r+r,r-r.r6r/rr>rr1r2r2r2r3r!®s
cs4eZdZdZdZdgZdgZgZ‡fdd„Z‡Z	S)r"z€
    Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
    `XmlLexer`.

    .. versionadded:: 2.0
    zXUL+mozpreproczxul+mozpreprocz*.xul.incstƒjttf|ŽdS)N)Úsuperrarr )rWrb)Ú	__class__r2r3raÏszMozPreprocXulLexer.__init__)
r)r*r+r,r-r.r6r/raÚ
__classcell__r2r2)ršr3r"Ãscs4eZdZdZdZdgZdgZgZ‡fdd„Z‡Z	S)r#z‡
    Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
    `JavascriptLexer`.

    .. versionadded:: 2.0
    zJavascript+mozpreproczjavascript+mozpreprocz*.js.incstƒjttf|ŽdS)N)r™rarr )rWrb)ršr2r3raßsz"MozPreprocJavascriptLexer.__init__)
r)r*r+r,r-r.r6r/rar›r2r2)ršr3r#Óscs4eZdZdZdZdgZdgZgZ‡fdd„Z‡Z	S)r$z€
    Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
    `CssLexer`.

    .. versionadded:: 2.0
    zCSS+mozpreproczcss+mozpreprocz*.css.incstƒjttf|ŽdS)N)r™rarr!)rWrb)ršr2r3raïszMozPreprocCssLexer.__init__)
r)r*r+r,r-r.r6r/rar›r2r2)ršr3r$ãsc@s¬eZdZdZdZdZddgZddgZdgZe	j
Zd	d
„Zde
ejeƒfde
ejeƒfd
e
ejeejeƒfde
ejeejeƒfde
eeeeeddƒfde
eeeeeddƒfde
eeeeddƒfde
eejƒfdejfdefedƒgdefde
eejƒfde
eejƒfde
eejƒfde
eejƒfde
eejƒfde
eejƒfdejfde
eejeeejeƒfd e
eejeeej eƒfd!e
eej eejƒfd"efd#efg
d$œZ!d%d&„Z"d'S)(r%z9
    For Markdown markup.

    .. versionadded:: 2.2
    ZMarkdownz-https://daringfireball.net/projects/markdown/ZmarkdownZmdz*.mdz
*.markdownztext/x-markdownccsèddlm}|jdƒtj|jdƒfV|jdƒtj|jdƒfV|jdƒt|jdƒfVd}|jrŽy||jdƒjƒƒ}Wnt	k
rŒYnX|jdƒ}|dkr´|jdƒt|fVnt
g|j|ƒƒEdH|jdƒtj|jdƒfVdS)	zV
        match args: 1:backticks, 2:lang_name, 3:newline, 4:code, 5:backticks
        r)r@rArBrCNrDrE)rMr@rNrr{rOrrQrRrrrV)rWrXr@rYrZr2r2r3Ú_handle_codeblocks
zMarkdownLexer._handle_codeblockz(^#[^#].+)(\n)z(^#{2,6}[^#].+)(\n)z^(.+)(\n)(=+)(\n)z^(.+)(\n)(-+)(\n)z^(\s*)([*-] )(\[[ xX]\])( .+\n)r])r^z^(\s*)([*-])(\s)(.+\n)z^(\s*)([0-9]+\.)( .+\n)z^(\s*>\s)(.+\n)z^(\s*```\n[\w\W]*?^\s*```$\n)z(^(\s*```)(\w+)(\n)([\w\W]*?)(^\s*```$\n)z\\.z([^`]?)(`[^`\n]+`)z ([^\*]?)(\*\*[^* \n][^*\n]*\*\*)z([^_]?)(__[^_ \n][^_\n]*__)z([^\*]?)(\*[^* \n][^*\n]*\*)z([^_]?)(_[^_ \n][^_\n]*_)z([^~]?)(~~[^~ \n][^~\n]*~~)z[@#][\w/:]+z (!?\[)([^]]+)(\])(\()([^)]+)(\))z(\[)([^]]+)(\])(\[)([^]]*)(\])z^(\s*\[)([^]]*)(\]:\s*)(.+)z[^\\\s]+r5)r(r]cKs t|ddƒ|_tj|f|ŽdS)NrQT)rrQrra)rWrbr2r2r3ra\szMarkdownLexer.__init__N)#r)r*r+r,r-rjr.r6r/r7r8r:rœrrr;rÚ
Subheadingrrr	r
rqrr{rrpÚDeletedrÚEntityrlr0ZLabelr1rar2r2r2r3r%ósNc@súeZdZdZdZdZdgZdgZdgZe	j
Zdd„Zd	d
„Z
deeeejƒfdeejeƒfd
eejeƒfdeeeeeeddƒfdeeeeƒfdeejƒfdeejƒfdeejƒfdeejƒfdeeeeƒfdefde
fedƒedƒged>d"d#d$efgd%efd&ejfd'eeejeƒfd(eeejƒfd)eeejƒfd*eeejƒfd+eeejeƒfd,eeejeƒfd-ejfd.ejfd/ejfd0ejfd1ejfd2ej fd3ej!fd4eeejeƒfd5eeejeej"eƒfd6eeejeƒfd7eej"ƒfd8efd9efgd:œZ#d;d<„Z$d=S)?r&z<
    For TiddlyWiki5 markup.

    .. versionadded:: 2.7
    Ztiddlerz$https://tiddlywiki.com/#TiddlerFilesÚtidz*.tidztext/vnd.tiddlywikiccsäddlm}|jdƒt|jdƒfV|jdƒt|jdƒfV|jdƒt|jdƒfVd}|jrŠy||jdƒjƒƒ}Wntk
rˆYnX|jdƒ}|dkr²|jdƒt|fVdSt	g|j
|ƒƒEdH|jdƒt|jdƒfVdS)	zV
        match args: 1:backticks, 2:lang_name, 3:newline, 4:code, 5:backticks
        r)r@rArBrCNrDrE)rMr@rNrrOrrQrRrrrV)rWrXr@rYrZr2r2r3rœns 
z"TiddlyWiki5Lexer._handle_codeblockccsÂddlm}|jdƒt|jdƒfV|jdƒt|jdƒfVd}|jrhy|dƒ}Wntk
rfYnX|jdƒ}|dkr|jdƒt|fVdStg|j|ƒƒEdH|jdƒt|jdƒfVdS)	zP
        match args: 1:style tag 2:newline, 3:code, 4:closing style tag
        r)r@rArBNÚcssrCrD)	rMr@rNrrOrQrrrV)rWrXr@rYrZr2r2r3Ú_handle_cssblock‹s
z!TiddlyWiki5Lexer._handle_cssblockz^(title)(:\s)(.+\n)z^(!)([^!].+\n)z^(!{2,6})(.+\n)z^(\s*)([*#>]+)(\s*)(.+\n)r])r^z^(<<<.*\n)([\w\W]*?)(^<<<.*$)z^(\|.*?\|h)$z^(\|.*?\|[cf])$z^(\|.*?\|k)$z^(;.*)$z^(```\n)([\w\W]*?)(^```$)z ^(```)(\w+)(\n)([\w\W]*?)(^```$)z$^(<style>)(\n)([\w\W]*?)(^</style>$)Úkeywordsú\defineú\endÚcaptionÚcreatedÚmodifiedÚtagsÚtitleÚtypeú^z\b)ÚprefixÚsuffixz\\.z\d{17}z(\s)(//[^/]+//)((?=\W|\n))z(\s)(\^\^[^\^]+\^\^)z(\s)(,,[^,]+,,)z(\s)(__[^_]+__)z(\s)(''[^']+'')((?=\W|\n))z(\s)(~~[^~]+~~)((?=\W|\n))z	<<[^>]+>>z
\$\$[^$]+\$\$z
\$\([^)]+\)\$z^@@.*$z	</?[^>]+>z`[^`]+`z&\S*?;z(\[{2})([^]\|]+)(\]{2})z$(\[{2})([^]\|]+)(\|)([^]\|]+)(\]{2})z(\{{2})([^}]+)(\}{2})z(\b.?.?tps?://[^\s"]+)z[\w]+r5)r(r£r]cKs t|ddƒ|_tj|f|ŽdS)NrQT)rrQrra)rWrbr2r2r3raûszTiddlyWiki5Lexer.__init__N)r¤r¥r¦r§r¨r©rªr«)%r)r*r+r,r-rjr.r6r/r7r8r:rœr¢rrrrr;rr	r
rrprqrrlrr
rZIntegerržr{ÚRegexr0r1rar2r2r2r3r&asl
).r,r7Zpygments.lexers.htmlrZpygments.lexers.javascriptrZpygments.lexers.cssrZpygments.lexerrrrrr	r
rrr
Zpygments.tokenrrrrrrrrrrrZ
pygments.utilrrÚ__all__rrrrrr r!r"r#r$r%r&r2r2r2r3Ú<module>	s0,4

!-):8)n