B A[-@sJdZddlmZddlmZddlmZdZddZGdd d ej Z d S) z& Fixer to remove function annotations ) fixer_base)token)symsz)Removing function annotations completely.cCs |jdS)Nr)children)noderT/opt/alt/python37/lib/python3.7/site-packages/libpasteurize/fixes/fix_annotations.pyparam_without_annotations sr c@s$eZdZdZddZdZddZdS)FixAnnotationsFcCs|jsd|_|j||ddS)NT)reason)warnedwarning)selfrr rrr warn_onceszFixAnnotations.warn_oncezm funcdef< 'def' any parameters< '(' [params=any] ')' > ['->' ret=any] ':' any* > cCs|d}|d}|dk rR|jjtjks2td|j|td|j||dkr^dS|jt j krx`|j D],}|jt j krr|j|td| t|qrWn(|jt j kr|j|td| t|dS)zK This just strips annotations from the funcdef completely. paramsretNzInvalid return annotation)r )getZ prev_siblingtyperRARROWAssertionErrorr warning_textremoverZ typedargslistrZtnamereplacer )rrresultsrrparamrrr transforms"       zFixAnnotations.transformN)__name__ __module__ __qualname__r rZPATTERNrrrrrr sr N) __doc__Zlib2to3rZ lib2to3.pgen2rZlib2to3.fixer_utilrrr ZBaseFixr rrrrs