Your IP : 52.14.26.141


Current Path : /opt/alt/python310/lib64/python3.10/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/lib2to3/pgen2/__pycache__/literals.cpython-310.pyc

o

6��fc�@sTdZddlZddddddd	d
ddd
�
Zdd�Zdd�Zdd�Zedkr(e�dSdS)z<Safely evaluate Python string literals without using eval().�N����
�
�	��'�"�\)
�a�b�f�n�r�t�vr	r
rcCs�|�dd�\}}|�d�sJ�t�|�}|dur|S|�d�rJ|dd�}t|�dkr1td|��z
t|d�}Wt|�StyItd|�d�wz
t|d�}Wt|�Stybtd	|�d�w)
Nr�r�x�z!invalid hex string escape ('\%s')��z#invalid octal string escape ('\%s'))�group�
startswith�simple_escapes�get�len�
ValueError�int�chr)�m�all�tailZescZhexes�i�r$�=/opt/alt/python310/lib64/python3.10/lib2to3/pgen2/literals.py�escapes*

����r&cCs�|�d�s|�d�sJt|dd����|d}|dd�|dkr&|d}|�|�s8Jt|t|�d����t|�dt|�ksDJ�|t|�t|��}t�dt|�S)Nr	r
rr�rz)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}))r�repr�endswithr�re�subr&)�s�qr$r$r%�
evalString(s($r.cCs@td�D]}t|�}t|�}t|�}||krt||||�qdS)N�)�rangerr(r.�print)r#�cr,�er$r$r%�test2s��r4�__main__)�__doc__r*rr&r.r4�__name__r$r$r$r%�<module>s&�
	
�

?>