a
    U_:k                     @   s  d Z ddl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mZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ g d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$G dd deZ%dS )z
    pygments.lexers.dotnet
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for .net languages.

    :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerDelegatingLexerbygroupsincludeusingthisdefaultwords)
PunctuationTextCommentOperatorKeywordNameStringNumberLiteralOther)get_choice_opt)	unistring)XmlLexer)CSharpLexerNemerleLexerBooLexer
VbNetLexerCSharpAspxLexerVbNetAspxLexerFSharpLexerc                   @   s  e Zd ZdZdZddgZdgZdgZej	ej
B ejB Zdded	d
ddd d d ed	d
dddddddd
 d ded	d
dddd d d ed	d
ddddddddd d dZi ZdZe D ]
\ZZde d e d eeeejeefdejfd efd!efd"ejfd#ej fd$efd%efd&efd'e!fd(e!fd)e!j"fd*e#fd+ej$fd,ee%ee%fd-e%fd.ee%efd/e%j&fd0ee%ed1fd2ee%ed3feefgeej'd4fe(d4gd5ed4fd6e d7 ej)d4fgd8ee< qd9d: Z*d;S )<r   a  
    For `C# <http://msdn2.microsoft.com/en-us/vcsharp/default.aspx>`_
    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
    zC#Zcsharpzc#z*.csztext/x-csharp@?[_a-zA-Z]\w*@?[_LuLlLtLmNl][NdPcCfMnMc]*	@?(?:_|[^Lo])[^ZnonebasicZfullT^([ \t]*(?:(?:\[\])?\s+)+?)(
)(\s*)(\()^\s*\[.*?\][^\S\n]+\\\n//.*?\n/[*].*?[*]/\n[~!%^&*()+=|\[\]:;,.<>/?-][{}]@"(""|[^"])*""(\\\\|\\"|[^"\n])*["\n]'\\.'|'[^\\]'zA[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?Z#[ \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(?=\()(|\.)+)rootrD   rF   c                 K   sP   t |dt| jd}|| jvr.| j|| _n| j| | _tj| fi | d S NZunicodelevelr2   	r   listtokensZ_all_tokens	__class__Zprocess_tokendefZ_tokensr   __init__selfoptionslevel rV   8/usr/lib/python3/dist-packages/pygments/lexers/dotnet.pyrQ      s
    
zCSharpLexer.__init__N)+__name__
__module____qualname____doc__namealiases	filenames	mimetypesre	MULTILINEDOTALLUNICODEflagsunicombine	allexceptlevelsrO   token_variantsitems	levelnamecs_identr   r   r   r   Functionr   r
   	Attributer   Single	Multiliner   Charr   Preprocr   TypeClassr   	NamespacerQ   rV   rV   rV   rW   r      s   

,
6r   c                !   @   s  e Zd ZdZdZdgZdgZdgZej	ej
B ejB Zddedd	d
dd d d edd	d
ddddddd
 d dedd	d
ddd d d edd	d
dddddddd d dZi ZdZe D ]\ZZde d e d eeeejeefdejfdefd efd!ejfd"ej fd#efd$e!d%fd&e!d'fd(e!d)fd*e d+ e"fd,e"fd-e efd.eeed/fd0efd1efd2e!fd3e!fd4e!j#fd5e$fd6e$fd7ej%fd8ee"ee"fd9e"fd:ee"efd;e"j&fd<e d= eee"j&fd>ee"ed?fd@ee"edAfeefgeej'dBfgdCedBfdDe dE ej(dBfgdFe!fd-e efd.eeed/fdGe!fdHe!dBfgdIe!fd-e efd.eeed/fd(e!dJfdKe!dBfgdLe!fd(e!dJfdKe!dBfgdMe"fdNefeefdOe$fdPedJfdQedBfgdRee< qdSdT Z)dUS )Vr   a  
    For `Nemerle <http://nemerle.org>`_ 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
    ZNemerleZnemerlez*.nztext/x-nemerler   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   Tr3   r4   r5   r6   r7   r8   r9   r:   r;   z\$\s*"splice-stringz\$\s*<#splice-string2z<#recursive-stringz	(<\[)\s*(z:)?z\]\>z\$z(\$)(\()splice-string-contentr<   r=   r>   r?   r@   z0[xX][0-9a-fA-F]+[Ll]?z*[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?rA   rB   a  (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)\brC   zo(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+)rD   rE   rF   rG   rH   rI   rJ   z[^"$]z\\""z[^#<>$]#pushz#>z[^#<>]zif|matchz[~!%^&*+=|\[\]:;,.<>/?-\\"$ ]\d+\(\))rK   rD   rF   rv   rw   rx   ry   c                 K   sP   t |dt| jd}|| jvr.| j|| _n| j| | _tj| fi | d S rL   rM   rR   rV   rV   rW   rQ     s    
zNemerleLexer.__init__N)*rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   rO   ri   rj   rk   rl   r   r   r   r   rm   r   r
   rn   r   ro   rp   r   r   rq   r   rr   rs   rt   ru   rQ   rV   rV   rV   rW   r      s   







=


	

	cr   c                   @   sL  e Zd ZdZdZdgZdgZdgZdefde	j
fde	jd	fd
efdefdefdejfdejfdejfdefdefdefdeeedfdeeedfdeeedfdejfdejfdejfdej
fdefdejfdefd ejfd!ejfd"ejjfd#ejfgde	jd$fd%e	jd&fd'e	jfd(e	jfgdejd&fgdejd&fgd)ejd&fgd*Zd+S ),r   z<
    For `Boo <http://boo.codehaus.org/>`_ source code.
    ZBooZbooz*.booz
text/x-boo\s+z	(#|//).*$z/[*]commentz[]{}:(),.;[]r8   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)\bzdef(?=\s+\(.*?\))z
(def)(\s+)funcnamez(class)(\s+)	classnamez(namespace)(\s+)rF   z(?<!\.)(true|false|null|self|__eval__|__switch__|array|assert|checked|enumerate|filter|getter|len|lock|map|matrix|max|min|normalArrayIndexing|print|property|range|rawArrayIndexing|required|typeof|unchecked|using|yieldAll|zip)\bz"""(\\\\|\\"|.*?)"""z"(\\\\|\\"|[^"]*?)"z'(\\\\|\\'|[^']*?)'z[a-zA-Z_]\w*z%(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?z[0-9][0-9.]*(ms?|d|h|s)z0\d+z0x[a-fA-F0-9]+z\d+Lr|   r{   z[*]/rG   z[^/*]z[*/]z[a-zA-Z_][\w.]*)rK   r   r   r   rF   N) rX   rY   rZ   r[   r\   r]   r^   r_   r   r   ro   rp   r
   r   Wordr   ZRegexr   r   r   BuiltinDoubler   FloatOctHexIntegerZLongrm   rt   ru   rO   rV   rV   rV   rW   r   +  s`   

'




r   c                   @   s  e Zd ZdZdZddgZddgZddgZd	e	d
ddd d d e	d
dddddddd	 d Z
ejejB Zdejfdefdefdefdefdejfdefdejfeddd d!efd"ed#fd$ed%fd&eeed'fd(eeed)fd*eeed+fd,ejfd-ejfd.efd/ed0fd1efe
d2 efd3ejfd4ej fd5ej!fd6ej!fd7ej!fgd8efd9ed:fd;efge
ej"d:fe#d:ge
ej$d:fge
ej%d:fge
ej&fd<ej&fe#d:gdefd=ed:fe#d:gd>Z'd?d@ Z(dAS )Br   zm
    For
    `Visual Basic.NET <http://msdn2.microsoft.com/en-us/vbasic/default.aspx>`_
    source code.
    zVB.netzvb.netZvbnetz*.vbz*.basztext/x-vbnetz
text/x-vbaz[_r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   z	^\s*<.*?>r   r;   z
rem\b.*?\nz'.*?\nz#If\s.*?\sThen|#ElseIf\s.*?\sThen|#Else|#End\s+If|#Const|#ExternalSource.*?\n|#End\s+ExternalSource|#Region.*?\n|#End\s+Region|#ExternalChecksumz[(){}!#,.:]z9Option\s+(Strict|Explicit|Compare)\s+(On|Off|Binary|Text))lZ
AddHandlerZAliasZByRefZByValZCallZCaseZCatchZCBoolZCByteZCCharZCDateZCDecZCDblZCIntZCLngZCObjZContinueZCSByteZCShortZCSngZCStrZCTypeZCUIntZCULngZCUShortZDeclareZDefaultZDelegateZ
DirectCastZDoZEachZElseZElseIfZEndIfZEraseErrorZEventZExitFalseZFinallyZForZFriendZGetZGlobalZGoSubZGoToZHandlesZIfZ
ImplementsZInheritsZ	InterfaceZLetZLibZLoopZMeZMustInheritZMustOverrideZMyBaseZMyClassZ	NarrowingZNewZNextZNotZNothingZNotInheritableZNotOverridableZOfZOnr   ZOptionOptionalZ	OverloadsZOverridableZ	OverridesZ
ParamArrayZPartialZPrivateZ	ProtectedZPublicZ
RaiseEventZReadOnlyZReDimZRemoveHandlerZResumeZReturnZSelectSetZShadowsZSharedro   ZStaticZStepZStopZSyncLockZThenZThrowZToTrueZTryZTryCastZWendZUsingZWhenZWhileZWideningZWithZ
WithEventsZ	WriteOnlyz(?<!\.)z\b)prefixsuffixz(?<!\.)End\bendz(?<!\.)(Dim|Const)\bdimz#(?<!\.)(Function|Sub|Property)(\s+)r   z"(?<!\.)(Class|Structure|Enum)(\s+)r   z&(?<!\.)(Module|Namespace|Imports)(\s+)rF   z|(?<!\.)(Boolean|Byte|Char|Date|Decimal|Double|Integer|Long|Object|SByte|Short|Single|String|Variant|UInteger|ULong|UShort)\bzU(?<!\.)(AddressOf|And|AndAlso|As|GetType|In|Is|IsNot|Like|Mod|Or|OrElse|TypeOf|Xor)\bzE&=|[*]=|/=|\\=|\^=|\+=|-=|<<=|>>=|<<|>>|:=|<=|>=|<>|[-&*/\\^+=<>\[\]]rz   stringz_\nz	[%&@!#$]?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?rG   [^"]+\.z?(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\b)rK   r   r   r   r   rF   r   c                 C   s   t d| t jrdS d S )Nz^\s*(#If|Module|Namespace)g      ?)r`   searchra   textrV   rV   rW   analyse_text  s    zVbNetLexer.analyse_textN))rX   rY   rZ   r[   r\   r]   r^   r_   re   rf   Zuni_namer`   ra   
IGNORECASErd   r   rn   r   r   rr   r
   r   ZDeclarationr	   r   rs   r   r   r   r   ZDater   r   r   Variabler   rm   rt   ru   rO   r   rV   rV   rV   rW   r   n  s   



;


Wr   c                   @   sf   e Zd ZdZdZg Zg ZejZ	dde
ejeejfde
eeeeefdeefdeefgiZdS )	GenericAspxLexerz"
    Lexer for ASP.NET pages.
    zaspx-genrK   z(<%[@=#]?)(.*?)(%>)z(<script.*?>)(.*?)(</script>)z
(.+?)(?=<)z.+N)rX   rY   rZ   r[   r\   r^   r_   r`   rb   rd   r   r   ZTagr   r   r   rO   rV   rV   rV   rW   r     s   


r   c                       s>   e Zd ZdZdZdgZg dZg Z fddZdd Z	  Z
S )r   z9
    Lexer for highlighting C# within ASP.NET pages.
    zaspx-csz*.aspxz*.asaxz*.ascxz*.ashxz*.asmxz*.axdc                    s   t  jttfi | d S N)superrQ   r   r   rS   rT   rP   rV   rW   rQ     s    zCSharpAspxLexer.__init__c                 C   s4   t d| t jd urdS t d| t jd ur0dS d S )NzPage\s*Language="C#"皙?zscript[^>]+language=["\']C#333333?r`   r   Ir   rV   rV   rW   r      s    zCSharpAspxLexer.analyse_textrX   rY   rZ   r[   r\   r]   r^   r_   rQ   r   __classcell__rV   rV   r   rW   r     s   r   c                       s>   e Zd ZdZdZdgZg dZg Z fddZdd Z	  Z
S )r   zG
    Lexer for highlighting Visual Basic.net within ASP.NET pages.
    zaspx-vbr   c                    s   t  jttfi | d S r   )r   rQ   r   r   r   r   rV   rW   rQ     s    zVbNetAspxLexer.__init__c                 C   s4   t d| t jd urdS t d| t jd ur0dS d S )NzPage\s*Language="Vb"r   zscript[^>]+language=["\']vbr   r   r   rV   rV   rW   r     s    zVbNetAspxLexer.analyse_textr   rV   rV   r   rW   r     s   r   c                "   @   s  e Zd ZdZdZddgZddgZdgZg dZeg d	7 Zg d
Z	dZ
g dZdZdZg dZdejfdejfdejfdejfgdefdejjfdejdfdefdejfdejfdedfdedfded fd!ed"fd#eeeejfd$eeeejfd%eeeejfd&eeeeeejfd'd(e efd)efd*d(e	 e fd+eee
f e fd'd(e e j!fd'd(e ej"fd,ej#fd-efd.e$j%fd/e$j&fd0e$j'fd1e$j(fd2e$j)fd3ej*fd4ej*fd5efd6ej+d"fd7ejfg defd8efd9ejfd:ed;fd<ed;fe,d;gd=efd>ed?fd@ed;fdedfded fd!ed"fdAefgdBefe-dCdDefdEefdFed;fgdGefdEefdHefdFed;fgdGefdEefdIed;fd!efgdJZ.dKS )Lr   z`
    For the `F# language <https://fsharp.org/>`_ (version 3.0).

    .. versionadded:: 1.5
    zF#Zfsharpzf#z*.fsz*.fsiztext/x-fsharp)BZabstractasassertbaseZbeginrD   r   Zdelegatezdo!ZdoZdoneZdowncastZdowntoelifelser   Z	exceptionZexternZfalsefinallyforZfunctionZfunglobalifZinheritZinlineZ	interfaceZinternalinZlazyzlet!ZletmatchmembermoduleZmutablerF   newZnullZofopenoverrideZprivateZpublicZreczreturn!returnZselectZstaticZstructZthentotruetrytypeZupcastzuse!ZusevalZvoidZwhenwhilewithzyield!yield)ZatomicbreakcheckedZ	componentZconstZ
constraintconstructorcontinueZeagerZeventZexternalZfixedZfunctorr   methodZmixinobjectZparallelZprocessZ	protectedZpureZsealedZtailcallZtraitZvirtualZvolatile)+z!=#z&&&r}   r~   z\*z\+,z-\.z->-z\.\.r   z::z:=z:>:z;;;z<-z<\]<z>\]>z\?\?z\?z\[<z\[\|z\[z\]_`z\{z\|\]z\|z\}~z<@@z<@=z@>z@@>z[!$%&*+\./:<=>?@^|~-])andornotz[!?~]z[=<>@^|&+\*/$%-])ZsbyteZbytecharZ	nativeintZ
unativeintZfloat32ZsinglefloatZdoubleZint8Zuint8Zint16Zuint16Zint32Zuint32Zint64Zuint64ZdecimalZunitboolr   rN   Zexnobjenumz\\[\\"\'ntbrafv]z
\\[0-9]{3}z\\u[0-9a-fA-F]{4}z\\U[0-9a-fA-F]{8}r   z	\(\)|\[\]z \b(?<!\.)([A-Z][\w\']*)(?=\s*\.)dottedz\b([A-Z][\w\']*)z///.*?\nr9   z
\(\*(?!\))r   z@"lstringz"""tqsrz   r   z\b(open|module)(\s+)([\w.]+)z\b(let!?)(\s+)(\w+)z\b(type)(\s+)(\w+)z&\b(member|override)(\s+)(\w+)(\.)(\w+)z\b(%s)\b|z``([^`\n\r\t]|`[^`\n\r\t])+``z(%s)z
(%s|%s)?%sz3#[ \t]*(if|endif|else|line|nowarn|light|\d+)\b.*?\nz[^\W\d][\w']*z\d[\d_]*[uU]?[yslLnQRZINGmM]?z-0[xX][\da-fA-F][\da-fA-F_]*[uU]?[yslLn]?[fF]?z0[oO][0-7][0-7_]*[uU]?[yslLn]?z0[bB][01][01_]*[uU]?[yslLn]?z/-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)[fFmM]?z9'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'B?z'.''z@?"z[~?][a-z][\w\']*:r   z[A-Z][\w\']*(?=\s*\.)z[A-Z][\w\']*rG   z[a-z_][\w\']*z	[^(*)@"]+z\(\*r{   z\*\)z[(*)@]z[^\\"]+escape-sequencer8   r;   z"B?r   r   z"""B?)r   rK   r   r   r   r   r   N)/rX   rY   rZ   r[   r\   r]   r^   r_   keywordsZkeyoptsZ	operatorsZword_operatorsZprefix_symsZ
infix_symsZ
primitivesr   ZEscaper   r   r   ZPseudoru   ZDocr   ro   r   r   r   rt   r
   rm   joinr   r   rs   rr   r   r   r   r   ZBinr   rq   r   r   r   rO   rV   rV   rV   rW   r     s   

2
r   )&r[   r`   Zpygments.lexerr   r   r   r   r   r   r   r	   Zpygments.tokenr
   r   r   r   r   r   r   r   r   r   Zpygments.utilr   Zpygmentsr   re   Zpygments.lexers.htmlr   __all__r   r   r   r   r   r   r   r   rV   rV   rV   rW   <module>   s    	(0r  Cm