U
    h                     @   s>   d Z ddlmZ ddlmZmZ dd ZG d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)nodeslash r	   R/var/www/html/venv/lib/python3.8/site-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 )Ndivision)r   )r   r   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   	