Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/contrib/regular_languages/__pycache__/lexer.cpython-39.pyc
Ðазад
a d�hW � @ sr d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ dd l mZ d gZG dd � d e�ZdS ) z� `GrammarLexer` is compatible with other lexers and can be used to highlight the input using a regular grammar with annotations. � )�annotations)�Callable)�Document)�StyleAndTextTuples)�split_lines)�Lexer� )�_CompiledGrammar�GrammarLexerc @ sF e Zd ZdZdddddd�d d �Zddd�d d�Zddd�dd�ZdS )r a� Lexer which can be used for highlighting of fragments according to variables in the grammar. (It does not actual lexing of the string, but it exposes an API, compatible with the Pygments lexer class.) :param compiled_grammar: Grammar as returned by the `compile()` function. :param lexers: Dictionary mapping variable names of the regular grammar to the lexers that should be used for this part. (This can call other lexers recursively.) If you wish a part of the grammar to just get one fragment, use a `prompt_toolkit.lexers.SimpleLexer`. � Nr �strzdict[str, Lexer] | None�None)�compiled_grammar� default_style�lexers�returnc C s || _ || _|pi | _d S �N)r r r )�selfr r 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/contrib/regular_languages/lexer.py�__init__% s zGrammarLexer.__init__r )�textr c s6 � j �|�}|�r(� fdd�|D �}|�� D ]�}� j�|j�}|r,t||j|j� �}|� |�}g }t t|j��D ]} |� || �� |�d� qr|r�|�� |j} |D ]B^} }}|D ]2} || d � jkr�| || d f|| <