← Back
Editing: inputsplitter.cpython-311.pyc
� �@�c�m � �` � d Z ddlmZ ede� � ddlZddlZddlZddlZddlZddl Z ddlZddl mZmZm Z mZmZmZmZmZmZmZ ddl mZmZmZmZmZmZmZmZmZmZ ej d� g d�� � � � Z! ej d � � Z" ej d � � Z#d� Z$e j% Z&e j% dz Z' G d � d� � Z( G d� d� � Z)d� Z*d� Z+d� Z, ej dej- � � Z. ej dej- � � Z/d� Z0d� Z1d� Z2 G d� de3� � Z4 G d� de4� � Z5dS )a6 DEPRECATED: Input handling and transformation machinery. This module was deprecated in IPython 7.0, in favour of inputtransformer2. The first class in this module, :class:`InputSplitter`, is designed to tell when input from a line-oriented frontend is complete and should be executed, and when the user should be prompted for another line of code instead. The name 'input splitter' is largely for historical reasons. A companion, :class:`IPythonInputSplitter`, provides the same functionality but with full support for the extended IPython syntax (magics, system calls, etc). The code to actually do these transformations is in :mod:`IPython.core.inputtransformer`. :class:`IPythonInputSplitter` feeds the raw code to the transformers in order and stores the results. For more details, see the class docstrings below. � )�warnzeIPython.core.inputsplitter is deprecated since IPython 7 in favor of `IPython.core.inputtransformer2`N) �leading_indent�classic_prompt� ipy_prompt� cellmagic�assemble_logical_lines�help_end�escaped_commands�assign_from_magic�assign_from_system�assemble_python_lines) � ESC_SHELL� ESC_SH_CAP�ESC_HELP� ESC_HELP2� ESC_MAGIC� ESC_MAGIC2� ESC_QUOTE� ESC_QUOTE2� ESC_PAREN� ESC_SEQUENCES�|)z^\s+raise(\s.*)?$z^\s+raise\([^\)]*\).*$z^\s+return(\s.*)?$z^\s+return\([^\)]*\).*$z^\s+pass\s*$z ^\s+break\s*$z^\s+continue\s*$z^([ \t\r\f\v]+)z^\s*\#c �f � t � | � � }|r|� � � S dS )a Return the number of initial spaces in a string. Note that tabs are counted as a single space. For now, we do *not* support mixing of tabs and spaces in the user's input. Parameters ---------- s : string Returns ------- n : int r )� ini_spaces_re�match�end)�s� ini_spacess �</usr/lib/python3/dist-packages/IPython/core/inputsplitter.py�num_ini_spacesr M s4 � � �$�$�Q�'�'�J�� ��~�~�����q� � c � � e Zd ZexZZd� ZdS )�IncompleteStringc �>