Your IP : 216.73.217.5
3
\"�@sPddlZddlmZddlmZddlmZGdd�de�ZGdd �d e�Z dS)
�N�)�PatternCompiler)�pygram)�does_tree_importc@s�eZdZdZdZdZdZdZej d�Z
e�ZdZ
dZdZdZdZdZejZdd�Zdd �Zd
d�Zdd
�Zdd�Zddd�Zdd�Zddd�Zdd�Zdd�Zdd�Z dS)�BaseFixNrZpostF�cCs||_||_|j�dS)N)�options�log�compile_pattern)�selfrr �r�*/usr/lib64/python3.6/lib2to3/fixer_base.py�__init__/szBaseFix.__init__cCs,|jdk r(t�}|j|jdd�\|_|_dS)NT)Z with_tree)�PATTERNrr
�pattern�pattern_tree)r�PCrrr
r
;s
zBaseFix.compile_patterncCs
||_dS)N)�filename)rrrrr
�set_filenameFszBaseFix.set_filenamecCsd|i}|jj||�o|S)N�node)r�match)rr�resultsrrr
rMs z
BaseFix.matchcCs
t��dS)N)�NotImplementedError)rrrrrr
� transformYszBaseFix.transform�xxx_todo_changemecCs6|}x ||jkr$|tt|j��}qW|jj|�|S)N)�
used_names�str�next�numbers�add)r�template�namerrr
�new_nameis
zBaseFix.new_namecCs.|jrd|_|jjd|j�|jj|�dS)NFz### In file %s ###)� first_logr �appendr)r�messagerrr
�log_messagetszBaseFix.log_messagecCs>|j�}|j�}d|_d}|j|||f�|r:|j|�dS)N�zLine %d: could not convert: %s)�
get_linenoZclone�prefixr&)rr�reason�linenoZ
for_output�msgrrr
�cannot_convertzszBaseFix.cannot_convertcCs|j�}|jd||f�dS)NzLine %d: %s)r(r&)rrr*r+rrr
�warning�szBaseFix.warningcCs(|j|_|j|�tjd�|_d|_dS)NrT)rr� itertools�countrr#)r�treerrrr
�
start_tree�s
zBaseFix.start_treecCsdS)Nr)rr1rrrr
�finish_tree�szBaseFix.finish_tree)r)N)!�__name__�
__module__�__qualname__rrrrrr/r0r�setr�orderZexplicitZ run_orderZ_accept_typeZkeep_line_orderZ
BM_compatiblerZpython_symbolsZsymsrr
rrrr"r&r-r.r2r3rrrr
rs2
rcs(eZdZdZ�fdd�Zdd�Z�ZS)�ConditionalFixNcstt|�j|�d|_dS)N)�superr9r2�_should_skip)r�args)� __class__rr
r2�szConditionalFix.start_treecCsJ|jdk r|jS|jjd�}|d}dj|dd��}t|||�|_|jS)N�.r���r?)r;�skip_on�split�joinr)rrZpkgr!rrr
�should_skip�s
zConditionalFix.should_skip)r4r5r6r@r2rC�
__classcell__rr)r=r
r9�sr9)
r/Zpatcomprr'rZ
fixer_utilr�objectrr9rrrr
�<module>s
?>