Your IP : 18.222.184.207


Current Path : /opt/alt/python312/lib64/python3.12/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/lib2to3/pgen2/__pycache__/literals.cpython-312.pyc

�

�Q�fc��V�dZddlZddddddd	d
ddd
�
Zd�Zd�Zd�Zedk(re�yy)z<Safely evaluate Python string literals without using eval().�N����
�
�	��'�"�\)
�a�b�f�n�r�t�vr
rrc��|jdd�\}}|jd�sJ�tj|�}|�|S|jd�r9|dd}t	|�dkrtd|z��	t
|d�}t|�S	t
|d�}t|�S#t
$rtd|z�d�wxYw#t
$rtd	|z�d�wxYw)
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�tail�esc�hexes�is      �=/opt/alt/python312/lib64/python3.12/lib2to3/pgen2/literals.py�escaper)s�������1�
�I�C���>�>�$����
�
�
�T�
"�C�
���
����s���Q�R����u�:��>��A�D�H�I�I�	T��E�2��A��q�6�M�		V��D�!��A��q�6�M���	T��A�D�H�I�t�S�	T��
�	V��C�d�J�K�QU�U�	V�s�5B$�
C�$B=�Cc��|jd�s$|jd�sJt|dd���|d}|dd|dzk(r|dz}|j|�sJt|t|�d���t|�dt|�zk\sJ�|t|�t|�}t	j
dt|�S)Nr
rrr�rz)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}))r�repr�endswithr�re�subr))�s�qs  r(�
evalStringr2(s����<�<������S� 1�>�4��"�1��;�>�1�	�!��A���!�u��!��|�
�a�C���:�:�a�=�+�$�q�#�a�&���{�+�+�=��q�6�Q�s�1�v�X����	�#�a�&�#�a�&���A�
�6�6�>���J�J�c��td�D]7}t|�}t|�}t|�}||k7s�*t	||||��9y)N�)�ranger!r,r2�print)r'�cr0�es    r(�testr:2s@��
�3�Z����F����G���q�M����6��!�Q��1��r3�__main__)�__doc__r.rr)r2r:�__name__�r3r(�<module>r?sW��C�	�����������	���*K���z���F�r3

?>