관리-도구
편집 파일: refactor.cpython-312.opt-2.pyc
� �Q�fsk � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl mZmZm Z ddlmZ ddlmZmZ ddlmZ dd �Z G d � de� Zd� Zd � Zd� Zd� Zd� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z!y)z#Guido van Rossum <guido@python.org>� N)�chain� )�driver�tokenize�token)� find_root)�pytree�pygram)�btm_matcherc �� � t | g g dg� }g }t j |j � D ]0 \ }}}|j d� s�|r|dd }|j |� �2 |S )N�*�fix_� )� __import__�pkgutil�iter_modules�__path__� startswith�append)� fixer_pkg� remove_prefix�pkg� fix_names�finder�name�ispkgs �7/opt/alt/python312/lib64/python3.12/lib2to3/refactor.py�get_all_fix_namesr sm � �O� �Y��B��� .�C��I�&�3�3�C�L�L�A����e��?�?�6�"���A�B�x�����T�"� B� �� c � � e Zd Zy)� _EveryNodeN��__name__� __module__�__qualname__� r r r! r! + � � �r r! c �� � t | t j t j f� r| j �t �| j hS t | t j � r'| j rt | j � S t �t | t j � r>t � }| j D ]# }|D ] }|j t |� � � �% |S t d| z � �)Nz$Oh no! I don't understand pattern %s) � isinstancer �NodePattern�LeafPattern�typer! �NegatedPattern�content�_get_head_types�WildcardPattern�set�update� Exception)�pat�r�p�xs r r/ r/ / s� � �9� �#��*�*�F�,>�,>�?�@� �8�8�������z���#�v�,�,�-��;�;�"�3�;�;�/�/����#�v�-�-�.��E�����A��������+�,� � � �� �:�S�A� B�Br c �Z � t j t � }g }| D ]| }|j r2 t |j � }|D ] }|| j |� � �A|j �||j j |� �l|j |� �~ t t j j j � t j j � D ] }|| j |� � t |� S # t $ r |j |� Y �� w xY w�N)�collections�defaultdict�list�patternr/ r r! �_accept_typer r �python_grammar� symbol2number�values�tokens�extend�dict)� fixer_list� head_nodes�every�fixer�heads� node_types r �_get_headnode_dictrK K s � �/��(�(��.�J��E����=�=� 8�'�� � �6�� "'�I��y�)�0�0��7� "'� �!�!�-��5�-�-�.�5�5�e�<����U�#� � �6�0�0�>�>�E�E�G�!�0�0�7�7�9� ��9��$�$�U�+�9� � ���� � $����U�#� $�s �D�D*�)D*c �N � t | d� D �cg c] }| dz |z �� c}S c c}w )NF�.)r )�pkg_name�fix_names r �get_fixers_from_packagerP d sB � �� .�h��>�@�>�� �s�N�X�%�>�@� @�� @s �"c � � | S r9 r&