o
    �õ±j	  ã                   @  sN   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„ deƒZ
dS )é    )Úannotations)ÚExecutableCompleterÚPathCompleter)Úcompile)ÚGrammarCompleterÚSystemCompleterc                      s"   e Zd ZdZd‡ fdd„Z‡  ZS )r   z(
    Completer for system commands.
    ÚreturnÚNonec              
     s`   t ddd„ dd„ dœdd„ dd„ dœd�}tƒ  |tƒ td	d
d�td	d
d�td	d
d�dœ¡ d S )Na  
                # First we have an executable.
                (?P<executable>[^\s]+)

                # Ignore literals in between.
                (
                    \s+
                    ("[^"]*" | '[^']*' | [^'"]+ )
                )*

                \s+

                # Filename as parameters.
                (
                    (?P<filename>[^\s]+) |
                    "(?P<double_quoted_filename>[^\s]+)" |
                    '(?P<single_quoted_filename>[^\s]+)'
                )
            c                 S  ó   |   dd¡S )Nú"ú\"©Úreplace©Ústring© r   ú›/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/prompt_toolkit/contrib/completers/system.pyÚ<lambda>(   ó    z*SystemCompleter.__init__.<locals>.<lambda>c                 S  r
   )Nú'ú\'r   r   r   r   r   r   )   r   )Údouble_quoted_filenameÚsingle_quoted_filenamec                 S  r
   )Nr   r   r   r   r   r   r   r   -   r   c                 S  r
   )Nr   r   r   r   r   r   r   r   /   r   )Úescape_funcsÚunescape_funcsFT)Úonly_directoriesÚ
expanduser)Ú
executableÚfilenamer   r   )r   ÚsuperÚ__init__r   r   )ÚselfÚg©Ú	__class__r   r   r       s*   þüè!
ÿÿúþzSystemCompleter.__init__)r   r	   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r    Ú__classcell__r   r   r#   r   r      s    N)Ú
__future__r   Ú$prompt_toolkit.completion.filesystemr   r   Ú1prompt_toolkit.contrib.regular_languages.compilerr   Ú3prompt_toolkit.contrib.regular_languages.completionr   Ú__all__r   r   r   r   r   Ú<module>   s    ÿ