o
    ,º]-  ã                   @   sJ   d Z ddlmZ ddlmZ ddlmZ dZdd„ ZG dd	„ d	ej	ƒZ
d
S )z&
Fixer to remove function annotations
é    )Ú
fixer_base)Útoken)Úsymsz)Removing function annotations completely.c                 C   s
   | j d S )Nr   )Úchildren)Únode© r   ú`/var/www/html/myproject/venv/lib/python3.10/site-packages/libpasteurize/fixes/fix_annotations.pyÚparam_without_annotations   s   
r	   c                   @   s$   e Zd ZdZdd„ ZdZdd„ ZdS )ÚFixAnnotationsFc                 C   s"   | j sd| _ | j||d� d S d S )NT©Úreason)ÚwarnedÚwarning)Úselfr   r   r   r   r   Ú	warn_once   s   þzFixAnnotations.warn_oncezm
              funcdef< 'def' any parameters< '(' [params=any] ')' > ['->' ret=any] ':' any* >
              c                 C   sÒ   |  d¡}|  d¡}|dur)|jjtjksJ dƒ‚| j|td� |j ¡  | ¡  |du r/dS |jtj	krQ|j
D ]}|jtjkrN| j|td� | t|ƒ¡ q8dS |jtjkrg| j|td� | t|ƒ¡ dS dS )zK
        This just strips annotations from the funcdef completely.
        ÚparamsÚretNzInvalid return annotationr   )ÚgetÚprev_siblingÚtyper   ÚRARROWr   Úwarning_textÚremover   Útypedargslistr   ÚtnameÚreplacer	   )r   r   Úresultsr   r   Úparamr   r   r   Ú	transform   s&   



€ýýzFixAnnotations.transformN)Ú__name__Ú
__module__Ú__qualname__r   r   ÚPATTERNr   r   r   r   r   r
      s
    r
   N)Ú__doc__Úlib2to3r   Úlib2to3.pgen2r   Úlib2to3.fixer_utilr   r   r	   ÚBaseFixr
   r   r   r   r   Ú<module>   s    