Your IP : 13.59.83.202


Current Path : /opt/alt/python34/lib64/python3.4/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/lib2to3/pgen2/__pycache__/literals.cpython-34.pyo

�
j fO�@s�dZddlZi
dd6dd6dd6d	d
6dd6d
d6dd6dd6dd6dd6Zdd�Zdd�Zdd�Zedkr�e�ndS)z<Safely evaluate Python string literals without using eval().�N��a��b��f�
�n�
�r�	�t��v�'�"�\cCs�|jdd�\}}tj|�}|dk	r7|S|jd�r�|dd�}t|�dkr{td|��nyt|d�}Wq�tk
r�td|��Yq�Xn8yt|d�}Wn"tk
r�td|��YnXt|�S)	Nr��x�z!invalid hex string escape ('\%s')��z#invalid octal string escape ('\%s'))�group�simple_escapes�get�
startswith�len�
ValueError�int�chr)�m�all�tail�escZhexes�i�r%�;/opt/alt/python34/lib64/python3.4/lib2to3/pgen2/literals.py�escapes"

r'cCsa|d}|dd�|dkr1|d}n|t|�t|��}tjdt|�S)Nr�z)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}))r�re�subr')�s�qr%r%r&�
evalString(s


r-cCsaxZtd�D]L}t|�}t|�}t|�}||kr
t||||�q
q
WdS)N�)�ranger�reprr-�print)r$�cr+�er%r%r&�test2sr4�__main__)�__doc__r)rr'r-r4�__name__r%r%r%r&�<module>s 


	

?>