o
    Ri                     @   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typenext_siblingprev_sibling)nodeslash r   W/home/air/SG/back/venv/lib/python3.10/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__	run_orderr   r   r   r   r   r   r      s    r   N)	__doc__lib2to3r   libfuturize.fixer_utilr   r   r   BaseFixr   r   r   r   r   <module>   s
    	