Your IP : 18.223.241.235


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/sre_parse.cpython-35.opt-2.pyc



���]-��@s�ddlTdZdZed�Zed�Zed�Zed�Zed�Zee	e
h�Zeee
eeeeh�Zd	eed
�fdeed�fd
eed�fdeed�fdeed�fdeed�fdeed�fdeed�fiZdeefdeefdeefdeeefgfdeeefgfdeeefgfdeeefgfdeeefgfd eeefgfd!eefi
Z d"e!d#e"d$e#d%e$d&e%d'e&d(e'd)e(iZ)Gd*d+�d+�Z*Gd,d-�d-�Z+Gd.d/�d/�Z,d0d1�Z-d2d3�Z.d4d5�Z/d6d7�Z0d8d9�Z1d:d;�Z2d<d=�Z3d>d?�Z4d@dA�Z5ddBdCdD�Z6dEdF�Z7dGdH�Z8dBS)I�)�*z.\[{()*+?^$|z*+?{�
0123456789�01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

z\a�z\b�z\f�z\n�
z\r�
z\t�	z\v�z\\�\z\Az\Bz\dz\Dz\sz\Sz\wz\Wz\Z�i�L�m�s�x�a�t�uc@saeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�PatterncCs+d|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups)�self�r�./opt/alt/python35/lib64/python3.5/sre_parse.py�__init__Fs		zPattern.__init__cCs
t|j�S)N)�lenr)rrrr�groupsKszPattern.groupsNcCs�|j}|jjd�|jtkr4td��|dk	r�|jj|d�}|dk	rztd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)rr�append�	MAXGROUPS�errorr�get)r�name�gid�ogidrrr�	opengroupNs	
zPattern.opengroupcCs|j�|j|<dS)N)�getwidthr)rr%�prrr�
closegroupZszPattern.closegroupcCs ||jko|j|dk	S)N)rr)rr%rrr�
checkgroup\szPattern.checkgroupcCsO|jdk	rK|j|�s-|jd��||jkrK|jd��dS)Nzcannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr+r")rr%�sourcerrr�checklookbehindgroup_s
zPattern.checklookbehindgroup)
�__name__�
__module__�__qualname__r�propertyrr'r*r+r-rrrrrDsrc@s�eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs1||_|dkrg}||_d|_dS)N)�pattern�data�width)rr3r4rrrris
		zSubPattern.__init__rcCsd}ttf}x�|jD]�\}}t|dt|�dd�|tkr�t�x�|D]+\}}t|ddt|�|�q`Wq|tkr�t�xTt|d�D]5\}}|r�t|dd�|j|d�q�Wq|t	krW|\}}	}
td|�|	j|d�|
r�t|dd�|
j|d�qt
||�r�d}xp|D]h}t
|t�r�|s�t�|j|d�d}qs|s�td	dd�t|dd�d}qsW|s�t�qtd|�qWdS)
NTz  �end���OR�ELSEF� )�tuple�listr4�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer2)r�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrCosH&

	

zSubPattern.dumpcCs
t|j�S)N)�reprr4)rrrr�__repr__�szSubPattern.__repr__cCs
t|j�S)N)rr4)rrrr�__len__�szSubPattern.__len__cCs|j|=dS)N)r4)r�indexrrr�__delitem__�szSubPattern.__delitem__cCs1t|t�r&t|j|j|�S|j|S)N)rE�slicer2r3r4)rrQrrr�__getitem__�szSubPattern.__getitem__cCs||j|<dS)N)r4)rrQ�coderrr�__setitem__�szSubPattern.__setitem__cCs|jj||�dS)N)r4�insert)rrQrUrrrrW�szSubPattern.insertcCs|jj|�dS)N)r4r )rrUrrrr �szSubPattern.appendc	Cs�|jdk	r|jSd}}x5|jD]*\}}|tkr�td}d}xB|dD]6}|j�\}}t||�}t||�}q]W||}||}q*|tkr�|j�\}}||}||}q*|tkr|dj�\}}||}||}q*|t	kre|dj�\}}|||d}|||d}q*|t
kr�|d}|d}q*|tkr�|jj
|\}}||}||}q*|tkrG|dj�\}}|ddk	r*|dj�\}}t||�}t||�}nd}||}||}q*|tkr*Pq*Wt|td�t|t�f|_|jS)Nrr8�)r5r4rA�	MAXREPEATr(�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr3rrD�SUCCESS)	r�lo�hirIrJr
�j�l�hrrrr(�sZ













%zSubPattern.getwidth)
r.r/r0rrCrOrPrRrTrVrWr r(rrrrr2gs(r2c@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�ZdS)�	TokenizercCs\t|t�|_||_|js3t|d�}||_d|_d|_|j�dS)N�latin1r)rEr?�istext�string�decoded_stringrQ�next�_Tokenizer__next)rrjrrrr�s					zTokenizer.__init__cCs�|j}y|j|}Wntk
r;d|_dSYnX|dkr�|d7}y||j|7}Wn7tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr8zbad escape (end of pattern))rQrk�
IndexErrorrlr"rjr)rrQ�charrrr�__next�s	
		

$
zTokenizer.__nextcCs!||jkr|j�dSdS)NTF)rlrm)rrorrr�match�s
zTokenizer.matchcCs|j}|j�|S)N)rlrm)r�thisrrrr#�s	
z
Tokenizer.getcCsKd}x>t|�D]0}|j}||kr/P||7}|j�qW|S)Nr7)�rangerlrm)r�n�charset�result�_�crrr�getwhile�s	
zTokenizer.getwhilecCs�d}x�|j}|j�|dkrY|s=|jd��|jd|t|���||kr~|s}|jdd��P||7}q	W|S)Nr7zmissing group namezmissing %s, unterminated namer8)rlrmr"r)r�
terminatorrvrxrrr�getuntils	

zTokenizer.getuntilcCs|jt|jpd�S)Nr7)rQrrl)rrrr�tellszTokenizer.tellcCs||_|j�dS)N)rQrm)rrQrrr�seeks	zTokenizer.seekrcCst||j|j�|�S)N)r"rjr|)r�msg�offsetrrrr"szTokenizer.errorN)r.r/r0rrmrqr#ryr{r|r}r"rrrrrg�s		rgcCsdddl}|jdtdd�d|ko9dknpcd|koUdknpc|d	kS)
Nrz*sre_parse.isident() will be removed in 3.5�
stacklevelrXr�z�A�Zrw)�warnings�warn�DeprecationWarning)ror�rrr�isident s	
r�cCs:ddl}|jdtdd�d|ko7dkSS)Nrz*sre_parse.isdigit() will be removed in 3.5r�rX�0�9)r�r�r�)ror�rrr�isdigit&s	
r�cCssddl}|jdtdd�t|d�s6dSx6|dd�D]$}t|�rGt|�rGdSqGWdS)Nrz)sre_parse.isname() will be removed in 3.5r�rXFr8T)r�r�r�r�r�)r$r�rorrr�isname,s	
r�cCs�tj|�}|r|Stj|�}|rB|dtkrB|SyX|dd�}|dkr�||jdt�7}t|�dkr�|jd|t|���tt	|dd�d�fS|dkr8|j
r8||jdt�7}t|�d	kr|jd|t|���tt	|dd�d�fS|d
kr�|j
r�||jdt�7}t|�dkr�|jd|t|���t	|dd�d�}t|�t|fS|tkr+||jdt�7}t	|dd�d�}|d
kr!|jd|t|���t|fS|t
kr=t�t|�dkr�|tkr�ddl}|jd|td|d	�tt|d�fSWntk
r�YnX|jd|t|���dS)Nrr8rXr�zincomplete escape %s�r��U��
�z.octal escape value %s outside of range 0-0o377z
bad escape %sr�)�ESCAPESr#�
CATEGORIESr@ry�	HEXDIGITSrr"�LITERAL�intri�chr�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERSr�r�r��ord)r,�escape�nestedrUrxr�rrr�
_class_escape8sV

	


r�cCs�tj|�}|r|Stj|�}|r2|SyK|dd�}|dkr�||jdt�7}t|�dkr�|jd|t|���tt|dd�d�fS|dkr(|j	r(||jdt�7}t|�dkr|jd|t|���tt|dd�d�fS|d	kr�|j	r�||jd
t�7}t|�dkr�|jd|t|���t|dd�d�}t
|�t|fS|dkr�||jdt�7}tt|dd�d
�fS|tkr |j
tkr�||j�7}|dtkr�|dtkr�|j
tkr�||j�7}t|dd�d
�}|d
kr�|jd|t|���t|fSt|dd��}||jkr|j|�s�|jdt|���|j||�t|fS|jdt|���t|�dkr||tkrhddl}|jd|td|d�tt|d�fSWntk
r�YnX|jd|t|���dS)Nr8rXrr�zincomplete escape %sr�rr�r�r�r�r�r�z.octal escape value %s outside of range 0-0o377zcannot refer to an open groupzinvalid group referencerz
bad escape %sr�)r�r#r�ryr�rr"r�r�rir�r�r�rlrr+r-r`r�r�r�r�r�r�)r,r��stater�rUrx�groupr�rrr�_escapejsr

 	
	


r�cCslg}|j}|j}|j�}x+|t|||d��|d�s'Pq'Wt|�dkrl|dSt|�}|j}xrd}	xd|D]7}
|
s�P|	dkr�|
d}	q�|
d|	kr�Pq�Wx|D]
}
|
d=q�W||	�q�Pq�WxV|D]-}
t|
�dks)|
ddtk	r�Pq�W|tdd�|D�f�|S|jtd|ff�|S)Nr8�|rcSsg|]}|d�qS)rr)�.0�itemrrr�
<listcomp>�s	z_parse_sub.<locals>.<listcomp>)	r rqr|�_parserr2r�r@rA)r,r�r��items�itemsappend�sourcematch�start�
subpattern�subpatternappend�prefixr�rrr�
_parse_sub�sB			




&r�cCs�t|||d�}|jd�r\t|||d�}|jdkrb|jd��nd}t|�}|jt|||ff�|S)Nr8r�z/conditional backref with more than two branches)r�rqrlr"r2r rD)r,r�rKr�rLrMr�rrr�_parse_sub_cond�sr�c#Cs�
t|�}|j}|j}|j}t}t}|jt@}	x�
|j}
|
dkrYP|
dkrfP|�|	r�|
t	kr�qC|
dkr�x&|�}
|
dks�|
dkr�Pq�WqC|
ddkr�t
||
||d�}||�qC|
tkr|t||
�f�qC|
dkrJ|j
�d}g}
|
j}|d�r\|tdf�|
dd�}x<|�}
|
dkr�|jd	|j
�|��|
d
kr�|
|kr�Pn;|
ddkr�t||
|d�}nt||
�f}|d�r|�}|dkr4|jd	|j
�|��|d
kr|dtkr^|dd}||�|t|d�f�P|ddkr�t|||d�}nt||�f}|dtks�|dtkrd|
|f}|j|t|
�dt|���|d}|d}||krfd|
|f}|j|t|
�dt|���|t||ff�qo|dtkr�|dd}||�qoW||
�dkr�|
ddtkr�||
d�q�
||
�d
kr7|
ddtkr7|
ddtkr7|t|
ddf�q�
|t|
f�qC|
tkr|j
�}|
dkr}d4\}}n�|
dkr�dt}}n�|
dkr�dt}}nj|
dkr|jdkr�|t||
�f�qCdt}}d}}x |jtkr"||�7}qW|d�rUx)|jtkrQ||�7}q2Wn|}|d�s�|t||
�f�|j|�qC|r�t|�}|tkr�td��|rt|�}|tkr�td��||kr|jd|j
�|��ntd|f��|r8|d5d�}nd}|sk||�dkr�|ddtkr�|jd|j
�|t|
���|ddtkr�|jd|j
�|t|
���|d�r�t|||ff|d6<q�
t|||ff|d7<qC|
dkr.|tdf�qC|
dkr�
|j
�d}d}d}d}|d�r�|�}|dkr�|jd��|dkr	|d�r�|j d �}|j!�s	d!|}|j|t|�d��q�|d"�r�|j d#�}|j!�s5d!|}|j|t|�d��|j"j|�}|dkryd$|}|j|t|�d��|j#|�s�|jd%t|�d��|j$||�|t%|f�qCq�|�}|dkr�|jd��|jd&|t|�d
��n}|d'kr&	d}nh|dkrz	x?|jdkr`	|jd(|j
�|��|�d#kr5	Pq5	WqCn|d)kr�
d}|dkr
|�}|dkr�	|jd��|d*kr�	|jd+|t|�d
��d8}|j&}|dkr
|j'|_&t(|||d�} |dkrF
|dkrF
d|_&|d#�sn
|jd,|j
�|��|d"kr�
|t)|| ff�qC|t*|| ff�qCn�|dkr�|j d#�}!d}|!j!�r#|j"j|!�}|dkr�d$|!}|j|t|!�d��n�y"t|!�}|dkrDt+�Wn;t+k
r�d!|!}|j|t|!�d�d�YnX|s�|jd-t|!�d��|t,kr�|jd.t|!�d��|j$||�n�|t-krnxl|jt-|O_|�}|dkr&|jd/��|d#kr3P|t-kr�|jd0t|���q�W|jt@}	qCn |jd1|t|�d��|dk	r�y|j.|�}WnGtk
r�}"z'|j|"j/t|�d�d�WYdd}"~"XnX|r
t0||||d�} nt(|||d�} |jd#�sZ
|jd,|j
�|��|dk	rv
|j1|| �|t2|| ff�qC|
dkr�
|tt3f�qC|
d2kr�
|jtt4f�qCtd3|f��qCW|S)9Nz|)�#rrrr8�[�^zunterminated character set�]�-zbad character range %s-%srX�?r�+�{�}r7�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rznothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>zbad character in group name %r�=�)zunknown group name %rzcannot refer to an open groupzunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberzinvalid group referencez	missing )zunknown flagzunknown extension ?�$z unsupported special character %r)rr8���r�r�r�)5r2r r#rqrr�r�SRE_FLAG_VERBOSErl�
WHITESPACEr��
SPECIAL_CHARSr�r|�NEGATEr"r�r@�RANGE�NOT_LITERAL�REPEAT_CHARSrYr�r}r��
OverflowError�AssertionError�ATr^�
MIN_REPEAT�
MAX_REPEAT�ANYr{�isidentifierrr+r-r`rrr��ASSERT�
ASSERT_NOTr�r!�FLAGSr'r~r�r*r]�AT_BEGINNING�AT_END)#r,r�r�r�r��	sourcegetr��_len�_ord�verboserrrU�here�set�	setappendr��code1�that�code2r~rbrcrZr[ror�r�r$rKr%�dirrr)�condname�errrrrr��s�			
		
					
 &

&&:


	-			


		
			
			



$			

5	r�cCs�t|t�rk|t@r;ddl}|jdtdd�|t@sR|tO}q�|t@r�td��nL|t@r�td��|t@r�|t@r�ddl}|jdtdd�|S)NrzELOCALE flag with a str pattern is deprecated. Will be an error in 3.6r�r�z(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz@ASCII and LOCALE flags are incompatible. Will be an error in 3.6)	rEr?�SRE_FLAG_LOCALEr�r�r��SRE_FLAG_ASCII�SRE_FLAG_UNICODEr�)�srcrr�rrr�	fix_flagss 
	




	
r�NcCs�t|�}|dkr!t�}||_||_t||d�}t||jj�|j_|jdk	r~|jd��|t	@r�|jjt	@r�t
||jj�S|t@r�|j�|S)Nrzunbalanced parenthesis)
rgrrr?r�r�r3rlr"r��parse�SRE_FLAG_DEBUGrC)r?rr3r,r)rrrr�3s			

r�c
s�t|�}|j}g�g�g��j}���fdd�}|j}x|�}|dkrjP|ddkrN|d}|dkr�d}	|jd�s�|jd	��|jd
�}	|	j�ry||	}
Wq�tk
rt	d|	��Yq�Xn�y"t
|	�}
|
dkr&t�Wn5tk
r^|jd|	t|	�d�d�YnX|
t
kr�|jd
t|	�d��||
�qX|dkr|jtkr�||�7}|jtkr�||�7}|tt
|dd�d�d@��qX|tkr�d}|jtkr�||�7}|tkr�|dtkr�|jtkr�||�7}d}t
|dd�d�}|dkr�|jd|t|���|t|��|sK|t
|dd���qXytt|d�}WnDtk
r@|tkr<ddl}|jd|tdd�YnX||�qT||�qTW�rx�jdj���t|t�s�dd��D����fS)NcsS�r)�jdj����dd�=�jt��|f��jd�dS)Nr7)r �joinr)rQ)r�literal�literalsrr�addgroupWs

z parse_template.<locals>.addgrouprrr8�gr7r�z	missing <r�zunknown group name %rzbad character in group name %rzinvalid group referencer�r�r�FrXTz.octal escape value %s outside of range 0-0o377z
bad escape %sr�r�cSs1g|]'}|dkrdn|jd��qS)Nzlatin-1)�encode)r�rrrrr��s	z"parse_template.<locals>.<listcomp>)rgr#r �
groupindexrqr"r{r��KeyErrorrnr�r�rr!rlr�r�r�r�r�r�r�r�r�rEr?)
r,r3r�sget�lappendr�r�rrrxr$rQ�isoctalr�r)rr�r�r�parse_templateNs�				




	


*

	


r�cCs�|j}|jdd�}|\}}|dd�}y1x*|D]"\}}||�p]|||<qBWWntk
r�td��YnX|j|�S)Nrzinvalid group reference)r�rjrnr"r�)�templaterqr��emptyrr�rQr�rrr�expand_template�s	
r�)9�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�r^r�r�r@r�r��CATEGORYr_r�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr��SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r��SRE_FLAG_TEMPLATEr�r�rr2rgr�r�r�r�r�r�r�r�r�r�r�r�rrrr�<module>sf
#qH2C2�3U

?>