HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //opt/alt/python37/lib64/python3.7/lib2to3/__pycache__/btm_matcher.cpython-37.opt-2.pyc
B

�(��4T�@shdZddlZddlZddlmZddlmZddlmZGdd�de	�Z
Gd	d
�d
e	�Ziadd�Z
dS)
z+George Boutsioukis <[email protected]>�N)�defaultdict�)�pytree)�reduce_treec@seZdZe��Zdd�ZdS)�BMNodecCs"i|_g|_ttj�|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content)�self�r�8/opt/alt/python37/lib64/python3.7/lib2to3/btm_matcher.py�__init__szBMNode.__init__N)�__name__�
__module__�__qualname__�	itertoolsrrrrrrrsrc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�
BottomMatchercCs0t�|_t�|_|jg|_g|_t�d�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZlogger)rrrrrs

zBottomMatcher.__init__cCsL|j�|�t|j�}|��}|j||jd�}x|D]}|j�|�q4WdS)N)�start)r	�appendrZpattern_treeZget_linear_subpattern�addr)r�fixerZtreeZlinear�match_nodesZ
match_noderrr�	add_fixer%s

zBottomMatcher.add_fixerc	Cs�|s
|gSt|dt�rhg}xF|dD]:}|j||d�}x&|D]}|�|�|dd�|��q>Wq&W|S|d|jkr�t�}||j|d<n|j|d}|dd�r�|j|dd�|d�}n|g}|SdS)Nr)rr)�
isinstance�tupler�extendrr)r�patternrrZalternativeZ	end_nodes�endZ	next_noderrrr1s"
"zBottomMatcher.addc	Cs|j}tt�}x�|D]�}|}x�|r�d|_x,|jD]"}t|tj�r0|jdkr0d|_Pq0W|j	dkrh|j}n|j	}||j
kr�|j
|}xj|jD]}||�|�q�WnL|j}|j
dk	r�|j
jr�P||j
kr�|j
|}x|jD]}||�|�q�W|j
}qWqW|S)NT�;Fr)rr�listZwas_checkedZchildrenr!rZLeaf�value�typerr	r�parent)	rZleavesZcurrent_ac_node�resultsZleafZcurrent_ast_nodeZchildZ
node_tokenrrrr�runSs6






zBottomMatcher.runcs*td��fdd���|j�td�dS)Nz
digraph g{cs^xX|j��D]J}|j|}td|j|jt|�t|j�f�|dkrNt|j��|�qWdS)Nz%d -> %d [label=%s] //%sr)r�keys�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode)�
print_noderrr1�s

z*BottomMatcher.print_ac.<locals>.print_node�})r.r)rr)r1r�print_ac�s
zBottomMatcher.print_acN)rrrrr rr,r3rrrrrs
"8rcCsHts<ddlm}x*|j��D]\}}t|�tkr|t|<qWt�||�S)Nr)�python_symbols)�_type_reprsZpygramr4�__dict__�itemsr)�int�
setdefault)Ztype_numr4�name�valrrrr/�sr/)�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr5r/rrrr�<module>s