o aq@sdZddlZddlmZmZmZmZmZmZm Z m Z ddl m Z m Z mZmZmZmZmZmZmZmZmZddlmZddlmZddlmZgdZGd d d eZGd d d eZ Gd ddeZ!GdddeZ"GdddeZ#GdddeZ$GdddeZ%GdddeZ&dS)z pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) RegexLexerDelegatingLexerbygroupsincludeusingthisdefaultwords) PunctuationTextCommentOperatorKeywordNameStringNumberLiteralOther Whitespace)get_choice_opt) unistring)XmlLexer) CSharpLexer NemerleLexerBooLexer VbNetLexerCSharpAspxLexerVbNetAspxLexer FSharpLexerc@seZdZdZdZgdZdgZdgZej ej Bej BZ dde dd d d d d de dd d d d ddddd dde dd d d dd dde dd d d dd ddddd ddZiZdZeD]\ZZdededeeeeejeefdeeejfdefd eeefd!ej fd"ej!fd#efd$efd%efd&e"fd'e"fd(e"j#fd)e$fd*eej%eej%ej%efd+ee&ee&fd,e&fd-ee&efd.e&j'fd/ee&ed0fd1ee&ed2feefgeej(d3fe)d3gd4ed3fd5ed6ej*d3fgd7ee<qed8d9Z+d:S);ra For `C# `_ source code. Additional options accepted: `unicodelevel` Determines which Unicode characters this lexer allows for identifiers. The possible values are: * ``none`` -- only the ASCII letters and numbers are allowed. This is the fastest selection. * ``basic`` -- all Unicode characters from the specification except category ``Lo`` are allowed. * ``full`` -- all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since the ``Lo`` category has more than 40,000 characters in it! The default value is ``basic``. .. versionadded:: 0.8 zC#)csharpzc#csz*.csz text/x-csharp@?[_a-zA-Z]\w*@?[_LuLlLtLmNl][NdPcCfMnMc]* @?(?:_|[^Lo])[^nonebasicfullT ^([ \t]*)((?:(?:\[\])?\s+)+?)( )(\s*)(\()^(\s*)(\[.*?\])[^\S\n]+(\\)(\n)//.*?\n /[*].*?[*]/\n[~!%^&*()+=|\[\]:;,.<>/?-][{}] @"(""|[^"])*"z!\$?"(\\\\|\\[^\\]|[^"\\\n])*["\n] '\\.'|'[^\\]'zA[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?zb(#)([ \t]*)(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma)\b(.*?)(\n)\b(extern)(\s+)(alias)\ba (abstract|as|async|await|base|break|by|case|catch|checked|const|continue|default|delegate|do|else|enum|event|explicit|extern|false|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|let|lock|new|null|on|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|true|try|typeof|unchecked|unsafe|virtual|void|while|get|set|new|partial|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b (global)(::)zk(bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var)\b\??z(class|struct)(\s+)class(namespace|using)(\s+) namespace#pop(?=\()(|\.)+)rootrGrIcKPt|dt|jd}||jvr|j||_n|j||_tj|fi|dSN unicodelevelr6 rlisttokens _all_tokens __class__process_tokendef_tokensr__init__selfoptionslevelr^8/usr/lib/python3/dist-packages/pygments/lexers/dotnet.pyrYs   zCSharpLexer.__init__N),__name__ __module__ __qualname____doc__namealiases filenames mimetypesre MULTILINEDOTALLUNICODEflagsunicombine allexceptlevelsrTtoken_variantsitems levelnamecs_identrrrrrFunctionr Attributer r Single MultilinerCharrPreprocrTypeClassr NamespacerYr^r^r^r_rs        . 8rc!@s0eZdZdZdZdgZdgZdgZej ej Bej BZ dde dd d d d d de dd d d d ddddd dde dd d d dd dde dd d d dd ddddd ddZiZdZeD](\ZZdededeeeeejeefdeeejfdefd eeefd!ej fd"ej!fd#efd$ee"ee"d%fd&ee"ee"d'fd(e"d)fd*ed+ee#ee#fd,e#fd-eefd.eeed/fd0efd1efd2e"fd3e"fd4e"j$fd5e%fd6e%fd7eej&eej&d8fd9ee#ee#fd:e#fd;ee#efdeeee#j'fd?ee#ed@fdAee#edBfeefgeej(dCfgdDej&fdEefd#edCfgdFedCfdGedHej)dCfgdIe"fd-eefd.eeed/fdJe"fdKe"dCfgdLe"fd-eefd.eeed/fd(e"dMfdNe"dCfgdOe"fd(e"dMfdNe"dCfgdPe#fdQefeefdRe%fdSedMfdTedCfgdUee<qddVdWZ*dXdYZ+dZS)[ra For `Nemerle `_ source code. Additional options accepted: `unicodelevel` Determines which Unicode characters this lexer allows for identifiers. The possible values are: * ``none`` -- only the ASCII letters and numbers are allowed. This is the fastest selection. * ``basic`` -- all Unicode characters from the specification except category ``Lo`` are allowed. * ``full`` -- all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since the ``Lo`` category has more than 40,000 characters in it! The default value is ``basic``. .. versionadded:: 1.5 Nemerlenemerlez*.nztext/x-nemerler!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4Tr8r9r:r;r<r=r>r?r@z (\$)(\s*)(") splice-stringz (\$)(\s*)(<#)splice-string2z<#recursive-stringz (<\[)(\s*)(z:)?z\]\>z\$z(\$)(\()splice-string-contentrArBrCz"(\\\\|\\[^\\]|[^"\\\n])*["\n]rDz0[xX][0-9a-fA-F]+[Ll]?z*[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?zY(#)([ \t]*)(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma)\bpreprocrEa(abstract|and|as|base|catch|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|syntax|this|throw|true|try|type|typeof|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\brFzo(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|array|list)\b\??z (:>?)(\s*)(z\??)z"(class|struct|variant|module)(\s+)rGrHrIrJz\w+z[ \t]+rKrLrMz[^"$]z\\""z[^#<>$]#pushz#>z[^#<>]zif|matchz[~!%^&*+=|\[\]:;,.<>/?-\\"$ ]\d+\(\))rNrGrrIrrrrcKrOrPrRrZr^r^r_rY(s  zNemerleLexer.__init__cCsd}d|vr |d7}|S)zUNemerle is quite similar to Python, but @if is relatively uncommon elsewhere.rz@ifg?r^textresultr^r^r_ analyse_text3szNemerleLexer.analyse_textN),r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprTrqrrrsrtrrrrrrur rvr r rwrxrrryrrzr{r|r}rYrr^r^r^r_rs               @      k rc@sReZdZdZdZdgZdgZdgZdefde j fde j d fd e fd e eefd efd ejfdejfdejfdefdefdefde eedfde eedfde eedfdejfdejfdejfdej fdefdejfdefd ejfd!ejfd"ejjfd#ejfgde j d$fd%e j d&fd'e j fd(e j fgdejd&fgdejd&fgd)ejd&fgd*Z d+S),rz< For `Boo `_ source code. Boobooz*.booz text/x-boo\s+z (#|//).*$z/[*]commentz []{}:(),.;[]r=z\\z(in|is|and|or|not)\bz/(\\\\|\\[^\\]|[^/\\\s])/z@/(\\\\|\\[^\\]|[^/\\])*/z=~|!=|==|<<|>>|[-+/*%=<>&^|]aO(as|abstract|callable|constructor|destructor|do|import|enum|event|final|get|interface|internal|of|override|partial|private|protected|public|return|set|static|struct|transient|virtual|yield|super|and|break|cast|continue|elif|else|ensure|except|for|given|goto|if|in|is|isa|not|or|otherwise|pass|raise|ref|try|unless|when|while|from|as)\bzdef(?=\s+\(.*?\))z (def)(\s+)funcnamez (class)(\s+) classnamez(namespace)(\s+)rIz(?sb    '     rc@seZdZdZdZddgZddgZddgZd e d d d d dde d d d d ddddd dZ e j e j BZdejfdefdefdeeefdeeefdejfdefdeejeejeejfeddd d!efd"ed#fd$ed%fd&eeed'fd(eeed)fd*eeed+fd,ejfd-ejfd.efd/ed0fd1eeefe d2efd3ejfd4e j!fd5e j"fd6e j"fd7e j"fgd8efd9ed:fd;efge ej#d:fe$d:ge ej%d:fge ej&d:fge ej'fdZ(d?d@Z)dAS)Brzm For `Visual Basic.NET `_ source code. zVB.netzvb.netvbnetz*.vbz*.basz text/x-vbnetz text/x-vbaz[_r$r%r&r'r(r)r*r+r,r-r.r/z ^\s*<.*?>rr@z(rem\b.*?)(\n)z ('.*?)(\n)z#If\s.*?\sThen|#ElseIf\s.*?\sThen|#Else|#End\s+If|#Const|#ExternalSource.*?\n|#End\s+ExternalSource|#Region.*?\n|#End\s+Region|#ExternalChecksumz [(){}!#,.:]z?(Option)(\s+)(Strict|Explicit|Compare)(\s+)(On|Off|Binary|Text))l AddHandlerAliasByRefByValCallCaseCatchCBoolCByteCCharCDateCDecCDblCIntCLngCObjContinueCSByteCShortCSngCStrCTypeCUIntCULngCUShortDeclareDefaultDelegate DirectCastDoEachElseElseIfEndIfEraseErrorEventExitFalseFinallyForFriendGetGlobalGoSubGoToHandlesIf ImplementsInherits InterfaceLetLibLoopMe MustInherit MustOverrideMyBaseMyClass NarrowingNewNextNotNothingNotInheritableNotOverridableOfOnr OptionOptional Overloads Overridable Overrides ParamArrayPartialPrivate ProtectedPublic RaiseEventReadOnlyReDim RemoveHandlerResumeReturnSelectSetShadowsSharedrwStaticStepStopSyncLockThenThrowToTrueTryTryCastWendUsingWhenWhileWideningWith WithEvents WriteOnlyz(?>=|<<|>>|:=|<=|>=|<>|[-&*/\\^+=<>\[\]]rstringz(_)(\n)z [%&@!#$]?z#.*?#z"(\d+\.\d*|\d*\.\d+)(F[+-]?[0-9]+)?z\d+([SILDFR]|US|UI|UL)?z&H[0-9a-f]+([SILDFR]|US|UI|UL)?z&O[0-7]+([SILDFR]|US|UI|UL)?""z"C?rJ[^"]+\.z?(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\b)rNr r rrrIr cCstd|tjr dSdS)Nz^\s*(#If|Module|Namespace)g?)rhsearchrirr^r^r_rszVbNetLexer.analyse_textN)*r`rarbrcrdrerfrgrmrnuni_namerhri IGNORECASErlrrvrrr rzr r Declarationr r{r rrr rDaterrrVariablerrur|r}rTrr^r^r^r_rs         <    Xrc@sfeZdZdZdZgZgZejZ dde e j e e j fde eee eefdeefdeefgiZdS) GenericAspxLexerz" Lexer for ASP.NET pages. zaspx-genrNz(<%[@=#]?)(.*?)(%>)z()(.*?)()z (.+?)(?=<)z.+N)r`rarbrcrdrfrgrhrjrlrrTagrrrrTr^r^r^r_rs    rc>eZdZdZdZdgZgdZgZfddZddZ Z S)rz9 Lexer for highlighting C# within ASP.NET pages. zaspx-csz*.aspxz*.asaxz*.ascxz*.ashxz*.asmxz*.axdc tjttfi|dSN)superrYrrr[r\rVr^r_rYzCSharpAspxLexer.__init__cC4td|tjdur dStd|tjdurdSdS)NzPage\s*Language="C#"皙?zscript[^>]+language=["\']C#333333?rhrIrr^r^r_r zCSharpAspxLexer.analyse_text r`rarbrcrdrerfrgrYr __classcell__r^r^rr_r rcr)rzG Lexer for highlighting Visual Basic.net within ASP.NET pages. zaspx-vbrc rr)rrYrrrrr^r_rY%r zVbNetAspxLexer.__init__cCr!)NzPage\s*Language="Vb"r"zscript[^>]+language=["\']vbr#r$rr^r^r_r(r&zVbNetAspxLexer.analyse_textr'r^r^rr_rr)rc @seZdZdZdZddgZddgZdgZgdZegd 7Zgd Z d Z gd Z d Z dZ gdZdejfdejfdejfdejfggdefdejjfdejdfdefdeejefdeejefdedfdedfded fd!ed"fd#eeeejfd$eeeejfd%eeeejfd&eeeeeejfd'd(eefd)efd*d(e e fd+e e e fe fd'd(e e j!fd'd(eej"fd,eej#eej#ej#efd-efd.e$j%fd/e$j&fd0e$j'fd1e$j(fd2e$j)fd3ej*fd4ej*fd5efd6ej+d"fd7ejfdefd8efd9ejfd:ed;fded?fd@ed;fdedfded fd!ed"fdAefgdBefe-dCdDefdEefdFed;fgdGefdEefdHefdFed;fgdGefdEefdIed;fd!efgdJZ.dKdLZ/dMS)Nrz` For the `F# language `_ (version 3.0). .. versionadded:: 1.5 zF#fsharpzf#z*.fsz*.fsiz text/x-fsharp)BabstractasassertbasebeginrGrdelegatezdo!dodonedowncastdowntoelifelser  exceptionexternfalsefinallyforfunctionfunglobalifinheritinline interfaceinternalinlazyzlet!letmatchmembermodulemutablerInewnullofopenoverrideprivatepublicreczreturn!returnselectstaticstructthentotruetrytypeupcastzuse!usevalvoidwhenwhilewithzyield!yield)atomicbreakchecked componentconst constraint constructorcontinueeagereventexternalfixedfunctorrmethodmixinobjectparallelprocess protectedpuresealedtailcalltraitvirtualvolatile)+z!=#z&&&rrz\*z\+,z-\.z->-z\.\.rz::z:=z:>:z;;;z<-z<\]\]>z\?\?z\?z\[z@@>z[!$%&*+\./:<=>?@^|~-])andornotz[!?~]z[=<>@^|&+\*/$%-])sbytebytechar nativeint unativeintfloat32singlefloatdoubleint8uint8int16uint16int32uint32int64uint64decimalunitboolr rSexnobjenumz\\[\\"\'ntbrafv]z \\[0-9]{3}z\\u[0-9a-fA-F]{4}z\\U[0-9a-fA-F]{8}rz \(\)|\[\]z \b(? and <| are weak indicators.rz|>g?z<|r^rr^r^r_rs zFSharpLexer.analyse_textN)0r`rarbrcrdrerfrgkeywordskeyopts operatorsword_operators prefix_syms infix_syms primitivesrEscaperrrPseudor}rDocr rwrrr|r rujoinr rr{rzrrrrBinrryrrrrTrr^r^r^r_r0s           "#$%&)+, .03   ar)'rcrhpygments.lexerrrrrrrrr pygments.tokenr r r r rrrrrrr pygments.utilrpygmentsrrmpygments.lexers.htmlr__all__rrrrrrrrr^r^r^r_s" (4   t2Cn