AlkantarClanX12

Your IP : 3.138.125.86


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_metaclass.cpython-311.opt-2.pyc

�

c��f ��~�	ddlmZddlmZddlmZmZmZd�Zd�Z	d�Z
d�Zd�Zd	�Z
Gd
�dej��ZdS)
�)�
fixer_base)�token)�syms�Node�Leafc�R�	|jD]�}|jtjkrt	|��cS|jtjkr`|jrY|jd}|jtjkr7|jr0|jd}t|t��r|j	dkrdS��dS)N��
__metaclass__TF)
�children�typer�suite�
has_metaclass�simple_stmt�	expr_stmt�
isinstancer�value)�parent�node�	expr_node�	left_sides    �B/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_metaclass.pyrrs����
��	 �	 ���9��
�"�"� ��&�&�&�&�&�
�Y�$�*�
*�
*�t�}�
*��
�a�(�I��~���/�/�I�4F�/�%�.�q�1�	��i��.�.� �!��?�:�:��4�4���5�c��	|jD]}|jtjkrdS�t	|j��D]\}}|jt
jkrn�td���ttjg��}|j|dzd�r]|j|dz}|�	|�
����|���|j|dzd��]|�	|��|}dS)NzNo class suite and no ':'!�)rrrr
�	enumerater�COLON�
ValueErrorr�append_child�clone�remove)�cls_noder�ir
�	move_nodes     r�fixup_parse_treer$-s%����!�����9��
�"�"��F�F�#�
�X�.�/�/�7�7���4��9���#�#��E�$��5�6�6�6�
���R� � �E�
�
�A�a�C�D�D�
!���%�a��c�*�	�
���9�?�?�,�,�-�-�-��������
�A�a�C�D�D�
!��
���%� � � ��D�D�Drc�p�	t|j��D]\}}|jtjkrn�dS|���t
tjg��}t
tj	|g��}|j|d�rW|j|}|�
|�����|���|j|d��W|�||��|jdjd}|jdjd}	|	j
|_
dS)Nr	)rrrr�SEMIr rrrrrr�insert_child�prefix)
rr"�	stmt_node�semi_indr�new_expr�new_stmtr#�	new_leaf1�	old_leaf1s
          r�fixup_simple_stmtr/Gs3���$�I�$6�7�7�����$��9��
�"�"��E�#�	���K�K�M�M�M��D�N�B�'�'�H��D�$�x�j�1�1�H�
�
�X�Y�Y�
'���&�x�0�	����i�o�o�/�/�0�0�0��������
�X�Y�Y�
'������8�$�$�$��!�!�$�-�a�0�I��"�1�%�.�q�1�I� �'�I���rc��|jrA|jdjtjkr#|jd���dSdSdS)N���)rrr�NEWLINEr )rs r�remove_trailing_newliner3_sQ���}�#���r�*�/�5�=�@�@��
�b�� � �"�"�"�"�"�#�#�@�@rc#��K�|jD]}|jtjkrn�t	d���tt
|j����D]�\}}|jtjkr�|jr}|jd}|jtjkr[|jrT|jd}t|t��r2|jdkr't|||��t|��|||fV���dS)NzNo class suite!r	r
)rrrr
r�listrrrrrrr/r3)r!rr"�simple_noder�	left_nodes      r�
find_metasr8ds�����!�,�,���9��
�"�"��E�#��*�+�+�+��y���7�7�8�8�1�1���;���t�/�/�/�K�4H�/�#�,�Q�/�I��~���/�/�I�4F�/�%�.�q�1�	��i��.�.�1�!��?�:�:�%�d�A�{�;�;�;�+�K�8�8�8���K�0�0�0�0��1�1rc�r�	|jddd�}|r,|���}|jtjkrn|�,|ru|���}t|t��r%|jtjkr|jrd|_dS|�	|jddd���|�sdSdS)Nr1�)
r�poprr�INDENTrr�DEDENTr(�extend)r
�kidsrs   r�fixup_indentr@{s�����>�$�$�B�$��D�
���x�x�z�z���9���$�$�����-��x�x�z�z���d�D�!�!�	-�d�i�5�<�&?�&?��{�
!� ����F��K�K��
�d�d��d�+�,�,�,��-�-�-�-�-rc��eZdZdZdZd�ZdS)�FixMetaclassTz
    classdef<any*>
    c��t|��sdSt|��d}t|��D]\}}}|}|����|jdj}t
|j��dkr�|jdjtjkr|jd}�nN|jd�	��}	ttj|	g��}|�d|��n�t
|j��dkr1ttjg��}|�d|��n�t
|j��dkr�ttjg��}|�dttjd����|�d|��|�dttjd����nt#d	���|jdjd}
d
|
_|
j}|jr5|�ttjd����d|
_nd
|
_|jd}d
|jd_d
|jd_|�|��t-|��|jso|���t|d��}
||
_|�|
��|�ttjd����dSt
|j��dkr�|jdjtjkrx|jdjtjkrZt|d��}
|�d|
��|�dttjd����dSdSdSdS)Nr	����r�)�(zUnexpected class definition�	metaclass�,� r:r�pass�
���r1)rr$r8r rr�lenr�arglistrr�	set_childr'rr�RPAR�LPARrrr(r�COMMAr@r2r<r=)�selfr�results�last_metaclassr
r"�stmt�	text_typerQr�meta_txt�orig_meta_prefixr�	pass_leafs              r�	transformzFixMetaclass.transform�s����T�"�"�	��F��������(��.�.�	�	�N�E�1�d�!�N��K�K�M�M�M�M��M�!�$�)�	��t�}����"�"��}�Q��$���4�4��-��*�����q�)�/�/�1�1���t�|�f�X�6�6�����q�'�*�*�*�*�
���
�
�1�
$�
$��4�<��,�,�G����a��)�)�)�)�
���
�
�1�
$�
$��4�<��,�,�G����a��e�j�#�!6�!6�7�7�7����a��)�)�)����a��e�j�#�!6�!6�7�7�7�7��:�;�;�;�"�*�1�-�6�q�9��$���#�?����	!�� � ��e�k�3�!7�!7�8�8�8�!�H�O�O� �H�O�#�+�A�.�	�')�	��1��$�')�	��1��$����^�,�,�,��U�����~�	>��L�L�N�N�N��Y��/�/�I�/�I�����i�(�(�(����d�5�=�$�7�7�8�8�8�8�8�
���
 �
 �1�
$�
$��.��$�)�U�\�9�9��.��$�)�U�\�9�9��Y��/�/�I����r�9�-�-�-����r�4��
�t�#<�#<�=�=�=�=�=�
%�
$�9�9�9�9rN)�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr^�rrrBrB�s4�������M��G�L>�L>�L>�L>�L>rrBN)r:r�pygramr�
fixer_utilrrrrr$r/r3r8r@�BaseFixrBrdrr�<module>rhs����(������������)�)�)�)�)�)�)�)�)�)����&���4(�(�(�0#�#�#�
1�1�1�.-�-�-�,S>�S>�S>�S>�S>�:�%�S>�S>�S>�S>�S>r