AlkantarClanX12
Current Path : /opt/alt/python310/lib64/python3.10/lib2to3/fixes/__pycache__/ |
Current File : //opt/alt/python310/lib64/python3.10/lib2to3/fixes/__pycache__/fix_metaclass.cpython-310.opt-2.pyc |
o 6��f � @ st d dl mZ d dlmZ d dlmZmZmZ dd� Zdd� Z dd � Z d d� Zdd � Zdd� Z G dd� dej�ZdS )� )� fixer_base)�token)�syms�Node�Leafc C s| | j D ]7}|jtjkrt|� S |jtjkr;|j r;|j d }|jtjkr;|j r;|j d }t|t�r;|j dkr; dS qdS )N� � __metaclass__TF) �children�typer �suite� has_metaclass�simple_stmt� expr_stmt� isinstancer �value)�parent�node� expr_nodeZ left_side� r �B/opt/alt/python310/lib64/python3.10/lib2to3/fixes/fix_metaclass.pyr s �r c C s� | j D ]}|jtjkr d S qt| j �D ]\}}|jtjkr! nqtd��ttjg �}| j |d d � rP| j |d }|� |� � � |�� | j |d d � s5| � |� |}d S )NzNo class suite and no ':'!� )r r r r � enumerater �COLON� ValueErrorr �append_child�clone�remove)�cls_noder �ir � move_noder r r �fixup_parse_tree- s$ ��� r c C s� t |j�D ]\}}|jtjkr nqd S |�� ttjg �}ttj |g�}|j|d � rD|j| }|� |�� � |�� |j|d � s-| �||� |jd jd }|jd jd } | j |_ d S )Nr )r r r r �SEMIr r r r r r r �insert_child�prefix) r r Z stmt_nodeZsemi_indr Znew_exprZnew_stmtr Z new_leaf1Z old_leaf1r r r �fixup_simple_stmtG s$ � �r$ c C s2 | j r| j d jtjkr| j d �� d S d S d S )N���)r r r �NEWLINEr )r r r r �remove_trailing_newline_ s �r'