관리-도구
편집 파일: literals.cpython-312.pyc
� �Q�fc � �V � d Z ddlZddddddd d ddd � Zd� Zd� Zd� Zedk( r e� yy)z<Safely evaluate Python string literals without using eval().� N���� � � ��'�"�\) �a�b�f�n�r�t�vr r r c � � | j dd� \ }}|j d� sJ �t j |� }|�|S |j d� r9|dd }t |� dk rt d|z � � t |d� }t |� S t |d� }t |� S # t $ r t d|z � d �w xY w# t $ r t d |z � d �w xY 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�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 �5B$ � C �$B=� Cc � � | j d� s$| j d� sJ t | d d � � �| d }| d d |dz k( r|dz }| j |� sJ t | t |� d � � �t | � dt |� z k\ sJ �| t |� t |� } t j dt | � S )Nr r r r � r z)\\(\'|\"|\\|[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 � � t d� D ]7 } t | � }t |� }t |� }||k7 s�*t | |||� �9 y )N� )�ranger! r, r2 �print)r'