Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/lib2to3/pgen2/literals.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�dZddlZi
dd6dd6dd6d	d
6dd6d
d6dd6dd6dd6dd6Zd�Zd�Zd�Zedkr�e�ndS(s<Safely evaluate Python string literals without using eval().i�Nstastbstfs
tns
trs	ttstvt't"s\cCs�|jdd�\}}tj|�}|dk	r7|S|jd�r�|d}t|�dkrutd|��nyt|d�}Wq�tk
r�td|��q�n7yt|d�}Wn!tk
r�td|��nXt|�S(	Niitxis!invalid hex string escape ('\%s')iis#invalid octal string escape ('\%s')(	tgrouptsimple_escapestgettNonet
startswithtlent
ValueErrortinttchr(tmtallttailtescthexesti((s,/sys/lib/python2.7/lib2to3/pgen2/literals.pytescapes"


cCsX|d}|d |dkr+|d}n|t|�t|�!}tjdt|�S(Niis)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3})(RtretsubR(tstq((s,/sys/lib/python2.7/lib2to3/pgen2/literals.pyt
evalString(s


cCs_xXtd�D]J}t|�}t|�}t|�}||kr
|G|G|G|GHq
q
WdS(Ni(trangeRtreprR(RtcRte((s,/sys/lib/python2.7/lib2to3/pgen2/literals.pyttest2st__main__(t__doc__RRRRR#t__name__(((s,/sys/lib/python2.7/lib2to3/pgen2/literals.pyt<module>s 

		
		

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.