3
¥ fB ã @ 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 ú?/opt/alt/python36/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 Ú