
    ړi                    x    d dl mZ d dl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y
)    )annotations)Callable)Document)StyleAndTextTuples)LexerPygmentsLexer)	BashLexer)Python3LexerPtpythonLexerc                  "    e Zd ZdZdddZddZy)r   z
    Lexer for ptpython input.

    If the input starts with an exclamation mark, use a Bash lexer, otherwise,
    use a Python 3 lexer.
    Nc                \    |xs t        t              | _        t        t              | _        y N)r   PythonLexerpython_lexerr	   system_lexer)selfr   s     5/tmp/pip-target-20744g9h/lib/python/ptpython/lexer.py__init__zPtpythonLexer.__init__   s!    (FM+,F))4    c                    |j                   j                  d      r| j                  j                  |      S | j                  j                  |      S )N!)text
startswithr   lex_documentr   )r   documents     r   r   zPtpythonLexer.lex_document   sB    ==##C($$11(;;  --h77r   r   )r   zLexer | NonereturnNone)r   r   r   z#Callable[[int], StyleAndTextTuples])__name__
__module____qualname____doc__r   r    r   r   r   r      s    58r   N)
__future__r   typingr   prompt_toolkit.documentr   prompt_toolkit.formatted_textr   prompt_toolkit.lexersr   r   pygments.lexersr	   r
   r   __all__r   r"   r   r   <module>r*      s.    "  , < 6 % 7
8E 8r   