
    BNe                        d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
mZ d dlmZ d dlmZ dgZ G d	 de
          Zd
S )    )annotations)CallableOptional)Document)StyleAndTextTuples)LexerPygmentsLexer)	BashLexer)Python3LexerPtpythonLexerc                  $    e Zd ZdZdddZddZdS )r   z
    Lexer for ptpython input.

    If the input starts with an exclamation mark, use a Bash lexer, otherwise,
    use a Python 3 lexer.
    Npython_lexerLexer | NonereturnNonec                n    |pt          t                    | _        t          t                    | _        d S N)r	   PythonLexerr   r
   system_lexer)selfr   s     x/home/feoh/.cache/pypoetry/virtualenvs/veilid-python-play-bIboZq2W-py3.11/lib/python3.11/site-packages/ptpython/lexer.py__init__zPtpythonLexer.__init__   s-    (FM+,F,F))44    documentr   #Callable[[int], StyleAndTextTuples]c                    |j                             d          r| j                            |          S | j                            |          S )N!)text
startswithr   lex_documentr   )r   r   s     r   r    zPtpythonLexer.lex_document   sH    =##C(( 	<$11(;;; --h777r   r   )r   r   r   r   )r   r   r   r   )__name__
__module____qualname____doc__r   r     r   r   r   r      sK         5 5 5 5 58 8 8 8 8 8r   N)
__future__r   typingr   r   prompt_toolkit.documentr   prompt_toolkit.formatted_textr   prompt_toolkit.lexersr   r	   pygments.lexersr
   r   r   __all__r   r%   r   r   <module>r-      s    " " " " " " % % % % % % % % , , , , , , < < < < < < 6 6 6 6 6 6 6 6 % % % % % % 7 7 7 7 7 7
8 8 8 8 8E 8 8 8 8 8r   