403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/pygments/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/pygments/__pycache__/lexer.cpython-39.pyc
a

SҼa�z�@s�dZddlZddlZddlZddlmZmZddlmZddl	m
Z
mZmZm
Z
ddlmZmZmZmZmZmZddlmZgd�Zgd	�Zed
d��ZGdd
�d
e�ZGdd�ded�ZGdd�de�ZGdd�de�Z Gdd�d�Z!e!�Z"Gdd�de#�Z$Gdd�d�Z%dd�Z&Gdd�d�Z'e'�Z(dd �Z)Gd!d"�d"�Z*Gd#d$�d$e�Z+Gd%d&�d&e�Z,Gd'd(�d(ee,d�Z-Gd)d*�d*�Z.Gd+d,�d,e-�Z/d-d.�Z0Gd/d0�d0e,�Z1Gd1d2�d2e-e1d�Z2dS)3z�
    pygments.lexer
    ~~~~~~~~~~~~~~

    Base lexer classes.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
apply_filters�Filter)�get_filter_by_name)�Error�Text�Other�
_TokenType)�get_bool_opt�get_int_opt�get_list_opt�make_analysator�Future�guess_decode)�	regex_opt)�Lexer�
RegexLexer�ExtendedRegexLexer�DelegatingLexer�LexerContext�include�inherit�bygroups�using�this�default�words))s�utf-8)s��zutf-32)s��zutf-32be)s��zutf-16)s��zutf-16becCsdS)N����xrr�2/usr/lib/python3.9/site-packages/pygments/lexer.py�<lambda>!�r"c@seZdZdZdd�ZdS)�	LexerMetaz�
    This metaclass automagically converts ``analyse_text`` methods into
    static methods which always return float values.
    cCs(d|vrt|d�|d<t�||||�S)N�analyse_text)r�type�__new__)Zmcs�name�bases�drrr!r'*szLexerMeta.__new__N)�__name__�
__module__�__qualname__�__doc__r'rrrr!r$$sr$c@sZeZdZdZdZgZgZgZgZdZ	dd�Z
dd�Zdd	�Zd
d�Z
dd
d�Zdd�ZdS)ra�
    Lexer for a specific language.

    Basic options recognized:
    ``stripnl``
        Strip leading and trailing newlines from the input (default: True).
    ``stripall``
        Strip all leading and trailing whitespace from the input
        (default: False).
    ``ensurenl``
        Make sure that the input ends with a newline (default: True).  This
        is required for some lexers that consume input linewise.

        .. versionadded:: 1.3

    ``tabsize``
        If given and greater than 0, expand tabs in the input (default: 0).
    ``encoding``
        If given, must be an encoding name. This encoding will be used to
        convert the input string to Unicode, if it is not already a Unicode
        string (default: ``'guess'``, which uses a simple UTF-8 / Locale /
        Latin1 detection.  Can also be ``'chardet'`` to use the chardet
        library, if it is installed.
    ``inencoding``
        Overrides the ``encoding`` if given.
    NrcKs�||_t|dd�|_t|dd�|_t|dd�|_t|dd�|_|�dd	�|_|�d
�pZ|j|_g|_	t
|dd�D]}|�|�qpdS)
N�stripnlT�stripallF�ensurenl�tabsizer�encoding�guessZ
inencoding�filtersr)�optionsr	r/r0r1r
r2�getr3r5r�
add_filter)�selfr6�filter_rrr!�__init__^szLexer.__init__cCs(|jrd|jj|jfSd|jjSdS)Nz<pygments.lexers.%s with %r>z<pygments.lexers.%s>)r6�	__class__r+�r9rrr!�__repr__js
�zLexer.__repr__cKs*t|t�st|fi|��}|j�|�dS)z8
        Add a new stream filter to this lexer.
        N)�
isinstancerrr5�append)r9r:r6rrr!r8qs
zLexer.add_filtercCsdS)a~
        Has to return a float between ``0`` and ``1`` that indicates
        if a lexer wants to highlight this text. Used by ``guess_lexer``.
        If this method returns ``0`` it won't highlight it in any case, if
        it returns ``1`` highlighting with this lexer is guaranteed.

        The `LexerMeta` metaclass automatically wraps this function so
        that it works like a static method (no ``self`` or ``cls``
        parameter) and the return value is automatically converted to
        `float`. If the return value is an object that is boolean `False`
        it's the same as if the return values was ``0.0``.
        Nr)�textrrr!r%yszLexer.analyse_textFc
s�t�t�s��jdkr"t��\�}nڈjdkr�zddl}Wn.tyf}ztd�|�WYd}~n
d}~00d}tD].\}}��|�rp�t|�d��	|d�}q�qp|dur�|�
�dd��}	��	|	�d�p�d	d�}|�n&��	�j����d
�r��td
�d��n��d
��r�td
�d����dd����d
d���j
�rD����n�j�rV��d���jdk�rn���j���j�r���d��s��d7���fdd�}
|
�}|�s�t|�j��}|S)a=
        Return an iterable of (tokentype, value) pairs generated from
        `text`. If `unfiltered` is set to `True`, the filtering mechanism
        is bypassed even if filters are defined.

        Also preprocess the text, i.e. expand tabs and strip it if
        wanted and applies registered filters.
        r4�chardetrNzkTo enable chardet encoding guessing, please install the chardet library from http://chardet.feedparser.org/�replaceir3ruz
�
�
c3s$����D]\}}}||fVq
dS�N)�get_tokens_unprocessed)�_�t�v�r9rArr!�streamer�sz"Lexer.get_tokens.<locals>.streamer)r?�strr3rrB�ImportError�
_encoding_map�
startswith�len�decodeZdetectr7rCr0�stripr/r2�
expandtabsr1�endswithrr5)r9rAZ
unfilteredrHrB�eZdecodedZbomr3�encrL�streamrrKr!�
get_tokens�sR	


�
�


zLexer.get_tokenscCst�dS)z�
        Return an iterable of (index, tokentype, value) pairs where "index"
        is the starting position of the token within the input text.

        In subclasses, implement this method as a generator to
        maximize effectiveness.
        N)�NotImplementedErrorrKrrr!rG�szLexer.get_tokens_unprocessed)F)r+r,r-r.r(�aliases�	filenamesZalias_filenamesZ	mimetypes�priorityr;r>r8r%rYrGrrrr!r0s
;r)�	metaclassc@s$eZdZdZefdd�Zdd�ZdS)ra 
    This lexer takes two lexer as arguments. A root lexer and
    a language lexer. First everything is scanned using the language
    lexer, afterwards all ``Other`` tokens are lexed using the root
    lexer.

    The lexers from the ``template`` lexer package use this base lexer.
    cKs<|fi|��|_|fi|��|_||_tj|fi|��dSrF)�
root_lexer�language_lexer�needlerr;)r9Z_root_lexerZ_language_lexerZ_needler6rrr!r;�szDelegatingLexer.__init__cCs�d}g}g}|j�|�D]H\}}}||jurP|rF|�t|�|f�g}||7}q|�|||f�q|rx|�t|�|f�t||j�|��S)N�)r`rGrar@rQ�
do_insertionsr_)r9rAZbuffered�
insertionsZ
lng_buffer�irIrJrrr!rG�s


�z&DelegatingLexer.get_tokens_unprocessedN)r+r,r-r.rr;rGrrrr!r�s	rc@seZdZdZdS)rzI
    Indicates that a state should include rules from another state.
    N�r+r,r-r.rrrr!r�src@seZdZdZdd�ZdS)�_inheritzC
    Indicates the a state should inherit from its superclass.
    cCsdS)Nrrr=rrr!r>�sz_inherit.__repr__N)r+r,r-r.r>rrrr!rg�srgc@s eZdZdZdd�Zdd�ZdS)�combinedz:
    Indicates a state combined from multiple states.
    cGst�||�SrF)�tupler')�cls�argsrrr!r'
szcombined.__new__cGsdSrFr)r9rkrrr!r;
szcombined.__init__N)r+r,r-r.r'r;rrrr!rhsrhc@sFeZdZdZdd�Zddd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dS)�_PseudoMatchz:
    A pseudo match object constructed from a string.
    cCs||_||_dSrF)�_text�_start)r9�startrArrr!r;sz_PseudoMatch.__init__NcCs|jSrF)rn�r9�argrrr!rosz_PseudoMatch.startcCs|jt|j�SrF)rnrQrmrprrr!�endsz_PseudoMatch.endcCs|rtd��|jS)Nz
No such group)�
IndexErrorrmrprrr!�group!sz_PseudoMatch.groupcCs|jfSrF)rmr=rrr!�groups&sz_PseudoMatch.groupscCsiSrFrr=rrr!�	groupdict)sz_PseudoMatch.groupdict)N)N)N)
r+r,r-r.r;rorrrtrurvrrrr!rls


rlcsd�fdd�	}|S)zL
    Callback that yields multiple actions for each group in the match.
    Nc3s�t��D]�\}}|durqqt|�turR|�|d�}|r�|�|d�||fVq|�|d�}|dur|r||�|d�|_||t|�|d�|�|�D]}|r�|Vq�q|r�|��|_dS)N�)�	enumerater&rrtro�posrlrr)�lexer�match�ctxre�action�data�item�rkrr!�callback1s$�
zbygroups.<locals>.callback)Nr)rkr�rr�r!r-src@seZdZdZdS)�_ThiszX
    Special singleton used for indicating the caller class.
    Used by ``using``.
    Nrfrrrr!r�Gsr�csji�d�vr:��d�}t|ttf�r.|�d<nd|f�d<�turTd��fdd�	}nd	���fdd�	}|S)
a�
    Callback that processes the match with a different lexer.

    The keyword arguments are forwarded to the lexer, except `state` which
    is handled separately.

    `state` specifies the state that the new lexer will start in, and can
    be an enumerable such as ('root', 'inline', 'string') or a simple
    string which is assumed to be on top of the root state.

    Note: For that to work, `_other` must not be an `ExtendedRegexLexer`.
    �state�stack�rootNc3sr�r"��|j�|jfi���}n|}|��}|j|��fi���D]\}}}||||fVqD|rn|��|_dSrF)�updater6r<rorGrtrrry�rzr{r|Zlx�srerIrJ)�	gt_kwargs�kwargsrr!r�fs zusing.<locals>.callbackc3sf��|j��fi���}|��}|j|��fi���D]\}}}||||fVq8|rb|��|_dSrF)r�r6rorGrtrrryr���_otherr�r�rr!r�us )N)N)�popr?�listrir)r�r�r�r�rr�r!rPs



rc@seZdZdZdd�ZdS)rz�
    Indicates a state or state action (e.g. #pop) to apply.
    For example default('#pop') is equivalent to ('', Token, '#pop')
    Note that state tuples may be used as well.

    .. versionadded:: 2.0
    cCs
||_dSrF)r�)r9r�rrr!r;�szdefault.__init__N)r+r,r-r.r;rrrr!r�src@s"eZdZdZddd�Zdd�ZdS)	rz�
    Indicates a list of literal words that is transformed into an optimized
    regex that matches any of the words.

    .. versionadded:: 2.0
    rbcCs||_||_||_dSrF)r�prefix�suffix)r9rr�r�rrr!r;�szwords.__init__cCst|j|j|jd�S)N�r�r�)rrr�r�r=rrr!r7�sz	words.getN)rbrb)r+r,r-r.r;r7rrrr!r�s
rc@sJeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
d
S)�RegexLexerMetazw
    Metaclass for RegexLexer, creates the self._tokens attribute from
    self.tokens on the first instantiation.
    cCs t|t�r|��}t�||�jS)zBPreprocess the regular expression component of a token definition.)r?r
r7�re�compiler{)rj�regex�rflagsr�rrr!�_process_regex�s
zRegexLexerMeta._process_regexcCs&t|�tus"t|�s"Jd|f��|S)z5Preprocess the token component of a token definition.z2token type must be simple type or callable, not %r)r&r�callable)rj�tokenrrr!�_process_token�s�zRegexLexerMeta._process_tokencCst|t�rd|dkrdS||vr$|fS|dkr0|S|dd�dkrRt|dd��SdsbJd|��n�t|t�r�d	|j}|jd
7_g}|D],}||ks�Jd|��|�|�|||��q�|||<|fSt|t��r|D] }||vs�|dvs�Jd
|��q�|Sd�sJd|��dS)z=Preprocess the state transition action of a token definition.�#pop����#pushN�z#pop:Fzunknown new state %rz_tmp_%drwzcircular state ref %r)r�r�zunknown new state zunknown new state def %r)r?rM�intrh�_tmpname�extend�_process_stateri)rj�	new_state�unprocessed�	processedZ	tmp_state�itokensZistaterrr!�_process_new_state�s<



���z!RegexLexerMeta._process_new_statecCs�t|�tusJd|��|ddks0Jd|��||vr@||Sg}||<|j}||D�]0}t|t�r�||ks~Jd|��|�|�||t|���qZt|t�r�qZt|t�r�|�	|j
||�}|�t�
d�jd|f�qZt|�tus�Jd|��z|�|d||�}Wn@t�yF}	z&td	|d|||	f�|	�WYd}	~	n
d}	~	00|�|d
�}
t|�dk�rjd}n|�	|d||�}|�||
|f�qZ|S)z%Preprocess a single state definition.zwrong state name %rr�#zinvalid state name %rzcircular state reference %rrbNzwrong rule def %rz+uncompilable regex %r in state %r of %r: %srw�)r&rM�flagsr?rr�r�rgrr�r�r@r�r�r{rir��	Exception�
ValueErrorr�rQ)rjr�r�r��tokensr�Ztdefr��rex�errr�rrr!r��sH
�

��
�zRegexLexerMeta._process_stateNcCs<i}|j|<|p|j|}t|�D]}|�|||�q$|S)z-Preprocess a dictionary of token definitions.)�_all_tokensr�r�r�)rjr(�	tokendefsr�r�rrr!�process_tokendef�s
zRegexLexerMeta.process_tokendefc

Cs�i}i}|jD]�}|j�di�}|��D]�\}}|�|�}|durz|||<z|�t�}WntynYq(Yn0|||<q(|�|d�}|dur�q(||||d�<z|�t�}	Wnty�Yq(0||	||<q(q|S)a
        Merge tokens from superclasses in MRO order, returning a single tokendef
        dictionary.

        Any state that is not defined by a subclass will be inherited
        automatically.  States that *are* defined by subclasses will, by
        default, override that state in the superclass.  If a subclass wishes to
        inherit definitions from a superclass, it can use the special value
        "inherit", which will cause the superclass' state definition to be
        included at that point in the state.
        r�Nrw)�__mro__�__dict__r7�items�indexrr�r�)
rjr�Zinheritable�cZtoksr�r�ZcuritemsZinherit_ndxZnew_inh_ndxrrr!�
get_tokendefss0


zRegexLexerMeta.get_tokendefscOsRd|jvr:i|_d|_t|d�r(|jr(n|�d|���|_tj	|g|�Ri|��S)z:Instantiate cls after preprocessing its token definitions.�_tokensr�token_variantsrb)
r�r�r��hasattrr�r�r�r�r&�__call__)rjrk�kwdsrrr!r�8s
zRegexLexerMeta.__call__)N)r+r,r-r.r�r�r�r�r�r�r�rrrr!r��s#,
1r�c@s$eZdZdZejZiZddd�ZdS)rz�
    Base for simple stateful regular expression-based lexers.
    Simplifies the lexing process so that you need only
    provide a list of states and regular expressions.
    �r�ccs�d}|j}t|�}||d}|D�](\}}}	|||�}
|
r"|durrt|�turb|||
��fVn|||
�EdH|
��}|	du�rHt|	t�r�|	D]D}|dkr�t|�dkr�|�	�q�|dkr�|�
|d�q�|�
|�q�nbt|	t��rt|	�t|�k�r|dd�=n
||	d�=n,|	dk�r*|�
|d�nd�s<Jd|	��||d}qq"zP||d	k�r�d
g}|d
}|t
d	fV|d7}Wq|t||fV|d7}Wqt�y�Y�q�Yq0qdS)z}
        Split ``text`` into (tokentype, text) pairs.

        ``stack`` is the inital stack (default: ``['root']``)
        rr�Nr�rwr�F�wrong state def: %rrDr�)r�r�r&rrtrrr?rirQr�r@r��absrrrs)r9rAr�ryr�Z
statestack�statetokens�rexmatchr}r��mr�rrr!rGdsR




z!RegexLexer.get_tokens_unprocessedN)r�)	r+r,r-r.r��	MULTILINEr�r�rGrrrr!rFsrc@s"eZdZdZddd�Zdd�ZdS)rz9
    A helper object that holds lexer position data.
    NcCs*||_||_|pt|�|_|p"dg|_dS)Nr�)rAryrQrrr�)r9rAryr�rrrrr!r;�szLexerContext.__init__cCsd|j|j|jfS)NzLexerContext(%r, %r, %r))rAryr�r=rrr!r>�s�zLexerContext.__repr__)NN)r+r,r-r.r;r>rrrr!r�s
rc@seZdZdZddd�ZdS)rzE
    A RegexLexer that uses a context object to store its state.
    Nccs:|j}|st|d�}|d}n|}||jd}|j}|D�]`\}}}|||j|j�}	|	r:|dur�t|�tur�|j||	��fV|	��|_n$|||	|�EdH|s�||jd}|du�r�t	|t
��r|D]P}
|
dkr�t|j�dkr�|j��q�|
dk�r|j�
|jd�q�|j�
|
�q�nlt	|t��rZt|�t|j�k�rL|jdd�=n|j|d�=n0|dk�rx|j�
|jd�nd�s�Jd	|��||jd}q6q:zz|j|jk�r�W�q6||jd
k�r�dg|_|d}|jtd
fV|jd7_Wq6|jt||jfV|jd7_Wq6t�y2Y�q6Yq60q6dS)z
        Split ``text`` into (tokentype, text) pairs.
        If ``context`` is given, use this lexer context instead.
        rr�r�Nr�rwr�Fr�rD)r�rr�rAryrrr&rrtr?rirQr�r@r�r�r�rrrs)r9rA�contextr�r|r�r�r}r�r�r�rrr!rG�s`




z)ExtendedRegexLexer.get_tokens_unprocessed)NN)r+r,r-r.rGrrrr!r�src	cs�t|�}zt|�\}}Wnty6|EdHYdS0d}d}|D]�\}}}|durZ|}d}	|�r|t|�|k�r||	||�}
|
r�|||
fV|t|
�7}|D]"\}}}
|||
fV|t|
�7}q�||}	zt|�\}}Wq^t�yd}Y�qYq^0q^|	t|�krD||||	d�fV|t|�|	7}qD|�r�|�pDd}|D]$\}}}|||fV|t|�7}�qJzt|�\}}Wnt�y�d}Y�q�Yn0�q6dS)ag
    Helper for lexers which must combine the results of several
    sublexers.

    ``insertions`` is a list of ``(index, itokens)`` pairs.
    Each ``itokens`` iterable should be inserted at position
    ``index`` into the token stream given by the ``tokens``
    argument.

    The result is a combined token stream.

    TODO: clean up the code here.
    NTrF)�iter�next�
StopIterationrQ)rdr�r�r�ZrealposZinsleftrerIrJZoldiZtmpvalZit_indexZit_tokenZit_value�prrr!rc�sN

rcc@seZdZdZdd�ZdS)�ProfilingRegexLexerMetaz>Metaclass for ProfilingRegexLexer, collects regex timing info.csLt|t�r t|j|j|jd��n|�t��|��tjf����fdd�	}|S)Nr�cs`�jd���fddg�}t��}��|||�}t��}|dd7<|d||7<|S)Nr�rrrw)�
_prof_data�
setdefault�timer{)rAry�endpos�infoZt0�res�t1�rjZcompiledr�r�rr!�
match_funcEsz:ProfilingRegexLexerMeta._process_regex.<locals>.match_func)	r?rrr�r�r�r��sys�maxsize)rjr�r�r�r�rr�r!r�=s

�z&ProfilingRegexLexerMeta._process_regexN)r+r,r-r.r�rrrr!r�:sr�c@s"eZdZdZgZdZddd�ZdS)�ProfilingRegexLexerzFDrop-in replacement for RegexLexer that does profiling of its regexes.�r�c#s��jj�i�t��||�EdH�jj��}tdd�|��D��fdd�dd�}tdd�|D��}t	�t	d�jj
t|�|f�t	d	�t	d
d�t	d�|D]}t	d
|�q�t	d	�dS)NcssN|]F\\}}\}}|t|��d��dd�dd�|d|d||fVqdS)zu'z\\�\N�Ai�)�reprrSrC)�.0r��r�nrIrrr!�	<genexpr>[s��z=ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<genexpr>cs
|�jSrF)�_prof_sort_indexrr=rr!r"^r#z<ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<lambda>T)�key�reversecss|]}|dVqdS)�Nr)r�r rrr!r�`r#z2Profiling result for %s lexing %d chars in %.3f mszn==============================================================================================================z$%-20s %-64s ncalls  tottime  percall)r�r�zn--------------------------------------------------------------------------------------------------------------z%-20s %-65s %5d %8.4f %8.4f)r<r�r@rrGr��sortedr��sum�printr+rQ)r9rAr�Zrawdatar~Z	sum_totalr*rr=r!rGVs(�
��z*ProfilingRegexLexer.get_tokens_unprocessedN)r�)r+r,r-r.r�r�rGrrrr!r�Psr�)3r.r�r�r�Zpygments.filterrrZpygments.filtersrZpygments.tokenrrrrZ
pygments.utilr	r
rrr
rZpygments.regexoptr�__all__rO�staticmethodZ_default_analyser&r$rrrMrrgrrirhrlrr�rrrrr�rrrrcr�r�rrrr!�<module>sD
 '
2)\H@

Youez - 2016 - github.com/yon3zu
LinuXploit