B
    18™\B  ã               @   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 )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 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   sd   |  ¡ }d}xR|jD ]H}|| jkrD|j}| ¡ r>d|kr>d|_d}q|rX|j}|sXd|_d}qW |S )NFÚ
Ú Tú )ÚcloneÚchildrenÚSEPSÚprefixÚisspace)ÚselfÚnodeÚresultsÚnewÚcommaÚchildr   © r   ú^/oak/stanford/groups/akundaje/marinovg/programs/Python-3.7.3/Lib/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   