o ash@shdZddlZddlmZddlmZddlmZddlm Z m Z m Z m Z m Z mZmZmZmZddlmZmZmZmZmZmZmZmZmZmZddlmZmZgd Z Gd d d e Z!Gd d d e Z"Gddde Z#Gddde Z$Gddde Z%Gddde Z&Gddde&Z'Gddde Z(Gddde Z)Gddde Z*Gddde Z+Gd d!d!e Z,dS)"z pygments.lexers.markup ~~~~~~~~~~~~~~~~~~~~~~ Lexers for non-HTML markup languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)XmlLexer)JavascriptLexer)CssLexer) RegexLexerDelegatingLexerincludebygroupsusingthis do_insertionsdefaultwords) TextCommentOperatorKeywordNameStringNumber PunctuationGenericOther) get_bool_opt ClassNotFound) BBCodeLexer MoinWikiLexerRstLexerTexLexer GroffLexerMozPreprocHashLexerMozPreprocPercentLexerMozPreprocXulLexerMozPreprocJavascriptLexerMozPreprocCssLexer MarkdownLexerTiddlyWiki5Lexerc@sheZdZdZdZdgZdgZdefdedfdefgd efd e e j e e fd e e e fd ed fgdZdS)rzR A lexer that highlights BBCode(-like) syntax. .. versionadded:: 0.6 BBCodebbcodez text/x-bbcodez[^[]+z\[/?\w+tagz\[\s+z(\w+)(=)("?[^\s"\]]+"?)z(=)("?[^\s"\]]+"?)z\]#pop)rootr(N)__name__ __module__ __qualname____doc__namealiases mimetypesrrrr Attributerrtokensr5r58/usr/lib/python3/dist-packages/pygments/lexers/markup.pyrs&  rc@seZdZdZdZddgZgZdgZej ej BZ de fde eefde ejeeejefd e ejejd fd e fd e eejefd e eejefdefde eeefdefdefdefdefg dejdfdedfde jfde jfgdZdS)rzI For MoinMoin (and Trac) Wiki markup. .. versionadded:: 0.7 zMoinMoin/Trac Wiki markupz trac-wikimoinztext/x-trac-wikiz^#.*$z(!)(\S+)z^(=+)([^=]+)(=+)(\s*#.+)?$z(\{\{\{)(\n#!.+)? codeblockz(\'\'\'?|\|\||`|__|~~|\^|,,|::)z^( +)([.*-])( )z^( +)([a-z]{1,5}\.)( )z\[\[\w+.*?\]\]z(\[[^\s\]]+)(\s+[^\]]+?)?(\])z^----+$z[^\n\'\[{!_~^,|]+\n.z\}\}\}r*z\{\{\{z#pushz[^{}]+)r+r8N)r,r-r.r/r0r1 filenamesr2re MULTILINE IGNORECASEflagsrrrrrHeadingr r rrBuiltin NamespacePreprocr4r5r5r5r6r>s>     rc@szeZdZdZdZgdZddgZddgZej Z dd Z d Z d Z d ee ee fZd eejeejeejefdeejeejefdeeeeeddfdeeeeeddfdeeeeeddfdeeeeeddfdeeeeeddfdeeeeeddfde fdeeeejeeeeddfdeeeejeeddfdeeeejeeddfdeeeejeejeeeeddfdejfdeeejefdeeeddeeddfdeej eeeeefe!dgd efd!ed"fd#eeej"efd$efd%eej#ej$fd&eej$ej#fd'ej%fd(ej&fd)efd*ejfd+efd,efg d-efd!eed.fd/efgd0Z'd1d2Z(d3d4Z)d5S)6ra 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 reStructuredText)restructuredtextrstrestz*.rstz*.restz text/x-rstztext/prs.fallenstein.rstc csddlm}|dt|dfV|dt|dfV|dtj|dfV|dt|dfV|dt|dfV|dt|dfV|d t|d fVd}|j rvz ||d }Wn t yuYnw|d }t |}||d |d |d }|dur|d t |fVdSg}|d}d}|D]&} t | |kr|t |dt| d|fgf|| |d7}q|| 7}qt|||EdHdS)Nrget_lexer_by_name T)pygments.lexersrIstartrgrouprrWordrhandlecodeblocksstriprlenr splitlinesappendr get_tokens_unprocessed) selfmatchrIlexer indentionindention_sizecodeins codelinesliner5r5r6_handle_sourcecodes>   "  " 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)*)inlinestatez1^(\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.*(?)(`__?)z`.+?`__?z(`.+?`)(:[a-zA-Z0-9:-]+?:)?z(:[a-zA-Z0-9:-]+?:)(`.+?`)z \*\*.+?\*\*z\*.+?\*z\[.*?\]_z<.+?>z [^\\\n\[*`:]+r:z[^`]+r*`)r+rjrncK$t|dd|_tj|fi|dSNrZTrrZr__init__r`optionsr5r5r6rszRstLexer.__init__cCs|dddkr|dddkrdS|d}|d|d}|dkrA|dd|krC||dd vrE||d||dkrGd SdSdSdSdS) NrKz..rLr:g333333? rJz-=g?)find)textp1p2r5r5r6 analyse_texts  zRstLexer.analyse_textN)*r,r-r.r/r0r1r;r2r<r=r?riclosersunicode_delimitersescapeend_string_suffixrrr@rrr r rrrYrTagrrCClassrEscaperInterpolVariabler3StrongEmphr4rsr}r5r5r5r6rks)   :    R rc @seZdZdZdZddgZgdZddgZdefd e j fd e j fgd e j d fd e dfde j d fde dfde dfde feddefgde jfeddefdefde j fgde dfde dfedgde dfde dfde j fedgde jfde fedgdZd d!Zd"S)#rz< Lexer for the TeX and LaTeX typesetting languages. TeXtexlatex)z*.texz*.auxz*.tocz text/x-texz text/x-latexz%.*?\nz[{}]z[&_^]z\\\[ displaymathz\\\( inlinemathz\$\$z\$z\\([a-zA-Z]+|.)commandz\\$generalz [^\\$%&_^{}]+[0-9]+z[-=!+*/()\[\]]z[^=!+*/()\[\]\\$%&_^{}0-9-]+z\\\)r*mathz\\\]z\[.*?\]z\*)rr+rrrrcCs(dD]}|dt||krdSqdS)N)z\documentclassz\inputz\documentstylez\relaxT)r\)rzrWr5r5r6r}Es zTexLexer.analyse_textN)r,r-r.r/r0r1r;r2rrrArBacktickrrrrrrr3r r4r}r5r5r5r6rsP    )rc @seZdZdZdZgdZgdZddgZdee e dfd e dfd e d fe d ge d d e fd e dfgdefdejfdejfdejfdejfde dfgd e dfe d dejfdefdefde fgdZddZdS)rz Lexer for the (g)roff typesetting language, supporting groff extensions. Mainly useful for highlighting manpage sources. .. versionadded:: 0.6 Groff)groffnroffman)z*.[1-9]z*.manz*.1pz*.3pmzapplication/x-troffz text/troffz (\.)(\w+)requestz\.z[^\\\n]+textlineescapesr9r*z \\"[^\n]*z\\[fn]\wz\\\(.{2}z \\.\[.*\]rmz\\\nz "[^\n"]+"z\d+z\S+r))r+rrrcCsd|dddkr dS|dddkrdS|dddkrdS|ddr.|dr0d SdSdS) NrJr:FrLz.\"TrMz.TH g?)isalnumisspace)rzr5r5r6r}yszGroffLexer.analyse_textN)r,r-r.r/r0r1r;r2rrrrr rrrrDoublerr4r}r5r5r5r6rLs>  rc @seZdZdZdZegZgZgZdej dfde fgde ej e dfe dej d fge d efd e eefd efd ejfdejfdejfdefde d fde fdefg dZdS)rz Lexer for Mozilla Preprocessor files (with '#' as the marker). Other data is left untouched. .. versionadded:: 2.0 mozhashpreprocz^#expr exprstart.+z (literal)(.*)z#pop:2)defineundefififdefifndefelseelifelifdefelifndefendifexpandfilterunfilterr includesubsterrorr*)!z!=z==z&&z||z (defined)(\()z\)rz__\w+?__z@\w+?@z\w+r9r)z\S)r+rrN)r,r-r.r/r0r1r;r2rrCrrrr rrrrDecimalrrrr4r5r5r5r6rs4   rc@s:eZdZdZdZegZgZgZddej dfde fgiZ dS)r z Lexer for Mozilla Preprocessor files (with '%' as the marker). Other data is left untouched. .. versionadded:: 2.0 mozpercentpreprocr+z^%rrN) r,r-r.r/r0r1r;r2rrCrr4r5r5r5r6r s r c4eZdZdZdZdgZdgZgZfddZZ S)r!z Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the `XmlLexer`. .. versionadded:: 2.0 zXUL+mozpreproczxul+mozpreprocz*.xul.inc tjttfi|dSN)superrsrrrt __class__r5r6rszMozPreprocXulLexer.__init__ r,r-r.r/r0r1r;r2rs __classcell__r5r5rr6r!r!cr)r"z Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the `JavascriptLexer`. .. versionadded:: 2.0 zJavascript+mozpreproczjavascript+mozpreprocz*.js.inc rr)rrsrrrtrr5r6rsrz"MozPreprocJavascriptLexer.__init__rr5r5rr6r"rr"cr)r#z Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the `CssLexer`. .. versionadded:: 2.0 zCSS+mozpreproczcss+mozpreprocz*.css.inc rr)rrsrr rtrr5r6rsrzMozPreprocCssLexer.__init__rr5r5rr6r#rr#c@seZdZdZdZddgZddgZdgZej Z dd Z d e e jefd e e jefd e e jee jefd e e jee jefde eeeeeddfde eeeeeddfde eeeeddfde ee jfdejfde fedg defde eejfde ee jfde ee jfde ee jfde ee jfde ee jfdejfde eejeeejefde eejeeejefd e eejeejfd!efd"efg d#Zd$d%Z d&S)'r$zt For `Markdown `_ markup. .. versionadded:: 2.2 Markdownmarkdownmdz*.mdz *.markdownztext/x-markdownccsddlm}|dtj|dfV|dtj|dfV|dt|dfVd}|jrGz ||d}Wn t yFYnw|d}|durZ|dt|fVn t g| |EdH|dtj|dfVdS zV match args: 1:backticks, 2:lang_name, 3:newline, 4:code, 5:backticks rrHrJrKrLNrMrN) rVrIrWrrrXrrZr[rr r_r`rarIrbrer5r5r6_handle_codeblocks"   zMarkdownLexer._handle_codeblockz(^#[^#].+)(\n)z(^#{2,6}[^#].+)(\n)z^(.+)(\n)(=+)(\n)z^(.+)(\n)(-+)(\n)z^(\s*)([*-] )(\[[ xX]\])( .+\n)rjrkz^(\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)rmz([^`]?)(`[^`\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]+r:)r+rjcKrprqrrrtr5r5r6rsZrvzMarkdownLexer.__init__N)!r,r-r.r/r0r1r;r2r<r=r?rrrr@r Subheadingrr r rrrrrDeletedrEntityrr3Labelr4rsr5r5r5r6r$s` @r$c@seZdZdZdZdgZdgZdgZej Z ddZ dd Z d e eeejfd e ejefd e ejefd e eeeeeddfde eeefde ejfde ejfde ejfde ejfde eeefde fde fededgeddddefgdefdejfde eejefd e eejfd!e eejfd"e eejfd#e eejefd$e eejefd%ejfd&ejfd'ejfd(ejfd)ejfd*ejfd+ej fd,e eejefd-e eejeej!efd.e eejefd/e ej!fd0efd1efgd2Z"d3d4Z#d5S)6r%zf For `TiddlyWiki5 `_ markup. .. versionadded:: 2.7 tiddlertidz*.tidztext/vnd.tiddlywikiccsddlm}|dt|dfV|dt|dfV|dt|dfVd}|jrEz ||d}Wn tyDYnw|d}|durY|dt|fVdSt g| |EdH|dt|dfVdSr) rVrIrWrrXrrZr[rr r_rr5r5r6rks$   z"TiddlyWiki5Lexer._handle_codeblockccsddlm}|dt|dfV|dt|dfVd}|jr4z|d}Wn ty3Ynw|d}|durH|dt|fVdStg||EdH|dt|dfVdS) zP match args: 1:style tag 2:newline, 3:code, 4:closing style tag rrHrJrKNcssrLrM) rVrIrWrrXrZrr r_rr5r5r6_handle_cssblocks"    z!TiddlyWiki5Lexer._handle_cssblockz^(title)(:\s)(.+\n)z^(!)([^!].+\n)z^(!{2,6})(.+\n)z^(\s*)([*#>]+)(\s*)(.+\n)rjrkz^(<<<.*\n)([\w\W]*?)(^<<<.*$)z ^(\|.*?\|h)$z^(\|.*?\|[cf])$z ^(\|.*?\|k)$z^(;.*)$z^(```\n)([\w\W]*?)(^```$)z ^(```)(\w+)(\n)([\w\W]*?)(^```$)z$^($)keywords)z\definez\endcaptioncreatedmodifiedtagstitletype^z\b)prefixsuffixrmz\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]+r:)r+rrjcKrprqrrrtr5r5r6rsrvzTiddlyWiki5Lexer.__init__N)$r,r-r.r/r0r1r;r2r<r=r?rrrrrrr@rr r rrrrrrr rIntegerrrRegexr3r4rsr5r5r5r6r%_s         Ur%)-r/r<pygments.lexers.htmlrpygments.lexers.javascriptrpygments.lexers.cssrpygments.lexerrrrrr r r r r pygments.tokenrrrrrrrrrr pygments.utilrr__all__rrrrrrr r!r"r#r$r%r5r5r5r6s,   ,0!-(:8)m