o
    bcB                     @   s>   d Z ddlmZ ddlmZ ddlmZ G dd dejZdS )zFixer 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.

   )pytree)token)
fixer_basec                   @   s@   e Zd ZdZdZeejdZeej	dZ	ee	fZ
dd ZdS )
FixWsCommaTzH
    any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
    ,:c                 C   s`   |  }d}|jD ]$}|| jv r!|j}| rd|vrd|_d}q	|r+|j}|s+d|_d}q	|S )NF
 T )clonechildrenSEPSprefixisspace)selfnoderesultsnewcommachildr    r   1/usr/lib/python3.10/lib2to3/fixes/fix_ws_comma.py	transform   s   

zFixWsComma.transformN)__name__
__module____qualname__explicitPATTERNr   Leafr   COMMACOLONr   r   r   r   r   r   r      s    r   N)__doc__r	   r   pgen2r   r   BaseFixr   r   r   r   r   <module>   s
    