AlkantarClanX12

Your IP : 18.224.52.54


Current Path : /opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/fix_print.cpython-311.pyc

�

c��f���dZddlmZddlmZddlmZddlmZddlmZm	Z	m
Z
mZejd��Z
Gd�d	ej��Zd
S)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�ZdS)�FixPrintTzP
              simple_stmt< any* bare='print' any* > | print_stmt
              c	�(�|sJ�|�d��}|r9|�ttd��g|j�����dS|jdtd��ksJ�|jdd�}t
|��dkr"t�|d��rdSdx}x}}|r$|dt��kr|dd�}d}|rb|dtjtj
d��kr9t
|��d	ksJ�|d���}|d
d�}d�|D��}|r
d|d_|�|�|�|�1|�|d
t!t#|������|�1|�|dt!t#|������|�|�|d|��ttd��|��}	|j|	_|	S)N�bare�print)�prefix������ z>>r�c�6�g|]}|�����S�)�clone)�.0�args  �>/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_print.py�
<listcomp>z&FixPrint.transform.<locals>.<listcomp>?s ��.�.�.�#�#�)�)�+�+�.�.�.���sep�end�file)�get�replacerrr�children�len�parend_expr�matchr	r�Leafr�
RIGHTSHIFTr�	add_kwargr
�repr)
�self�node�results�
bare_print�argsrr r!�l_args�n_stmts
          r�	transformzFixPrint.transform%s�����w��[�[��(�(�
��	����t�D��M�M�2�&0�&7� 9� 9� 9�
:�
:�
:��F��}�Q��4��=�=�0�0�0�0��}�Q�R�R� ���t�9�9��>�>�k�/�/��Q��8�8�>�
�F�����c�D��	�D��H����'�'�����9�D��C��	�D��G�v�{�5�+;�T�B�B�B�B��t�9�9��>�>�>�>���7�=�=�?�?�D�����8�D�.�.��.�.�.���	"�!�F�1�I���?�c�o��1A������v�u�f�T�#�Y�Y�.?�.?�@�@�@������v�u�f�T�#�Y�Y�.?�.?�@�@�@������v�v�t�4�4�4��d�7�m�m�V�,�,�����
��
rc�*�d|_tj|jjt|��tjtjd��|f��}|r(|�	t����d|_|�	|��dS)Nr�=r)rr�Node�syms�argumentrr(r�EQUAL�appendr	)r,�l_nodes�s_kwd�n_expr�
n_arguments     rr*zFixPrint.add_kwargMs�����
��[���!3�"&�u�+�+�"(�+�e�k�3�"?�"?�"(�"*�+�+�
��	$��N�N�5�7�7�#�#�#� #�J�����z�"�"�"�"�"rN)�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr3r*rrrrrs?�������M��G�&�&�&�P
#�
#�
#�
#�
#rrN)�__doc__rrr�pgen2rr�
fixer_utilrrr	r
�compile_patternr&�BaseFixrrrr�<module>rIs���
�
�������������������������2�2�2�2�2�2�2�2�2�2�2�2�&�g�%�6����
:#�:#�:#�:#�:#�z�!�:#�:#�:#�:#�:#r