Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/lexers/__pycache__/base.cpython-39.pyc
Ðазад
a d�h. � @ s� d Z ddlmZ ddlmZmZ ddlmZmZ ddl m Z ddlmZ g d�Z G dd � d ed �ZG dd� de�ZG d d� de�ZdS )z) Base classes for prompt_toolkit lexers. � )�annotations)�ABCMeta�abstractmethod)�Callable�Hashable)�Document)�StyleAndTextTuples)�Lexer�SimpleLexer�DynamicLexerc @ s2 e Zd ZdZeddd�dd��Zdd�d d �ZdS )r z$ Base class for all lexers. r �#Callable[[int], StyleAndTextTuples]��document�returnc C s dS )aT Takes a :class:`~prompt_toolkit.document.Document` and returns a callable that takes a line number and returns a list of ``(style_str, text)`` tuples for that line. XXX: Note that in the past, this was supposed to return a list of ``(Token, text)`` tuples, just like a Pygments lexer. N� )�selfr r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/lexers/base.py�lex_document s zLexer.lex_documentr �r c C s t | �S )zz When this changes, `lex_document` could give a different output. (Only used for `DynamicLexer`.) )�id)r r r r �invalidation_hash$ s zLexer.invalidation_hashN)�__name__� __module__�__qualname__�__doc__r r r r r r r r s r )� metaclassc @ s2 e Zd ZdZdddd�dd�Zdd d �dd�Zd S )r z� Lexer that doesn't do any tokenizing and returns the whole input as one token. :param style: The style string for this lexer. � �str�None)�styler c C s || _ d S �N)r )r r r r r �__init__4 s zSimpleLexer.__init__r r r c s |j � ddd�� �fdd�}|S )N�intr )�linenor c s. z�j � | fgW S ty( g Y S 0 dS )z%Return the tokens for the given line.N)r � IndexError)r# ��linesr r r �get_line: s z*SimpleLexer.lex_document.<locals>.get_line)r&