Your IP : 3.145.161.199


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

�

�Q�f ���	ddlmZddlmZddlmZmZmZd�Zd�Z	d�Z
d�Zd�Zd	�Z
Gd
�dej�Zy)
�)�
fixer_base)�token)�syms�Node�Leafc��	|jD]�}|jtjk(r
t	|�cS|jtj
k(s�K|js�X|jd}|jtjk(s��|js��|jd}t|t�s��|jdk(s��yy)N��
__metaclass__TF)
�children�typer�suite�
has_metaclass�simple_stmt�	expr_stmt�
isinstancer�value)�parent�node�	expr_node�	left_sides    �B/opt/alt/python312/lib64/python3.12/lib2to3/fixes/fix_metaclass.pyrrs����
�����9�9��
�
�"� ��&�&�
�Y�Y�$�*�*�
*�t�}�}��
�
�a�(�I��~�~����/�I�4F�4F�%�.�.�q�1�	��i��.�!���?�:�� ��c��	|jD]!}|jtjk(s�!yt	|j�D]$\}}|jt
jk(s�$ntd��ttjg�}|j|dzdrT|j|dz}|j|j��|j�|j|dzdr�T|j|�|}y)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�9��
�
�"��"��X�.�.�/���4��9�9����#��0��5�6�6�
����R� �E�
�
�
�A�a�C�D�
!��%�%�a��c�*�	�
���9�?�?�,�-������
�
�A�a�C�D�
!�
���%� ��Drc�z�	t|j�D]$\}}|jtjk(s�$ny|j�t
tjg�}t
tj|g�}|j|drN|j|}|j|j��|j�|j|dr�N|j||�|jdjd}|jdjd}	|	j|_
y)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/Gs���$�I�$6�$6�7���$��9�9��
�
�"��8�	��K�K�M��D�N�N�B�'�H��D�$�$�x�j�1�H�
�
�
�X�Y�
'��&�&�x�0�	����i�o�o�/�0������
�
�X�Y�
'�����8�$��!�!�!�$�-�-�a�0�I��"�"�1�%�.�.�q�1�I� �'�'�I�rc��|jrI|jdjtjk(r|jdj	�yyy)N���)rrr�NEWLINEr )rs r�remove_trailing_newliner3_s@���}�}����r�*�/�/�5�=�=�@��
�
�b�� � �"�A�}rc#�6K�|jD]!}|jtjk(s�!nt	d��tt
|j��D]�\}}|jtjk(s�$|js�1|jd}|jtjk(s�^|js�k|jd}t|t�s��|jdk(s��t|||�t|�|||f����y�w)NzNo class suite!r	r
)rrrr
r�listrrrrrrr/r3)r!rr"�simple_noder�	left_nodes      r�
find_metasr8ds������!�!���9�9��
�
�"��"��*�+�+��y����7�8���;����t�/�/�/�K�4H�4H�#�,�,�Q�/�I��~�~����/�I�4F�4F�%�.�.�q�1�	��i��.�!���?�:�%�d�A�{�;�+�K�8���K�0�0�9�s/�-D�AD�D�
,D�:D�D�'D�7"Dc��	|jddd�}|r1|j�}|jtjk(rn|r�1|rv|j�}t|t�r1|jtjk7r|jrd|_y|j|jddd��|r�uyy)Nr1�)
r�poprr�INDENTrr�DEDENTr(�extend)r
�kidsrs   r�fixup_indentr@{s�����>�>�$�B�$��D�
��x�x�z���9�9����$�����x�x�z���d�D�!�d�i�i�5�<�<�&?��{�{� �����K�K��
�
�d��d�+�,�rc��eZdZdZdZd�Zy)�FixMetaclassTz
    classdef<any*>
    c��t|�syt|�d}t|�D]\}}}|}|j��|jdj
}t
|j�dk(r�|jdj
tjk(r|jd}�n4|jdj�}	ttj|	g�}|jd|�n�t
|j�dk(r-ttjg�}|jd|�n�t
|j�dk(r�ttjg�}|jdttjd��|jd|�|jdttj d��nt#d	��|jdjd}
d
|
_|
j&}|jr1|j)ttj*d��d|
_nd
|
_|jd}d
|jd_d
|jd_|j)|�t-�|js^|j�t|d�}
||
_|j)|
�|j)ttj.d��yt
|j�dkDr�|jdj
tj0k(rt|jdj
tj2k(rIt|d�}
|jd|
�|jdttj.d��yyyy)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�"�������(��.�N�E�1�d�!�N��K�K�M�/��M�M�!�$�)�)�	��t�}�}���"��}�}�Q��$�$����4��-�-��*�����q�)�/�/�1���t�|�|�f�X�6�����q�'�*�
����
�1�
$��4�<�<��,�G����a��)�
����
�1�
$��4�<�<��,�G����a��e�j�j�#�!6�7����a��)����a��e�j�j�#�!6�7��:�;�;�"�*�*�1�-�6�6�q�9��$���#�?�?������ � ��e�k�k�3�!7�8�!�H�O� �H�O�#�+�+�A�.�	�')�	���1��$�')�	���1��$����^�,��U���~�~��L�L�N��Y��/�I�/�I�����i�(����d�5�=�=�$�7�8�
����
 �1�
$��.�.��$�)�)�U�\�\�9��.�.��$�)�)�U�\�\�9��Y��/�I����r�9�-����r�4��
�
�t�#<�=�	:�:�%rN)�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr^�rrrBrB�s���M��G�L>rrBN)r:r�pygramr�
fixer_utilrrrrr$r/r3r8r@�BaseFixrBrdrr�<module>rhsJ���(��)�)��&�4(�0#�
1�.-�,S>�:�%�%�S>r

?>