| 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 : /usr/lib/python3/dist-packages/prompt_toolkit/lexers/__pycache__/ |
Upload File : |
�
�Ïc�. � �t � d Z ddlZddlmZmZ ddlmZmZmZm Z m
Z
mZmZm
Z
ddlmZ ddlmZmZ ddlmZ ddlmZ dd lmZ d
dlmZmZ erddlmZ g d
�Z G d� de�� � Z G d� de� � Z G d� de� � Z! G d� deee"df e"f � � Z# e#� � Z$ G d� 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 � e Zd ZdZedededeeef fd�� � ZdS )r a
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� ��selfr r s �@/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__r r
�intr r$ r r% r# r r '