3
\B � @ s> d Z ddlmZ ddlmZ ddlmZ G dd� 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.
� )�pytree)�token)�
fixer_basec @ s@ e Zd ZdZdZejejd�Zejej d�Z ee fZ
dd� ZdS )�
FixWsCommaTzH
any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
�,�:c C sd |j � }d}xR|jD ]H}|| jkrD|j}|j� r>d|kr>d|_d}q|rX|j}|sXd|_d}qW |S )NF�
� T� )ZcloneZchildren�SEPS�prefix�isspace)�selfZnodeZresults�newZcommaZchildr � r �2/usr/lib64/python3.6/lib2to3/fixes/fix_ws_comma.py� transform s
zFixWsComma.transformN)�__name__�
__module__�__qualname__ZexplicitZPATTERNr ZLeafr �COMMA�COLONr r r r r r r s r N)�__doc__r r Zpgen2r r ZBaseFixr r r r r �