a
    ¨ˆcPÐ  ã                   @   s2  d Z ddlZddl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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mZ ddlmZ g d¢Z e !d¡Z"G d	d
„ d
eƒZ#e#Z$G dd„ deƒZ%G dd„ deƒZ&G dd„ deƒZ'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.python
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Python and related languages.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)
ÚLexerÚ
RegexLexerÚincludeÚbygroupsÚusingÚdefaultÚwordsÚcombinedÚdo_insertionsÚthis)Úget_bool_optÚshebang_matches)ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚGenericÚOtherÚError)Ú	unistring)ÚPythonLexerÚPythonConsoleLexerÚPythonTracebackLexerÚPython2LexerÚPython2TracebackLexerÚCythonLexerÚDgLexerÚ
NumPyLexerz.*?
c                $   @   s  e Zd ZdZdZdZg d¢Zg d¢Zg d¢Zde	j
e	jf Zdd	„ Zd
d„ Zdefdeeejejƒfdeeejejƒfdejfdejfdefdefedƒedƒdeeeƒdfdeeeƒdfdeejeƒdfdeejeƒdfedƒgdeejejƒedd ƒfd!eejejƒedd"ƒfd#eejejƒedd$ƒfd%eejejƒedd&ƒfd'eejejƒed(d ƒfd)eejejƒed(d"ƒfd*eejejƒed(d$ƒfd+eejejƒed(d&ƒfd,eejejƒd-fd.eejejƒd/fd0eejejƒd1fd2eejejƒd3fd4eejejƒed5d-ƒfd6eejejƒed5d/ƒfd7eejejƒed5d1ƒfd8eejejƒed5d3ƒfd9eejejƒed:d-ƒfd;eejejƒed:d/ƒfd<eejejƒed:d1ƒfd=eejejƒed:d3ƒfd>efed?ƒd@efdAefdBejfedCƒedDƒedEƒedFƒedGƒgdHedIfdJejdKfdLejdKfdMefedƒgdHedIfdNedKfdMefedƒge dOdPdQ�efe dRdPdQ�ej!fge dSdPdQ�efe dRdPdQ�ej!fgdTdU "e#j$¡ dV eeeƒdWfgdXeee%e&ƒeƒfe'dKƒge dYdZdPd[�e(j)fd\e(j)j*fe d]dZdPd[�e(j+fge d^dPdQ�e(j,j-fge d_dPdQ�e(j.j-fgd`e/j0fdae/j0fdbe/j1fdce/j2fdde/j3fdee/j4fgdfe e(j5fdfefee(fgedEƒee(j,dKfe'dKƒgee(j6dKfgdgeeeeƒfdhe(jfee(jfdieeeeƒfe'dKƒgdjeeejƒdKfdhe(jfdke(j)j*dKfee(jfe'dKƒgdlej7fdmej7fgedƒed5ƒgdnej7fgdoej7fed:ƒgeejƒeejƒeejƒeejƒdpejdKfdqej7fedrƒgdsejdKfdtej7feduƒgdpejdKfdqej7fedvƒgdsejdKfdtej7fedwƒgdxejdKfedrƒdejfgdyejdKfeduƒdejfgdxejdKfedvƒdejfgdyejdKfedwƒdejfgdzœ!Z8d{d|„ Z9d}S )~r   zÕ
    For Python source code (version 3.x).

    .. versionadded:: 0.10

    .. versionchanged:: 2.5
       This is now the default ``PythonLexer``.  It is still available as the
       alias ``Python3Lexer``.
    ÚPythonúhttp://www.python.org)ÚpythonÚpyZsageÚpython3Zpy3)z*.pyz*.pywz*.jyz*.sagez*.scZ
SConstructZ
SConscriptz*.bzlZBUCKÚBUILDzBUILD.bazelZ	WORKSPACEz*.tac)ztext/x-pythonzapplication/x-pythonztext/x-python3zapplication/x-python3z	[%s][%s]*c                 C   s&   dt jfdt jfd| fd| fd| fgS )NzH%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsaux%]zg\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\![sra])?(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}z[^\\\'"%{\n]+ú[\'"\\]z%|(\{{1,2})©r   ÚInterpol©Úttype© r-   úY/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pygments/lexers/python.pyÚinnerstring_rulesC   s    ÿüñzPythonLexer.innerstring_rulesc                 C   s"   dt jfdt jdfd| fd| fgS )Nz\}z\{úexpr-inside-fstringz[^\\\'"{}\n]+r(   r)   r+   r-   r-   r.   Úfstring_rulesW   s
    
÷zPythonLexer.fstring_rulesú\nú&^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")ú&^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')ú\A#!.+$ú#.*$ú\\\nú\\Úkeywordsúsoft-keywordsú(def)((?:\s|\\\s)+)Úfuncnameú(class)((?:\s|\\\s)+)Ú	classnameú(from)((?:\s|\\\s)+)Ú
fromimportú(import)((?:\s|\\\s)+)ÚimportÚexprz(?i)(rf|fr)(""")ÚrfstringescapeÚtdqfz(?i)(rf|fr)(''')Útsqfz(?i)(rf|fr)(")Údqfz(?i)(rf|fr)(')Úsqfz([fF])(""")Úfstringescapez([fF])(''')z	([fF])(")z	([fF])(')z(?i)(rb|br|r)(""")Útdqsz(?i)(rb|br|r)(''')Útsqsz(?i)(rb|br|r)(")Údqsz(?i)(rb|br|r)(')Úsqsz([uU]?)(""")Ústringescapez([uU]?)(''')z
([uU]?)(")z
([uU]?)(')z([bB])(""")Úbytesescapez([bB])(''')z	([bB])(")z	([bB])(')ú[^\S\n]+Únumbersz!=|==|<<|>>|:=|[-~+/*%=<>&^|.]ú[]{}:(),;[]ú(in|is|and|or|not)\búexpr-keywordsÚbuiltinsÚ
magicfuncsÚ	magicvarsÚnamez[{([]úexpr-inside-fstring-innerz(=\s*)?(\![sraf])?\}ú#popz(=\s*)?(\![sraf])?:ú\s+z[])}])z	async forÚawaitÚelseÚforÚifÚlambdaÚyieldú
yield fromú\b©Úsuffix)ÚTrueÚFalseÚNone)ÚassertÚasyncr\   ÚbreakÚcontinueÚdelÚelifr]   ÚexceptÚfinallyr^   Úglobalr_   r`   ÚpassÚraiseÚnonlocalÚreturnÚtryÚwhilera   rb   ÚasÚwithz6(^[ \t]*)(match|case)\b(?![ \t]*(?:[:,;=^&|@~)\]}]|(?:ú|z)\b))úsoft-keywords-innerz(\s+)([^\n_]*)(_\b))AÚ
__import__ÚabsÚallÚanyÚbinÚboolÚ	bytearrayÚ
breakpointÚbytesÚchrÚclassmethodÚcompileÚcomplexÚdelattrÚdictÚdirÚdivmodÚ	enumerateÚevalÚfilterÚfloatÚformatÚ	frozensetÚgetattrÚglobalsÚhasattrÚhashÚhexÚidÚinputÚintÚ
isinstanceÚ
issubclassÚiterÚlenÚlistÚlocalsÚmapÚmaxÚ
memoryviewÚminÚnextÚobjectÚoctÚopenÚordÚpowÚprintÚpropertyÚrangeÚreprÚreversedÚroundÚsetÚsetattrÚsliceÚsortedÚstaticmethodÚstrÚsumÚsuperÚtupleÚtypeÚvarsÚzipú(?<!\.)©Úprefixre   z+(?<!\.)(self|Ellipsis|NotImplemented|cls)\b)EÚArithmeticErrorÚAssertionErrorÚAttributeErrorÚBaseExceptionÚBufferErrorÚBytesWarningÚDeprecationWarningÚEOFErrorÚEnvironmentErrorÚ	ExceptionÚFloatingPointErrorÚFutureWarningÚGeneratorExitÚIOErrorÚImportErrorÚImportWarningÚIndentationErrorÚ
IndexErrorÚKeyErrorÚKeyboardInterruptÚLookupErrorÚMemoryErrorÚ	NameErrorÚNotImplementedErrorÚOSErrorÚOverflowErrorÚPendingDeprecationWarningÚReferenceErrorÚResourceWarningÚRuntimeErrorÚRuntimeWarningÚStopIterationÚSyntaxErrorÚSyntaxWarningÚSystemErrorÚ
SystemExitÚTabErrorÚ	TypeErrorÚUnboundLocalErrorÚUnicodeDecodeErrorÚUnicodeEncodeErrorÚUnicodeErrorÚUnicodeTranslateErrorÚUnicodeWarningÚUserWarningÚ
ValueErrorÚVMSErrorÚWarningÚWindowsErrorÚZeroDivisionErrorÚBlockingIOErrorÚChildProcessErrorÚConnectionErrorÚBrokenPipeErrorÚConnectionAbortedErrorÚConnectionRefusedErrorÚConnectionResetErrorÚFileExistsErrorÚFileNotFoundErrorÚInterruptedErrorÚIsADirectoryErrorÚNotADirectoryErrorÚPermissionErrorÚProcessLookupErrorÚTimeoutErrorÚStopAsyncIterationÚModuleNotFoundErrorÚRecursionErrorZEncodingWarning)^Ú__abs__Ú__add__Ú
__aenter__Ú	__aexit__Ú	__aiter__Ú__and__Ú	__anext__Ú	__await__Ú__bool__Ú	__bytes__Ú__call__Ú__complex__Ú__contains__Ú__del__Ú__delattr__Ú
__delete__Ú__delitem__Ú__dir__Ú
__divmod__Ú	__enter__Ú__eq__Ú__exit__Ú	__float__Ú__floordiv__Ú
__format__Ú__ge__Ú__get__Ú__getattr__Ú__getattribute__Ú__getitem__Ú__gt__Ú__hash__Ú__iadd__Ú__iand__Ú__ifloordiv__Ú__ilshift__Ú__imatmul__Ú__imod__Ú__imul__Ú	__index__Ú__init__Ú__instancecheck__Ú__int__Ú
__invert__Ú__ior__Ú__ipow__Ú__irshift__Ú__isub__Ú__iter__Ú__itruediv__Ú__ixor__Ú__le__Ú__len__Ú__length_hint__Ú
__lshift__Ú__lt__Ú
__matmul__Ú__missing__Ú__mod__Ú__mul__Ú__ne__Ú__neg__Ú__new__Ú__next__Ú__or__Ú__pos__Ú__pow__Ú__prepare__Ú__radd__Ú__rand__Ú__rdivmod__Ú__repr__Ú__reversed__Ú__rfloordiv__Ú__rlshift__Ú__rmatmul__Ú__rmod__Ú__rmul__Ú__ror__Ú	__round__Ú__rpow__Ú__rrshift__Ú
__rshift__Ú__rsub__Ú__rtruediv__Ú__rxor__Ú__set__Ú__setattr__Ú__setitem__Ú__str__Ú__sub__Ú__subclasscheck__Ú__truediv__Ú__xor__)Ú__annotations__Ú	__bases__Ú	__class__Ú__closure__Ú__code__Ú__defaults__Ú__dict__Ú__doc__Ú__file__Ú__func__Ú__globals__Ú__kwdefaults__Ú
__module__Ú__mro__Ú__name__Ú__objclass__Ú__qualname__Ú__self__Ú	__slots__Ú__weakref__zT(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)([eE][+-]?\d(?:_?\d)*)?z!\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?z0[oO](?:_?[0-7])+z0[bB](?:_?[01])+z0[xX](?:_?[a-fA-F0-9])+z\d(?:_?\d)*ú@ú(\s+)(as)(\s+)z\.ú(\s*)(,)(\s*)z(\s+)(import)\búNone\bz\{\{z\}\}z0\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})z,\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})ú"ú\\\\|\\"|\\\núfstrings-doubleú'ú\\\\|\\'|\\\núfstrings-singleústrings-doubleústrings-singleú"""ú''')!ÚrootrC   r0   rY   rT   r9   r:   r{   rU   rV   rW   rQ   rX   r<   r>   rB   r@   rD   rI   rO   rN   r  r|  r�  r€  rG   rH   rL   rM   rE   rF   rJ   rK   c                 C   s   t | dƒpd| d d… v S )Núpythonw?(3(\.\d)?)?úimport éè  ©r   ©Útextr-   r-   r.   Úanalyse_text™  s    
ÿzPythonLexer.analyse_textN):rp  rn  rr  ri  rX   ÚurlÚaliasesÚ	filenamesÚ	mimetypesÚuniZ	xid_startZxid_continueZuni_namer/   r1   r   r   r   ÚAffixÚDocr   ÚHashbangÚSingler   r   Ú	NamespaceÚDoubler	   r   r   ÚWordr*   r   ÚConstantÚjoinÚkeywordÚkwlistr   r   r   r   ÚBuiltinÚPseudorÉ   ÚFunctionÚMagicÚVariabler   ÚFloatÚOctÚBinÚHexÚIntegerÚ	DecoratorÚClassÚEscapeÚtokensr‹  r-   r-   r-   r.   r      sþ  
ÿÿÿÿîþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÄ?þþôüþýú	üûù
üü
ûþý
öõ
èçò*ëêÿûúÿ
ÿù
ý
ý
ÿûù
þþÿþ
ý
ý
ý
ý
ý
ý
ý
ý€ € Ó  6r   c                    @   sf  e Zd ZdZdZdZddgZg ZddgZdd	„ Z	d
e
fdee
ejejƒfdee
ejejƒfde
fdejfdejfdefde
fde
fdejfdefedƒdeee
ƒdfdeee
ƒdfdeeje
ƒdfdeeje
ƒdfedƒedƒed ƒed!ƒd"eejejƒd#fd$eejejƒd%fd&eejejƒd'fd(eejejƒd)fd*eejejƒed+d#ƒfd,eejejƒed+d%ƒfd-eejejƒed+d'ƒfd.eejejƒed+d)ƒfed/ƒed0ƒged1d2d3�efged4d5d2d6�ejfd7ejjfed8d5d2d6�ejfged9d2d3�ejj fged:d2d3�ej!j fgd;e"j#fd<e"j#fd=e"j$fd>e"j%fd?e"j&fd@e"j'j(fdAe"j'fgdBej)fgdCej*fdDefgedƒdDejdEfe+dEƒgdDej,dEfgdFe
fdGejfdHefdIejfe+dEƒgdFe
fdJejdEfdKejjdEfdLejfe+dEƒgdMej-fge	ejƒe	ejƒdNejdEfdOej-fedPƒgdQejdEfdRej-fedSƒgdTejdEfedPƒd
ejfgdUejdEfedSƒd
ejfgdVœZ.dWdX„ Z/dYS )Zr   a  
    For Python 2.x source code.

    .. versionchanged:: 2.5
       This class has been renamed from ``PythonLexer``.  ``PythonLexer`` now
       refers to the Python 3 variant.  File name patterns like ``*.py`` have
       been moved to Python 3 as well.
    z
Python 2.xr#   Zpython2Zpy2ztext/x-python2zapplication/x-python2c                 C   s   dt jfd| fd| fd| fgS )NúG%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]ú[^\\\'"%\n]+r(   ú%r)   r+   r-   r-   r.   r/   ±  s    ÿøzPython2Lexer.innerstring_rulesr2   r3   r4   rP   r5   r6   rR   r7   r8   rS   z!=|==|<<|>>|[-~+/*%=<>&^|.]r9   r;   r<   r=   r>   r?   r@   rA   rB   rU   rV   rW   Úbacktickz!([rR]|[uUbB][rR]|[rR][uUbB])(""")rJ   z!([rR]|[uUbB][rR]|[rR][uUbB])(''')rK   z([rR]|[uUbB][rR]|[rR][uUbB])(")rL   z([rR]|[uUbB][rR]|[rR][uUbB])(')rM   z([uUbB]?)(""")rN   z([uUbB]?)(''')z([uUbB]?)(")z([uUbB]?)(')rX   rQ   )ri   rk   rl   rm   rn   r]   ro   Úexecrp   r^   rq   r_   r`   rr   r«   rs   ru   rv   rw   ra   rb   rx   ry   rc   rd   )Nr|   r}   r~   r   ÚapplyÚ
basestringr€   r�   Úbufferr‚   r„   Úcallabler…   r†   ÚcmpÚcoercer‡   rˆ   r‰   rŠ   r‹   rŒ   r�   rŽ   ÚexecfileÚexitÚfiler�   r�   r’   r“   r”   r•   r–   r—   r˜   r™   rš   Úinternr›   rœ   r�   rž   rŸ   r    Úlongr¡   r¢   r¤   r¥   r¦   r§   r¨   r©   rª   r¬   r­   Ú	raw_inputÚreduceÚreloadr®   r¯   r°   r±   r²   r³   r´   rµ   r¶   r·   r¸   r¹   rº   ÚunichrÚunicoder»   Úxranger¼   r½   r¾   z;(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls)\b)1rÀ   rÁ   rÂ   rÃ   rÆ   rÇ   rÈ   rÉ   rÊ   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÒ   rÓ   rÔ   rÕ   rÖ   r×   rØ   rÙ   ÚOverflowWarningrÚ   rÛ   rÝ   rÞ   ÚStandardErrorrß   rà   rá   râ   rã   rä   rå   ræ   rç   rè   ré   rê   rë   rì   rí   rî   rï   rð   rñ   )_r  r  r	  r  Z__cmp__Z
__coerce__r  r  r  r  r  r  Z__delslice__Z__div__r  r  r  r  r  r  r  r  r  r   r!  Z__getslice__r"  r#  Z__hex__r$  r%  Z__idiv__r&  r'  r)  r*  r+  r,  r-  r.  r/  Z__iop__r0  r1  r2  r3  r4  r5  r6  r7  r8  Z__long__r:  r;  r=  r>  r?  r@  rA  rB  Ú__nonzero__Z__oct__Z__op__rD  rE  rF  rH  rI  Z__rcmp__Z__rdiv__rJ  rK  rL  rM  rN  rP  rQ  Z__rop__rR  rT  rU  rV  rW  rX  rY  rZ  r[  r\  Z__setslice__r]  r^  r_  r`  Ú__unicode__ra  )rc  rd  re  rf  rg  rh  ri  rj  rk  rl  Ú__metaclass__rn  ro  rp  rs  rt  ru  z'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?z\d+[eE][+-]?[0-9]+j?z	0[0-7]+j?z
0[bB][01]+ú0[xX][a-fA-F0-9]+ú\d+Lz\d+j?ú`.*?`z@[\w.]+ú[a-zA-Z_]\w*rZ   z(?:[ \t]|\\\n)+úas\bú,ú[a-zA-Z_][\w.]*zimport\bry  ú[a-zA-Z_.][\w.]*úY\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})rz  r{  r€  r}  r~  r�  r‚  rƒ  )r„  r9   rU   rV   rW   rQ   r­  rX   r<   r>   rB   r@   rN   r�  r€  rL   rM   rJ   rK   c                 C   s
   t | dƒS )Nzpythonw?2(\.\d)?rˆ  r‰  r-   r-   r.   r‹  {  s    zPython2Lexer.analyse_textN)0rp  rn  rr  ri  rX   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   r   r¡  r¢  r£  r¤  r¥  ÚLongÚBacktickr¦  r   r§  r¨  r©  r‹  r-   r-   r-   r.   r   ¡  s.  	ÿÿÿÿÿÿÿÿÿÿÿÿÖ-üûÿ	ôóÿòñï#îíÿûúÿ

ù
ÿþ
ý
ÿû
öÿÿ
ý
ý
ý
ý€ Ê >r   c                   @   s0   e Zd ZdZdZdgZdgZdd„ Zdd„ Zd	S )
r   aû  
    For Python console output or doctests, such as:

    .. sourcecode:: pycon

        >>> a = 'foo'
        >>> print a
        foo
        >>> 1 / 0
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ZeroDivisionError: integer division or modulo by zero

    Additional options:

    `python3`
        Use Python 3 lexer for code.  Default is ``True``.

        .. versionadded:: 1.0
        .. versionchanged:: 2.5
           Now defaults to ``True``.
    zPython console sessionZpyconztext/x-python-doctestc                 K   s$   t |ddƒ| _tj| fi |¤Ž d S )Nr&   T)r   r&   r   r,  )ÚselfÚoptionsr-   r-   r.   r,  š  s    zPythonConsoleLexer.__init__c              	   c   s.  | j r(tf i | j¤Ž}tf i | j¤Ž}n tf i | j¤Ž}tf i | j¤Ž}d}g }d}d}d}t |¡D �]v}	|	 ¡ }
|
 	d¡sˆ|
 	d¡rÂd}| 
t|ƒdtj|
d d… fgf¡ ||
dd … 7 }qf|
 ¡ dk�r|�s| 
t|ƒdtjdfgf¡ ||
dd … 7 }qf|�r(t|| |¡ƒE d H  d}g }|
 	d¡�sBt d	|
¡�rTd
}|
}|	 ¡ }qf|
dk�rr|	 ¡ tj|
fV  qf|�rÌ||
7 }|
 	d¡�sÞ|
 ¡ dk�sÞd}| |¡D ]\}}}|| ||fV  �q¨d}qf|	 ¡ tj|
fV  qf|�rüt|| |¡ƒE d H  |�r*| |¡D ]\}}}|| ||fV  �qd S )NÚ r   z>>> z... é   z...é   z"Traceback (most recent call last):z  File "[^"]+", line \d+\n$é   zKeyboardInterrupt
ú )r&   r   rÑ  r   r   r   Úline_reÚfinditerÚgroupÚ
startswithÚappendrž   r   ZPromptÚrstripr
   Úget_tokens_unprocessedÚreÚmatchÚstartr   r§  ÚstripZOutput)rÐ  rŠ  ZpylexerZtblexerZcurcodeZ
insertionsZcurtbZtbindexÚtbrß  ÚlineÚiÚtÚvr-   r-   r.   rÝ  ž  sh    
ÿ
ÿ
ÿ

ÿ

ÿ
z)PythonConsoleLexer.get_tokens_unprocessedN)	rp  rn  rr  ri  rX   r�  r�  r,  rÝ  r-   r-   r-   r.   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fd
e	j
dfde	j
fde	j
fde	j
dfdefgdeeejeeeeeƒfdeeejeeeƒfdeeeeƒeƒdfdeeeeƒfdee	jeeeƒdfdee	jeƒdfgdeeejeƒdfedƒgdœZdS )r   a   
    For Python 3.x tracebacks, with support for chained exceptions.

    .. versionadded:: 1.0

    .. versionchanged:: 2.5
       This is now the default ``PythonTracebackLexer``.  It is still available
       as the alias ``Python3TracebackLexer``.
    zPython TracebackZpytbZpy3tbz*.pytbz*.py3tbztext/x-python-tracebackztext/x-python3-tracebackr2   z'^Traceback \(most recent call last\):\nÚintbzH^During handling of the above exception, another exception occurred:\n\nzI^The above exception was the direct cause of the following exception:\n\nú^(?=  File "[^"]+", line \d+)ú^.*\nú0^(  File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)ú%^(  File )("[^"]+")(, line )(\d+)(\n)ú^(    )(.+)(\n)Úmarkersú^([ \t]*)(\.\.\.)(\n)ú^([^:]+)(: )(.+)(\n)rZ   z^([a-zA-Z_][\w.]*)(:?\n)z^( {4,})([~^]+)(\n))r„  rç  rí  N)rp  rn  rr  ri  rX   r�  rŽ  r�  r   r   Ú	Tracebackr   r   r   rœ  r   r   r   r   r   r   ÚMarkerr   r©  r-   r-   r-   r.   r   ×  sT   

ÿÿ
øÿÿÿ
ÿÿÿõþùçr   c                   @   sÚ   e Zd ZdZdZdgZdgZdgZdee	e
jƒdfde
jdfd	efgd
ee	eje	ee	ee	ƒfdee	eje	ee	ƒfdee	eeƒe	ƒdfdee	ee	ƒfdee
je	ee	ƒdfdee
je	ƒdfgdee	ejƒdfedƒgdœZdS )r   zÞ
    For Python tracebacks.

    .. versionadded:: 0.7

    .. versionchanged:: 2.5
       This class has been renamed from ``PythonTracebackLexer``.
       ``PythonTracebackLexer`` now refers to the Python 3 variant.
    zPython 2.x TracebackZpy2tbz*.py2tbztext/x-python2-tracebackz^(\^C)?(Traceback.*\n)rç  rè  ré  rê  rë  rì  Úmarkerrî  rï  rZ   z^([a-zA-Z_]\w*)(:?\n)z( {4,})(\^))r„  rç  rò  N)rp  rn  rr  ri  rX   r�  rŽ  r�  r   r   r   rð  r   r   rœ  r   r   r   r   r   r   rñ  r   r©  r-   r-   r-   r.   r     sD   
ÿ
ù
ÿÿÿ
ÿÿÿõýèr   c                !   @   sL  e Zd ZdZdZdZg d¢Zg d¢ZddgZde	fd	e
e	ejƒfd
e
e	ejƒfde	fdefdefde	fde	fdejfde
eejeƒfdefde
eejeeeeeƒfedƒde
ee	ƒdfde
ee	ƒdfde
eeƒfde
ee	ƒdfde
ee	ƒdfde
ee	ƒdfed ƒed!ƒd"ed#fd$ed%fd&ed'fd(ed)fd*eed+d#ƒfd,eed+d%ƒfd-eed+d'ƒfd.eed+d)ƒfed/ƒed0ƒged1d2d3�efd4ejfged5d6d2d7�ejfd8ejjfed9d6d2d7�ejfgd:ejfd;ejfd<ejfd=ejj fd>ejfgd?ej!fgd@ej"fdAefgdAej#dBfgdCej$fdDefdEe
ej#e	ƒdBfdFe
ej#e	eƒfdGedBfdHefdIedBfdJe	dBfdAejfdKe	fg
dAej%dBfgdLe
e	ee	ƒfdMej&fdNe
e	ee	ƒfe'dBƒgdOe
e	eƒdBfdPej&fe'dBƒgdQej(fgdRej)fdSefdTefdUefgdefgdVedBfdWej(fedXƒgdYedBfdZej(fedXƒgd[edBfedXƒed\ƒgd]edBfedXƒed\ƒgd^œZ*d_S )`r   zF
    For Pyrex and Cython source code.

    .. versionadded:: 1.1
    ZCythonzhttp://cython.org)ZcythonZpyxZpyrex)z*.pyxz*.pxdz*.pxiztext/x-cythonzapplication/x-cythonr2   z^(\s*)("""(?:.|\n)*?""")z^(\s*)('''(?:.|\n)*?''')rP   r6   rR   r7   r8   rS   z(<)([a-zA-Z0-9.?]+)(>)z!=|==|<<|>>|[-~+/*%=<>&^|.?]z(from)(\d+)(<=)(\s+)(<)(\d+)(:)r9   z(def|property)(\s+)r<   z(cp?def)(\s+)Úcdefz	(cdef)(:)z(class|struct)(\s+)r>   z(from)(\s+)r@   z(c?import)(\s+)rB   rU   r­  z(?:[rR]|[uU][rR]|[rR][uU])"""rJ   z(?:[rR]|[uU][rR]|[rR][uU])'''rK   z(?:[rR]|[uU][rR]|[rR][uU])"rL   z(?:[rR]|[uU][rR]|[rR][uU])'rM   z[uU]?"""rN   z[uU]?'''z[uU]?"z[uU]?'rX   rQ   )ri   rj   r\   rk   Zbyrl   Zctypedefrm   rn   r]   ro   zexcept?r®  rp   r^   ZfusedZgilrq   r_   r   r`   Znogilrr   r«   rs   ru   rv   rw   ra   rx   ry   rc   rd   z(DEF|IF|ELIF|ELSE)\b)Qr|   r}   r~   r   r¯  r°  r€   Zbintr�   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™   rš   r¸  r›   rœ   r�   rž   rŸ   r    r¹  r¡   r¢   r¤   r¥   r¦   r§   r¨   r©   rª   r¬   Z
Py_ssize_tr­   rº  r»  r¼  r®   r¯   r°   r±   r²   r³   r´   rµ   r¶   r·   r¸   r¹   rº   r½  r¾  Zunsignedr»   r¿  r¼   r½   r¾   z<(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|NULL)\b)0rÀ   rÁ   rÂ   rÃ   rÆ   rÇ   rÈ   rÉ   rÊ   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÒ   rÓ   rÔ   rÕ   rÖ   ÚNotImplementedr×   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ñ   z&(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?z0\d+rÅ  rÆ  z\d+rÇ  z@\w+rÈ  rZ   z%(public|readonly|extern|api|inline)\bz(struct|enum|union|class)\bz([a-zA-Z_]\w*)(\s*)(?=[(:#=]|$)z([a-zA-Z_]\w*)(\s*)(,)zfrom\brÉ  ú:z	(?=["\'])Ú.rw  rË  rx  z(\s+)(c?import)\brÌ  rÍ  zP%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]r«  r(   r¬  rz  r{  Ústringsr}  r~  r‚  Únlrƒ  )r„  r9   rU   rQ   r­  rX   r<   ró  r>   rB   r@   rN   r÷  rø  rL   rM   rJ   rK   N)+rp  rn  rr  ri  rX   rŒ  r�  rŽ  r�  r   r   r   r’  r   r   r   r—  r   ÚTyper   r¥  r   r   r	   r   ZPreprocrœ  r�  rÉ   r¡  r¢  r¤  rÎ  rÏ  r¦  rž  ÚReservedr§  r•  r   r¨  r*   r©  r-   r-   r-   r.   r   ?  s  ÿÿÿÝ&üûù
ôóÿòñï#
ûÿþ
ÿÿÿô
ÿüüÿÿÿùÿýýýý€ ár   c                   @   sz  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fdejfd	ejfd
ejfdejfdejfdeedddƒfdeedddƒfdeedddƒfdeedddƒfdefdejfdefedddd�ejfedddd�ejfdej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fd'efgd(ejfgd)ej fd*efd+efd,efd-efgd.ed/fgd0ed/fgd1ed/fgd2ed/fgd3œZ!d4S )5r    z�
    Lexer for dg,
    a functional and object-oriented programming language
    running on the CPython 3 VM.

    .. versionadded:: 1.6
    Zdgz*.dgz	text/x-dgr[   z#.*?$z(?i)0b[01]+z(?i)0o[0-7]+z(?i)0x[0-9a-f]+z((?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?z(?i)[+-]?[0-9]+e[+-]?\d+j?z(?i)[+-]?[0-9]+j?z(?i)(br|r?b?)'''rN   rK   Ústringz(?i)(br|r?b?)"""rJ   z(?i)(br|r?b?)'rM   z(?i)(br|r?b?)"rL   z`\w+'*`z\b(and|in|is|or|where)\bz[!$%&*+\-./:<-@\\^|~;,]+)r�   r‚   r„   r†   rˆ   rŠ   zdict'r�   r’   rš   rŸ   zlist'r£   r¦   r¬   r­   r±   zset'r³   rµ   r¶   r¸   r¹   ztuple'rº   r½   z
(?![\'\w])r¾   )=r|   r}   r~   r   r€   Úbindr…   r³  r‡   rˆ   r‰   r‹   rŒ   ZdropÚ	dropwhiler�   rŽ   Zexhaustr�   Zflipzfoldl1?r‘   Zfstr“   r”   r•   r–   Úheadr—   r˜   Úinitr™   r›   rœ   r�   ZiterateÚlastrž   r    r¡   r¢   r¤   r¥   r§   r¨   r©   rª   r«   r®   r¯   r°   r²   zscanl1?Zsndr´   r·   ÚtailÚtakeÚ	takewhiler»   r¼   z>(?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])z3(?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])zT(?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|SystemExit)(?!['\w])z_(?<![\w.])(except|finally|for|if|import|not|otherwise|raise|subclass|while|with|yield)(?!['\w])z[A-Z_]+'*(?!['\w])z[A-Z]\w+'*(?!['\w])z\w+'*z[()]rö  rÍ  rª  r«  r(   r¬  r2   rz  rZ   r}  r‚  rƒ  )r„  rN   rû  rL   rM   rJ   rK   N)"rp  rn  rr  ri  rX   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©  r-   r-   r-   r.   r    ó  sŠ   ûú	÷
öÿÿÿÿÊ9ÿÿÿøÿÿÿÿ°r    c                   @   s>   e Zd ZdZdZdZdgZg Zg Zh d£Z	dd„ Z
dd	„ Zd
S )r!   z[
    A Python lexer recognizing Numerical Python builtins.

    .. versionadded:: 0.10
    ZNumPyzhttps://numpy.org/Únumpy>‚  ÚfromfileÚidentityZ	newbufferZlexsortZintersect1dÚiterableZasarrayZpermutationÚequalÚrealÚunwrapZsometrueÚ	not_equalZcrossÚmaximumÚmodrÛ  ZputmaskÚfrexpZintersect1d_nuÚinvZcorrcoefZcolumn_stackZ	row_stackÚuniqueZreal_if_closeZ
atleast_3dZpoissonZexpand_dimsZset_numeric_opsZget_array_wrapÚdumpsZcovZswapaxesZ
left_shiftZdstackZapply_along_axisZtrue_divideZsetxor1dZamaxZfromfunctionÚsplitÚseedZitemsetZcan_castZpolymulZsqueezeÚsubtractZc_ZisscalarÚfabsZcompare_chararraysZmgridZsignbitZptpÚtanÚmeanÚemptyr°   ZnanmaxZdtypeZfromiterÚ
logical_orÚinnerZravelZfftfreqÚindicesÚ	conjugateZ	geterrobjZascontiguousarrayZalterdotZkaiserÚsourceZinterpZhammingÚzerosÚselectZbinomialZbitwise_notZ	isrealobjZarccosZ	isfortranÚsinr~   ZissubsctypeZ
asanyarrayZstdÚchooseZasarray_chkfiniteZmeshgridZarcsinÚtanhZfinfoZsolveZaverageÚmultiplyZ
frombufferZhanningÚlogical_xorÚitemZmatrixZ
nan_to_numZ
setbufsizeÚouterZ	ones_likeÚbyteswapZdiagZ	seterrobjÚinsertZset_string_functionZbitwise_andÚsinhZflatnonzeroÚputZargwhereZpinvZi0ZmsortZaminÚcopyÚdivider·   ÚrandintZgreater_equalr³   Zunravel_indexÚtypenameZasfarrayÚdotZarray_equalZ
atleast_2dÚloadZminimumZarcsinhÚinfoÚdiffZlogical_notZpolyZ	setdiff1dZget_printoptionsZ	nanargminZrintZissctypeZmedianÚuniformZdiagflatZseterrZargmaxZ	correlateZarray_equivZbmatZtriuZ
less_equalZhistogram2dÚbetaZr_ÚimagZ	transposeÚ
fromstringZright_shiftÚdeleteZogridÚalenZtypeDictZ
empty_likeZrandom_integersZix_ZsavetxtZcumsumZaroundZsincZargsortZbitwise_xorZbinary_reprÚlog10ÚmatÚisinfZastypeZ	tensordotZfixZunique1dÚcosZplaceZblackmanZ
cumproductZloadtxtZ
issubdtypeZrecarrayZ
trim_zerosÚviewZround_ZfliplrZgumbelZpolyvalZsctype2charÚwhereZ	histogramZlinspaceÚexpm1ÚhypotÚsortZrandom_sampleÚextractr  ZlessZarctanhZhstackZgradientZget_includeZunion1dÚ
accumulateÚceilÚisnanr¢   ZisposinfZstandard_normalZeyeZasscalarZvsplitZdiagonalZbyte_boundsZconcatenateÚtolistZsetfieldZconvolveZset_printoptionsZrankÚtofileÚrootsZnansumZhistogramddZcommon_typeZdigitizeÚdumpZfloor_divideZ	piecewiseZ
bitwise_orÚ	getbufferZallcloseZpolyderZonesZ	index_expZmay_share_memoryZndenumerateZ
frompyfuncZarray2stringZndindexZ
zeros_likeZtrapzZgetfieldZpolydivZgreaterÚisfiniteZ
arrayrangeÚndimZ	deprecateÚshapeZreshapeZhsplitZ
getbufsizer}   ZnonzeroZarray_splitÚsignZisneginfZbartlettÚprodÚtestZifftr¤   ZangleÚinfZsearchsortedZ
obj2sctyper„   Zs_ZalltrueZflatZgenericZtriZ
restoredotZnewbyteorderZ	vectorizeZmintypecodeZ	iscomplexZrollaxisÚlogÚarrayZisrealZarctan2ZargminZvanderÚfloorZpolysubZnanminÚsqrtZtileZapply_over_axesÚtostringZflipudZwhoÚabsoluteZdispZshow_configZ
array_reprÚ	remainderZranfÚsampleZdsplitÚloadsZrot90ZvstackZfftZbincountZkronZ	array_strÚresizeÚlog2r   Z	nanargmaxZweibullÚvarÚmodfÚinvertZpoly1dZsquareÚtraceZarccoshZsvdZfftshiftZvonmisesZissubclass_ZarangeZlstsqZvdotÚnegativeZgeterrZ
seterrcallÚlogical_andZpolyintÚ	broadcastÚcoshZget_numarray_includeZ
fromarraysÚpowerZ
reciprocalZasmatrixÚshuffleZediff1dÚsizeZasfortranarrayZrollÚaddZint_asbufferZsetflagsZpolyfitÚlog1pÚldexpÚfillZsort_complexÚflattenZnewaxisZ	base_reprÚexpZfastCopyAndTransposeÚrepeatZpkgloadZlogspacer»  ZcumprodÚrequireZtrilZ
atleast_1dZiscomplexobjZarctanÚproductZconjZsetmember1dÚcompressZpolyaddZ
geterrcallZget_numpy_includeZclipÚfmodÚnanZmaximum_sctypec                 c   sJ   t  | |¡D ]8\}}}|tu r8|| jv r8|tj|fV  q|||fV  qd S )N)r   rÝ  r   ÚEXTRA_KEYWORDSr   r�  )rÐ  rŠ  ÚindexÚtokenÚvaluer-   r-   r.   rÝ  ¨  s
    
ÿz!NumPyLexer.get_tokens_unprocessedc                 C   s.   | d d… }t | dƒsd|v o,d|v p,d|v S )Nr‡  r…  r†  zimport numpyzfrom numpy importrˆ  )rŠ  Últextr-   r-   r.   r‹  °  s    
ÿþzNumPyLexer.analyse_textN)rp  rn  rr  ri  rX   rŒ  r�  r�  rŽ  rt  rÝ  r‹  r-   r-   r-   r.   r!   V  s   Cr!   )-ri  rÞ  rš  Zpygments.lexerr   r   r   r   r   r   r   r	   r
   r   Zpygments.utilr   r   Zpygments.tokenr   r   r   r   r   r   r   r   r   r   r   Zpygmentsr   r�  Ú__all__r‡   r×  r   ZPython3Lexerr   r   r   ZPython3TracebackLexerr   r   r    r!   r-   r-   r-   r.   Ú<module>   s.   
04
    _X50 5c