Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/idlelib/__pycache__/autoexpand.cpython-310.opt-2.pyc

o

0�i��@sH	ddlZddlZGdd�d�Zedkr"ddlmZeddd�dSdS)	�Nc@s<eZdZejejdZdd�Zdd�Zdd�Z	dd	�Z
d
S)�
AutoExpand�_cCs|j|_|jj|_d|_dS)N)�text�bell�state)�selfZeditwin�r�9/opt/alt/python310/lib64/python3.10/idlelib/autoexpand.py�__init__s

zAutoExpand.__init__c
Cs�	|j�d�}|j�dd�}|js|��}d}n|j\}}}}||ks'||kr-|��}d}|s5|��dS|��}|j�dt|�d�||}	|dt|�}|dkrX|��|j�	d|	�|j�d�}|j�dd�}||||f|_dS)N�insert�insert linestartzinsert lineendr�breakzinsert - %d chars�)
r�index�getr�getwordsr�getprevword�delete�lenr)
rZeventZ	curinsertZcurline�wordsrr�line�wordZnewwordrrr	�expand_word_events0zAutoExpand.expand_word_eventc	Cs�	|��}|s	gS|j�dd�}t�d|d|�}~|j�dd�}t�d|d|�}~|s3|s3gSg}i}|��|D]}|�|�rEq=|�|�|||<q=|D]}|�|�rYqQ|�|�|||<qQ|�|�|S)Nz1.0zinsert wordstartz\bz\w+\bzinsert wordend�end)rrr�re�findall�reverse�append)	rrZbeforeZwbeforeZafterZwafterr�dict�wrrr	r6s6






zAutoExpand.getwordscCs`	|j�dd�}t|�}|dkr*||d|jvr*|d}|dkr*||d|jvs||d�S)Nrrrr)rrr�	wordchars)rr�irrr	rUs�zAutoExpand.getprevwordN)�__name__�
__module__�__qualname__�stringZ
ascii_lettersZdigitsr r
rrrrrrr	rsr�__main__)�mainz!idlelib.idle_test.test_autoexpand�)�	verbosity)rr%rr"Zunittestr'rrrr	�<module>sK�