�
�WcB c sZ � d Z ddlmZ ddlmZ ddlmZ G d� dej � ZdS )z�Fixer that changes 'a ,b' into 'a, b'.
This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons. It does not touch other uses of whitespace.
i )�pytree)�token)�
fixer_basec s� � e Zd ZdZdZ ej ej d� Z ej ej d� Z ee fZ
d� ZdS )�
FixWsCommaTzH
any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
z,z:c s� � |j � }d}|j D ]T }|| j v r+|j }|j � rd|vrd|_ d}�<|r|j }|sd|_ d}�V|S )NFz
� Tz )ZcloneZchildren�SEPS�prefixZisspace)ZselfZnodeZresultsZnewZcommaZchildr s �3/usr/lib64/python3.12/lib2to3/fixes/fix_ws_comma.py� transformzFixWsComma.transform s� � ��j�j�l�����\�\� � �E��� � �!�!������>�>�#�#��F�(:�(:�#%�E�L�����5�"�\�\�F�!�6�'*�������
� N)Z__name__Z
__module__Z__qualname__ZexplicitZPATTERNr ZLeafr ZCOMMAZCOLONr r � r r r r sf � � � � � ��H��G�
�F�K�K����S�)�E��F�K�K����S�)�E��5�>�D�� � � � r r N)Z__doc__r r Zpgen2r r ZBaseFixr r
r r �<module>r s| ��� � � � � � � � � � � � � � � � � � � �� � � � ��#�#� � � � r