Your IP : 3.133.120.64


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

�

�Q�f���dZddlmZddlmZddlmZddlmZddlmZm	Z	m
Z
mZejd�Z
Gd�d	ej�Zy
)aFixer for print.

Change:
    'print'          into 'print()'
    'print ...'      into 'print(...)'
    'print ... ,'    into 'print(..., end=" ")'
    'print >>x, ...' into 'print(..., file=x)'

No changes are applied if print_function is imported from __future__

�)�patcomp)�pytree)�token)�
fixer_base)�Name�Call�Comma�Stringz"atom< '(' [atom|STRING|NAME] ')' >c� �eZdZdZdZd�Zd�Zy)�FixPrintTzP
              simple_stmt< any* bare='print' any* > | print_stmt
              c	��|sJ�|jd�}|r1|jttd�g|j���y|j
dtd�k(sJ�|j
dd}t
|�dk(rtj|d�rydx}x}}|r|dt�k(r|dd}d}|rR|dtjtjd�k(r(t
|�d	k\sJ�|dj�}|d
d}|D�cgc]}|j���}	}|	r
d|	d_|�|�|�c|�%|j|	dt!t#|���|�%|j|	d
t!t#|���|�|j|	d|�ttd�|	�}
|j|
_|
Scc}w)N�bare�print)�prefix������ z>>r���sep�end�file)�get�replacerrr�children�len�parend_expr�matchr	r�Leafr�
RIGHTSHIFT�clone�	add_kwargr
�repr)�self�node�results�
bare_print�argsrrr�arg�l_args�n_stmts           �>/opt/alt/python312/lib64/python3.12/lib2to3/fixes/fix_print.py�	transformzFixPrint.transform%s�����w��[�[��(�
�����t�D��M�2�&0�&7�&7� 9�
:���}�}�Q��4��=�0�0�0��}�}�Q�R� ���t�9��>�k�/�/��Q��8�
�����c�D��D��H���'����9�D��C��D��G�v�{�{�5�+;�+;�T�B�B��t�9��>�!�>���7�=�=�?�D����8�D�)-�.��#�#�)�)�+���.��!�F�1�I���?�c�o��1A������v�u�f�T�#�Y�.?�@������v�u�f�T�#�Y�.?�@������v�v�t�4��d�7�m�V�,������
��
��/s�G	c�(�d|_tj|jjt|�tjtjd�|f�}|r |jt��d|_|j|�y)Nr�=r)rr�Node�syms�argumentrr r�EQUAL�appendr	)r%�l_nodes�s_kwd�n_expr�
n_arguments     r-r#zFixPrint.add_kwargMsk����
��[�[����!3�!3�"&�u�+�"(�+�+�e�k�k�3�"?�"(�"*�+�
���N�N�5�7�#� #�J�����z�"�N)�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr.r#�r:r-rrs���M��G�&�P
#r:rN)�__doc__rrr�pgen2rr�
fixer_utilrrr	r
�compile_patternr�BaseFixrr@r:r-�<module>rFsG��
�����2�2�&�g�%�%�6���
:#�z�!�!�:#r:

?>