
    |                     R    d dl mZ d dlmZ d dlmZ ddlmZmZ dZ	 G d de      Z
y	)
    )unicode_literals)GrammarCompleter)compile   )PathCompleterExecutableCompleter)SystemCompleterc                   "     e Zd ZdZ fdZ xZS )r	   z(
    Completer for system commands.
    c           
          t        dd d dd d d      }t        t        |   |t	               t        dd	
      t        dd	
      t        dd	
      d       y )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                 &    | j                  dd      S )N"\"replacestrings    ;lib/third_party/prompt_toolkit/contrib/completers/system.py<lambda>z*SystemCompleter.__init__.<locals>.<lambda>(       &..e:T    c                 &    | j                  dd      S )N'\'r   r   s    r   r   z*SystemCompleter.__init__.<locals>.<lambda>)   r   r   )double_quoted_filenamesingle_quoted_filenamec                 &    | j                  dd      S )Nr   r   r   r   s    r   r   z*SystemCompleter.__init__.<locals>.<lambda>,       &..PS:Tr   c                 &    | j                  dd      S )Nr   r   r   r   s    r   r   z*SystemCompleter.__init__.<locals>.<lambda>-   r   r   )escape_funcsunescape_funcsFT)only_directories
expanduser)
executablefilenamer   r   )r   superr	   __init__r   r   )selfg	__class__s     r   r&   zSystemCompleter.__init__   sm    ( ,U+T
 ,U+T1< 	ot-13)5TR*7[_*`*7[_*`		r   )__name__
__module____qualname____doc__r&   __classcell__)r)   s   @r   r	   r	      s    ' 'r   r	   N)
__future__r   3prompt_toolkit.contrib.regular_languages.completionr   1prompt_toolkit.contrib.regular_languages.compilerr   
filesystemr   r   __all__r	    r   r   <module>r5      s%    ' P E :
+& +r   