Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/lib2to3/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/lib2to3/__pycache__/pytree.cpython-37.opt-2.pyc

B

YI~d8m�@s�dZddlZddlmZdZiadd�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de�Z
d
d�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Zdd�ZdS)z#Guido van Rossum <guido@python.org>�N)�StringIOi���cCsHts<ddlm}x*|j��D]\}}t|�tkr|t|<qWt�||�S)N�)�python_symbols)�_type_reprsZpygramr�__dict__�items�type�int�
setdefault)Ztype_numr�name�val�r
�3/opt/alt/python37/lib64/python3.7/lib2to3/pytree.py�	type_reprsrc@s�eZdZdZdZdZdZdZdd�Zdd�Z	dZ
dd	�Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zdd�Zdd�Zd d!�Zejd"kr�d#d$�ZdS)%�BaseNr
FcOs
t�|�S)N)�object�__new__)�cls�args�kwdsr
r
rr1szBase.__new__cCs|j|jk	rtS|�|�S)N)�	__class__�NotImplemented�_eq)�self�otherr
r
r�__eq__6szBase.__eq__cCst�dS)N)�NotImplementedError)rrr
r
rrBs	zBase._eqcCst�dS)N)r)rr
r
r�cloneMsz
Base.clonecCst�dS)N)r)rr
r
r�
post_orderUszBase.post_ordercCst�dS)N)r)rr
r
r�	pre_order]szBase.pre_ordercCs�t|t�s|g}g}d}x:|jjD].}||krF|dk	r@|�|�d}q"|�|�q"W|j��||j_x|D]}|j|_qlWd|_dS)NFT)�
isinstance�list�parent�children�extend�append�changed)r�newZ
l_children�found�ch�xr
r
r�replacees



zBase.replacecCs.|}x"t|t�s&|jsdS|jd}qW|jS)Nr)r �Leafr#�lineno)r�noder
r
r�
get_lineno|szBase.get_linenocCs|jr|j��d|_dS)NT)r"r&�was_changed)rr
r
rr&�s
zBase.changedcCsJ|jrFx>t|jj�D].\}}||kr|j��|jj|=d|_|SqWdS)N)r"�	enumerater#r&)r�ir.r
r
r�remove�s

zBase.removec	CsZ|jdkrdSxFt|jj�D]6\}}||kry|jj|dStk
rPdSXqWdS)Nr)r"r1r#�
IndexError)rr2�childr
r
r�next_sibling�s
zBase.next_siblingcCsP|jdkrdSx<t|jj�D],\}}||kr|dkr8dS|jj|dSqWdS)Nrr)r"r1r#)rr2r5r
r
r�prev_sibling�s
zBase.prev_siblingccs"x|jD]}|��EdHqWdS)N)r#�leaves)rr5r
r
rr8�szBase.leavescCs|jdkrdSd|j��S)Nrr)r"�depth)rr
r
rr9�s
z
Base.depthcCs|j}|dkrdS|jS)N�)r6�prefix)rZnext_sibr
r
r�
get_suffix�szBase.get_suffix)�rcCst|��d�S)N�ascii)�str�encode)rr
r
r�__str__�szBase.__str__)�__name__�
__module__�__qualname__rr"r#r0Zwas_checkedrr�__hash__rrrrr+r/r&r3�propertyr6r7r8r9r<�sys�version_inforAr
r
r
rrs.
	


rc@s�eZdZddd�Zdd�Zdd�Zejdkr0eZd	d
�Z	dd�Z
d
d�Zdd�Ze
dd��Zejdd��Zdd�Zdd�Zdd�ZdS)�NodeNcCsR||_t|�|_x|jD]
}||_qW|dk	r4||_|rH|dd�|_nd|_dS)N)rr!r#r"r;�fixers_applied)rrr#�contextr;rJr)r
r
r�__init__�s


z
Node.__init__cCsd|jjt|j�|jfS)Nz
%s(%s, %r))rrBrrr#)rr
r
r�__repr__�sz
Node.__repr__cCsd�tt|j��S)Nr:)�join�mapr?r#)rr
r
r�__unicode__�szNode.__unicode__)r=rcCs|j|jf|j|jfkS)N)rr#)rrr
r
rr�szNode._eqcCst|jdd�|jD�|jd�S)NcSsg|]}|���qSr
)r)�.0r)r
r
r�
<listcomp>szNode.clone.<locals>.<listcomp>)rJ)rIrr#rJ)rr
r
rrsz
Node.cloneccs(x|jD]}|��EdHqW|VdS)N)r#r)rr5r
r
rrszNode.post_orderccs(|Vx|jD]}|��EdHqWdS)N)r#r)rr5r
r
rrszNode.pre_ordercCs|js
dS|jdjS)Nr:r)r#r;)rr
r
rr;szNode.prefixcCs|jr||jd_dS)Nr)r#r;)rr;r
r
rr;scCs(||_d|j|_||j|<|��dS)N)r"r#r&)rr2r5r
r
r�	set_child s
zNode.set_childcCs ||_|j�||�|��dS)N)r"r#�insertr&)rr2r5r
r
r�insert_child*szNode.insert_childcCs||_|j�|�|��dS)N)r"r#r%r&)rr5r
r
r�append_child3szNode.append_child)NNN)rBrCrDrLrMrPrGrHrArrrrrFr;�setterrSrUrVr
r
r
rrI�s 

	
	rIc@s�eZdZdZdZdZddgfdd�Zdd�Zdd	�Ze	j
d
krBeZdd�Zd
d�Z
dd�Zdd�Zdd�Zedd��Zejdd��ZdS)r,r:rNcCsF|dk	r|\|_\|_|_||_||_|dk	r4||_|dd�|_dS)N)�_prefixr-�columnr�valuerJ)rrrZrKr;rJr
r
rrLFsz
Leaf.__init__cCsd|jj|j|jfS)Nz
%s(%r, %r))rrBrrZ)rr
r
rrMYsz
Leaf.__repr__cCs|jt|j�S)N)r;r?rZ)rr
r
rrP_szLeaf.__unicode__)r=rcCs|j|jf|j|jfkS)N)rrZ)rrr
r
rrjszLeaf._eqcCs$t|j|j|j|j|jff|jd�S)N)rJ)r,rrZr;r-rYrJ)rr
r
rrns
z
Leaf.cloneccs
|VdS)Nr
)rr
r
rr8tszLeaf.leavesccs
|VdS)Nr
)rr
r
rrwszLeaf.post_orderccs
|VdS)Nr
)rr
r
rr{szLeaf.pre_ordercCs|jS)N)rX)rr
r
rr;szLeaf.prefixcCs|��||_dS)N)r&rX)rr;r
r
rr;�s)rBrCrDrXr-rYrLrMrPrGrHrArrr8rrrFr;rWr
r
r
rr,=s"
r,cCsN|\}}}}|s||jkr<t|�dkr.|dSt|||d�St|||d�SdS)Nrr)rK)Z
number2symbol�lenrIr,)ZgrZraw_noderrZrKr#r
r
r�convert�sr\c@sLeZdZdZdZdZdd�Zdd�Zdd�Zddd	�Z	dd
d�Z
dd
�ZdS)�BasePatternNcOs
t�|�S)N)rr)rrrr
r
rr�szBasePattern.__new__cCsLt|j�|j|jg}x|r.|ddkr.|d=qWd|jjd�tt|��fS)N���z%s(%s)z, )	rr�contentrrrBrNrO�repr)rrr
r
rrM�s
zBasePattern.__repr__cCs|S)Nr
)rr
r
r�optimize�szBasePattern.optimizecCsn|jdk	r|j|jkrdS|jdk	rRd}|dk	r4i}|�||�sDdS|rR|�|�|dk	rj|jrj|||j<dS)NFT)rr_�	_submatch�updater)rr.�results�rr
r
r�match�s


zBasePattern.matchcCs t|�dkrdS|�|d|�S)NrFr)r[rf)r�nodesrdr
r
r�	match_seq�szBasePattern.match_seqccs&i}|r"|�|d|�r"d|fVdS)Nrr)rf)rrgrer
r
r�generate_matches�szBasePattern.generate_matches)N)N)rBrCrDrr_rrrMrarfrhrir
r
r
rr]�s


r]c@s*eZdZddd�Zd	dd�Zd
dd�ZdS)�LeafPatternNcCs&|dk	r|dk	r||_||_||_dS)N)rr_r)rrr_rr
r
rrL�s
zLeafPattern.__init__cCst|t�sdSt�|||�S)NF)r r,r]rf)rr.rdr
r
rrf
s
zLeafPattern.matchcCs|j|jkS)N)r_rZ)rr.rdr
r
rrbs
zLeafPattern._submatch)NNN)N)N)rBrCrDrLrfrbr
r
r
rrj�s

rjc@s$eZdZdZddd�Zddd�ZdS)	�NodePatternFNcCsT|dk	r|dk	r>t|�}x$t|�D]\}}t|t�r"d|_q"W||_||_||_dS)NT)r!r1r �WildcardPattern�	wildcardsrr_r)rrr_rr2�itemr
r
rrL$s

zNodePattern.__init__cCs�|jrJx>t|j|j�D],\}}|t|j�kr|dk	r>|�|�dSqWdSt|j�t|j�krbdSx*t|j|j�D]\}}|�||�srdSqrWdS)NTF)rmrir_r#r[rc�ziprf)rr.rd�cre�
subpatternr5r
r
rrbAs

zNodePattern._submatch)NNN)N)rBrCrDrmrLrbr
r
r
rrk s
rkc@sZeZdZddedfdd�Zdd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)rlNrcCs@|dk	r$ttt|��}x|D]}qW||_||_||_||_dS)N)�tuplerOr_�min�maxr)rr_rsrtr�altr
r
rrLks
zWildcardPattern.__init__cCs�d}|jdk	r<t|j�dkr<t|jd�dkr<|jdd}|jdkr�|jdkr�|jdkrft|jd�S|dk	r�|j|jkr�|��S|jdkr�t|t�r�|jdkr�|j|jkr�t|j|j|j|j|j|j�S|S)Nrr)r)	r_r[rsrtrkrrar rl)rrqr
r
rra�s 
 


zWildcardPattern.optimizecCs|�|g|�S)N)rh)rr.rdr
r
rrf�szWildcardPattern.matchcCsRxL|�|�D]>\}}|t|�kr|dk	rF|�|�|jrFt|�||j<dSqWdS)NTF)rir[rcrr!)rrgrdrprer
r
rrh�s
zWildcardPattern.match_seqc	cs:|jdkrXxJt|jdtt|�|j��D]*}i}|jrH|d|�||j<||fVq(Wn�|jdkrp|�|�Vn�ttd�r�tj	}t
�t_	z�y@x:|�|d�D]*\}}|jr�|d|�||j<||fVq�WWnRtk
�rx:|�
|�D],\}}|j�r
|d|�||j<||fVq�WYnXWdttd��r4|t_	XdS)NrZ	bare_name�getrefcountr)r_�rangersr[rtr�_bare_name_matches�hasattrrG�stderrr�_recursive_matches�RuntimeError�_iterative_matches)rrg�countreZsave_stderrr
r
rri�s.
"

z WildcardPattern.generate_matchesccst|�}d|jkrdifVg}x>|jD]4}x.t||�D] \}}||fV|�||f�q8Wq(Wx�|�rg}x�|D]�\}}	||krr||jkrrxn|jD]d}x^t|||d��D]H\}
}|
dkr�i}|�|	�|�|�||
|fV|�||
|f�q�Wq�WqrW|}qbWdS)Nr)r[rsr_rir%rtrc)rrgZnodelenrdrurpreZnew_results�c0�r0�c1�r1r
r
rr}�s*




z"WildcardPattern._iterative_matchescCsvd}i}d}t|�}xF|sZ||krZd}x0|jD]&}|d�|||�r.|d7}d}Pq.WqW|d|�||j<||fS)NrFTr)r[r_rfr)rrgr~reZdonertZleafr
r
rrx�s
z"WildcardPattern._bare_name_matchesc	cs�||jkrdifV||jkr�xr|jD]h}xbt||�D]T\}}xJ|�||d�|d�D].\}}i}|�|�|�|�|||fVqXWq6Wq&WdS)Nrr)rsrtr_rir{rc)	rrgr~rurr�r�r�rer
r
rr{
s


"

z"WildcardPattern._recursive_matches)N)N)rBrCrD�HUGErLrarfrhrir}rxr{r
r
r
rrl]s#

-rlc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�NegatedPatternNcCs|dk	r||_dS)N)r_)rr_r
r
rrLs	zNegatedPattern.__init__cCsdS)NFr
)rr.r
r
rrf(szNegatedPattern.matchcCst|�dkS)Nr)r[)rrgr
r
rrh,szNegatedPattern.match_seqccsL|jdkr"t|�dkrHdifVn&x|j�|�D]
\}}dSWdifVdS)Nr)r_r[ri)rrgrprer
r
rri0s
zNegatedPattern.generate_matches)N)rBrCrDrLrfrhrir
r
r
rr�s

r�c	cs�|sdifVn�|d|dd�}}xl|�|�D]^\}}|sJ||fVq2xDt|||d��D].\}}i}|�|�|�|�|||fVq^Wq2WdS)Nrr)rirc)	Zpatternsrg�p�restrr�r�r�rer
r
rri<s


ri)�
__author__rG�iorr�rrrrrIr,r\r]rjrkrlr�rir
r
r
r�<module>
s"
1nNV,==#

Hacked By AnonymousFox1.0, Coded By AnonymousFox