← Back
Editing: splitinput.cpython-311.pyc
� �@�c� � � � d Z ddlZddlZddlmZ ddlmZ ej dej � � Z d d�Z G d� de� � ZdS ) z� Simple utility for splitting user input. This is used by both inputsplitter and prefilter. Authors: * Brian Granger * Fernando Perez � N)� py3compat)�get_stream_encaV ^(\s*) # any leading space ([,;/%]|!!?|\?\??)? # escape character or characters \s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading % # to correctly treat things like '?%magic' (.*?$|$) # rest of line c �� � t t j d� � }t j | |� � } |�t }|� | � � }|s_ | � dd� � \ }}n# t $ r | d}}Y nw xY wt j d| � � � � � d }d}n|� � � \ }}}}||pd|� � � |� � � fS )z`Split user input into initial whitespace, escape character, function part and the rest. zutf-8N� � z ^(\s*)(.*)r ) r �sys�stdinr �cast_unicode� line_split�match�split� ValueError�re�groups�strip�lstrip)�line�pattern�encodingr �ifun�the_rest�pre�escs �9/usr/lib/python3/dist-packages/IPython/core/splitinput.py�split_user_inputr 5 s� � � �c�i��1�1�H��!�$��1�1�D������M�M�$���E�� 2� '�!�Z�Z��Q�/�/�N�D�(�(��� '� '� '�!�3�(�D�D�D� '���� �h�}�T�*�*�1�1�3�3�A�6�����#(�<�<�>�>� ��S�$�� �� �r�4�:�:�<�<����):�):�:�:s �A+ �+A<�;A<c �&