AlkantarClanX12
Current Path : /opt/alt/python311/lib64/python3.11/lib2to3/__pycache__/ |
Current File : //opt/alt/python311/lib64/python3.11/lib2to3/__pycache__/btm_matcher.cpython-311.opt-2.pyc |
� c��f� � � � d Z ddlZddlZddlmZ ddlmZ ddlmZ G d� de � � Z G d � d e � � Zi ad� Z dS )z+George Boutsioukis <gboutsioukis@gmail.com>� N)�defaultdict� )�pytree)�reduce_treec �4 � e Zd Z ej � � Zd� ZdS )�BMNodec �l � i | _ g | _ t t j � � | _ d| _ d S )N� )�transition_table�fixers�nextr �count�id�content��selfs �:/opt/alt/python311/lib64/python3.11/lib2to3/btm_matcher.py�__init__zBMNode.__init__ s- � � "�������v�|�$�$�������� N)�__name__� __module__�__qualname__� itertoolsr r � r r r r s5 � � � � � �I��I�O���E�� � � � r r c �. � e Zd Z d� Zd� Zd� Zd� Zd� ZdS )� BottomMatcherc � � t � � | _ t � � | _ | j g| _ g | _ t j d� � | _ d S )N�RefactoringTool) �set�matchr �root�nodesr �logging� getLogger�loggerr s r r zBottomMatcher.__init__ sA � ��U�U�� ��H�H�� ��i�[�� �����'�(9�:�:����r c � � | j � |� � t |j � � }|� � � }| � || j �� � }|D ]}|j � |� � �d S )N��start)r �appendr �pattern_tree�get_linear_subpattern�addr! )r �fixer�tree�linear�match_nodes� match_nodes r � add_fixerzBottomMatcher.add_fixer% s� � � � ����5�!�!�!��5�-�.�.���+�+�-�-���h�h�v�T�Y�h�7�7��%� ,� ,�J���$�$�U�+�+�+�+� ,� ,r c �� � |s|gS t |d t � � r\g }|d D ]O}| � ||�� � }|D ]3}|� | � |dd � |� � � � �4�P|S |d |j vrt � � }||j |d <