403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.25
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/prompt_toolkit/lexers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/prompt_toolkit/lexers/__pycache__/pygments.cpython-311.pyc
�

�Ïc�.��t�dZddlZddlmZmZddlmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZmZddlmZddlmZdd	lmZd
dlmZmZerddlmZgd
�ZGd�de���ZGd�de��Z Gd�de��Z!Gd�deee"dfe"f��Z#e#��Z$Gd�de��Z%dS)z�
Adaptor classes for using Pygments lexers within prompt_toolkit.

This includes syntax synchronization code, so that we don't have to start
lexing at the beginning of a document, when displaying a very large text.
�N)�ABCMeta�abstractmethod)�
TYPE_CHECKING�Callable�Dict�	Generator�Iterable�Optional�Tuple�Type)�Document)�FilterOrBool�	to_filter)�StyleAndTextTuples)�split_lines��pygments_token_to_classname�)�Lexer�SimpleLexer)r)�
PygmentsLexer�
SyntaxSync�
SyncFromStart�	RegexSyncc	�F�eZdZdZedededeeeffd���ZdS)ra
    Syntax synchroniser. This is a tool that finds a start position for the
    lexer. This is especially important when editing big documents; we don't
    want to start the highlighting by running the lexer from the beginning of
    the file. That is very slow when editing.
    �document�lineno�returnc��dS)a/
        Return the position from where we can start lexing as a (row, column)
        tuple.

        :param document: `Document` instance that contains all the lines.
        :param lineno: The line that we want to highlight. (We need to return
            this line, or an earlier position.)
        N���selfrrs   �@/usr/lib/python3/dist-packages/prompt_toolkit/lexers/pygments.py�get_sync_start_positionz"SyntaxSync.get_sync_start_position/s����N)	�__name__�
__module__�__qualname__�__doc__rr
�intrr$r r%r#rr's^���������
� �
�*-�
�	�s�C�x��
�
�
��^�
�
�
r%r)�	metaclassc�6�eZdZdZdededeeeffd�ZdS)rzB
    Always start the syntax highlighting from the beginning.
    rrrc��dS)N�rrr r!s   r#r$z%SyncFromStart.get_sync_start_positionBs	���tr%N)r&r'r(r)r
r*rr$r r%r#rr=sR��������� ��*-��	�s�C�x�������r%rc�f�eZdZdZdZdZdeddfd�Zded	e	de
e	e	ffd
�Zedd
���Z
dS)rzQ
    Synchronize by starting at a line that matches the given regex pattern.
    i��d�patternrNc�8�tj|��|_dS)N)�re�compile�_compiled_pattern)r"r1s  r#�__init__zRegexSync.__init__Us��!#��G�!4�!4����r%rrc��|j}|j}t|td||jz
��d��D]7}|�||��}|r||���fcS�8||jkrdS|dfS)zH
        Scan backwards, and find a possible position to start.
        ���r.r)r5�lines�range�max�
MAX_BACKWARDS�match�start�FROM_START_IF_NO_SYNC_POS_FOUND)r"rrr1r9�ir=s       r#r$z!RegexSync.get_sync_start_positionXs����(������v�s�2�v��0B�'B�C�C�R�H�H�	(�	(�A��M�M�%��(�+�+�E��
(��%�+�+�-�-�'�'�'�'�
(��D�8�8�8��4��1�9�r%�	lexer_cls�PygmentsLexerClsc�\�ddddd�}|�|jd��}||��S)zV
        Create a :class:`.RegexSync` instance for this Pygments lexer class.
        z^\s*(class|def)\s+z
<[/a-zA-Z]z\bfunction\b)�PythonzPython 3�HTML�
JavaScript�^)�get�name)�clsrA�patterns�ps    r#�from_pygments_lexer_clsz!RegexSync.from_pygments_lexer_clsps@��,�-�!�)�

�

��
�L�L����-�-���s�1�v�v�
r%)rArBrr)r&r'r(r)r<r?�strr6r
r*rr$�classmethodrMr r%r#rrHs����������M�'*�#�5��5��5�5�5�5�� ��*-��	�s�C�x������0�����[���r%rc�2�eZdZdZdeedfdefd�ZdS)�_TokenCachez�
    Cache that converts Pygments tokens into `prompt_toolkit` style objects.

    ``Token.A.B.C`` will be converted into:
    ``class:pygments,pygments.A,pygments.A.B,pygments.A.B.C``
    �key.rc�4�dt|��z}|||<|S)Nzclass:r)r"rR�results   r#�__missing__z_TokenCache.__missing__�s#���7��<�<�<����S�	��
r%N)r&r'r(r)rrNrUr r%r#rQrQ�sH���������u�S�#�X���3������r%rQ.c	��eZdZdZdZdZ		ddedded	ee	d
dfd�Z
e	ddeded
d
fd���Z
ded
eegeffd�ZdS)ra�
    Lexer that calls a pygments lexer.

    Example::

        from pygments.lexers.html import HtmlLexer
        lexer = PygmentsLexer(HtmlLexer)

    Note: Don't forget to also load a Pygments compatible style. E.g.::

        from prompt_toolkit.styles.from_pygments import style_from_pygments_cls
        from pygments.styles import get_style_by_name
        style = style_from_pygments_cls(get_style_by_name('monokai'))

    :param pygments_lexer_cls: A `Lexer` from Pygments.
    :param sync_from_start: Start lexing at the start of the document. This
        will always give the best results, but it will be slow for bigger
        documents. (When the last part of the document is display, then the
        whole document will be lexed by Pygments on every key stroke.) It is
        recommended to disable this for inputs that are expected to be more
        than 1,000 lines.
    :param syntax_sync: `SyntaxSync` object.
    �2r0TN�pygments_lexer_clsrB�sync_from_start�syntax_syncrc��||_t|��|_|ddd���|_|pt�|��|_dS)NF)�stripnl�stripall�ensurenl)rXrrY�pygments_lexerrrMrZ)r"rXrYrZs    r#r6zPygmentsLexer.__init__�si��#5���(��9�9���1�0��E�E�
�
�
���
'�
�)�*K�*K��+
�+
����r%�filenamerc��ddlm}ddlm}	||��}||j|���S#|$rt��cYSwxYw)z3
        Create a `Lexer` from a filename.
        r)�get_lexer_for_filename)�
ClassNotFound)rY)�pygments.lexersrb�
pygments.utilrc�	__class__r)rJr`rYrbrcr_s      r#�
from_filenamezPygmentsLexer.from_filename�s���	;�:�:�:�:�:�/�/�/�/�/�/�	R�3�3�H�=�=�N��3�~�/��Q�Q�Q�Q���	!�	!�	!��=�=� � � �	!���s�+�A�Arc�@��������	�ttttfddf}i�i�	dtf�fd��dtdt
|f�	�fd��ddtdtd|f��fd	�
�dtd|f�����	�fd
��dtdtf���	fd�}|S)
z�
        Create a lexer function that takes a line number and returns the list
        of (style_str, text) tuples as the Pygments lexer returns for that line.
        Nrc�V������rt��S�jS)z8The Syntax synchronisation object that we currently use.)rYrrZ)r"s�r#�get_syntax_syncz3PygmentsLexer.lex_document.<locals>.get_syntax_sync�s*����#�#�%�%�
(�$���&��'�'r%r@c�l������D]\}}||kr||z
�jkr|cS�dS)z@Return a generator close to line 'i', or None if none was found.N)�items�REUSE_GENERATOR_MAX_DISTANCE)r@�	generatorr�line_generatorsr"s   ��r#�find_closest_generatorz:PygmentsLexer.lex_document.<locals>.find_closest_generator�sO���%4�%:�%:�%<�%<�
%�
%�!�	�6��A�:�:�!�f�*�t�/P�"P�"P�$�$�$�$���4r%r�start_lineno�columnc3�����K�dttttff����fd�}tt	t|���������Ed{V��dS)z�
            Create a generator that yields the lexed lines.
            Each iteration it yields a (line_number, [(style_str, text), ...]) tuple.
            rc3���K�d��j�d����d�}�j�|��D]\}}}t||fV��dS)N�
)�joinr9r_�get_tokens_unprocessed�_token_cache)�text�_�t�vrrrr"rqs    ����r#�get_text_fragmentszUPygmentsLexer.lex_document.<locals>.create_line_generator.<locals>.get_text_fragmentssx������y�y����
�
�!>�?�?����H�� $�2�I�I�$�O�O�-�-�G�A�q�!�'�q�/�1�,�,�,�,�,�-�-r%N)r	rrN�	enumerater�list)rqrrr}rr"s`` ��r#�create_line_generatorz9PygmentsLexer.lex_document.<locals>.create_line_generator�s��������

-���s�C�x��(A�

-�

-�

-�

-�

-�

-�

-�

-�

-�!��T�2D�2D�2F�2F�-G�-G�!H�!H�,�W�W�W�W�W�W�W�W�W�W�Wr%c����|��}|r|Std|�	jz
��}|dkrd}d}n!�����|��\}}�|��}|r|S�||��}|rt|��|dz
}|�|<|S)z_
            Find an already started generator that is close, or create a new one.
            rr)r;�MIN_LINES_BACKWARDSr$�next)
r@rn�rowrrr�rrprjror"s
    ������r#�
get_generatorz1PygmentsLexer.lex_document.<locals>.get_generators����
/�.�q�1�1�I��
!� � ��A�q�4�3�3�4�4�A��A�v�v������-�o�/�/�G�G��RS�T�T���V�/�.�q�1�1�I��
?� � �1�1�#�v�>�>�	�
�
��Y�����q���),�O�I�&��r%c���	�|S#t$r?�|��}|D].\}}|�|<||kr|�|<|dz�vr�|dz=�|ccYS�/YnwxYwgS)z*Return the tokens for a given line number.r)�KeyError)r@rn�num�line�cacher�ros    ���r#�get_linez,PygmentsLexer.lex_document.<locals>.get_line7s����
*��Q�x����
*�
*�
*�)�M�!�,�,�	�"+�
*�
*�I�C��!%�E�#�J��a�x�x�56��	�2���7�e�+�+� %�c�A�g��$�S�z�)�)�)�)�)� �
*�
*�	
*����$�Is��AA�A�A)r)rrr*rrr
)
r"r�
LineGeneratorr�r�r�rpr�rjros
``  @@@@@@r#�lex_documentzPygmentsLexer.lex_document�s]����������
"�%��-?�(?�"@�$��"L�M�
�02��57��	(��	(�	(�	(�	(�	(�	(�	�c�	�h�}�.E�	�	�	�	�	�	�	�	X�	X��	X�S�	X��	X�	X�	X�	X�	X�	X�	X�(%	�S�%	�]�%	�%	�%	�%	�%	�%	�%	�%	�%	�%	�%	�N	��	� 2�	�	�	�	�	�	�	�	�0�r%)TN)T)r&r'r(r)r�rmrrr
rr6rOrNrgr
rr*rr�r r%r#rr�s���������:��
$'� �
)-�,0�	
�
� �!3�4�
�&�
��j�)�	
�

�
�
�
�
�(�<@�R�R��R�-9�R�	�R�R�R��[�R�"o�X�o�(�C�5�BT�;T�2U�o�o�o�o�o�or%r)&r)r3�abcrr�typingrrrrr	r
rr�prompt_toolkit.documentr
�prompt_toolkit.filtersrr�"prompt_toolkit.formatted_text.baser�#prompt_toolkit.formatted_text.utilsr�prompt_toolkit.styles.pygmentsr�baserr�pygments.lexerrB�__all__rrrrNrQrxrr r%r#�<module>r�sF����
�	�	�	�'�'�'�'�'�'�'�'�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�-�,�,�,�,�,�:�:�:�:�:�:�:�:�A�A�A�A�A�A�;�;�;�;�;�;�F�F�F�F�F�F�$�$�$�$�$�$�$�$��9�8�8�8�8�8�8����������7�����,�����J����9�9�9�9�9�
�9�9�9�x�����$�u�S�#�X���+�,�����{�}�}��z�z�z�z�z�E�z�z�z�z�zr%

Youez - 2016 - github.com/yon3zu
LinuXploit