
c'oTˆ  ã               @   sU   d  Z  d d l m Z d d l m Z m Z d d „  Z Gd d „  d e j ƒ Z d S)	z?
Fixer for division: from __future__ import division if needed
é    )Ú
fixer_base)ÚtokenÚfuture_importc             C   s<   t  j } |  j | k o; |  j j | k o; |  j j | k S)zw
    __future__.division redefines the meaning of a single slash for division,
    so we match that and only that.
    )r   ÚSLASHÚtypeZnext_siblingZprev_sibling)ÚnodeZslash© r   úB/usr/lib/python3/dist-packages/libpasteurize/fixes/fix_division.pyÚmatch_division   s    	"r
   c               @   s.   e  Z d  Z d Z d d „  Z d d „  Z d S)ÚFixDivisioné   c             C   s
   t  | ƒ S)z¦
        Since the tree needs to be fixed once and only once if and only if it
        matches, then we can start discarding matches after we make the first.
        )r
   )Úselfr   r   r   r	   Úmatch   s    zFixDivision.matchc             C   s   t  d | ƒ d  S)NZdivision)r   )r   r   Zresultsr   r   r	   Ú	transform   s    zFixDivision.transformN)Ú__name__Ú
__module__Ú__qualname__Z	run_orderr   r   r   r   r   r	   r      s   r   N)	Ú__doc__Zlib2to3r   Zlibfuturize.fixer_utilr   r   r
   ZBaseFixr   r   r   r   r	   Ú<module>   s   	