
    Fwg-                     `    d Z ddlmZ ddlmZ ddlmZ dZd Z G d dej                        Z
y	)
z&
Fixer to remove function annotations
    )
fixer_base)token)symsz)Removing function annotations completely.c                      | j                   d   S )Nr   )children)nodes    Z/var/www/horilla/myenv/lib/python3.12/site-packages/libpasteurize/fixes/fix_annotations.pyparam_without_annotationsr
      s    ==    c                        e Zd ZdZd ZdZd Zy)FixAnnotationsFc                 R    | j                   sd| _         | j                  ||       y y )NTreason)warnedwarning)selfr   r   s      r	   	warn_oncezFixAnnotations.warn_once   s%    {{DKLLfL- r   zm
              funcdef< 'def' any parameters< '(' [params=any] ')' > ['->' ret=any] ':' any* >
              c                    |j                  d      }|j                  d      }|o|j                  j                  t        j                  k(  sJ d       | j                  |t               |j                  j                          |j                          |y|j                  t        j                  k(  ra|j                  D ]Q  }|j                  t        j                  k(  s!| j                  |t               |j                  t        |             S y|j                  t        j                  k(  r2| j                  |t               |j                  t        |             yy)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   params         r	   	transformzFixAnnotations.transform   s    Y'kk&!?##((ELL8V:VV8NN4N5##%JJL>6;;$,,, D::+NN4N=MM";E"BCD [[DJJ&NN4N5NN4V<= 'r   N)__name__
__module____qualname__r   r   PATTERNr#    r   r	   r   r      s    F.
G>r   r   N)__doc__lib2to3r   lib2to3.pgen2r   lib2to3.fixer_utilr   r   r
   BaseFixr   r(   r   r	   <module>r.      s1      #;">Z'' ">r   