Your IP : 3.149.240.101


Current Path : /opt/alt/python34/lib64/python3.4/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/__pycache__/sre_compile.cpython-34.pyo

�
e f�M�@sxdZddlZddlZddlTddlmZejdkrPdZndZeee	g�Z
eeee
g�Zeeeg�Zeeeg�ZdWZd)d*�eD�Zd+d,�Zddd-d.�Zd/d0�Zd1d2�Zejd3Zd4d5d6Zeed7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$ddEdF�Z%dS)XzInternal support module for sre�N)�*)�	MAXREPEAT�i��l���i�1�s����E����������������������������������a�����cs?i|]5}|D](�t�fdd�|D����qqS)c3s!|]}�|kr|VqdS)N�)�.0�j)�ir&�0/opt/alt/python34/lib64/python3.4/sre_compile.py�	<genexpr>Csz<dictcomp>.<genexpr>)�tuple)r'�tr&)r)r*�
<dictcomp>Cs	r.cCsj|j}t}t}t}t}t}|t@rO|t@rO|t@rOt	}	nd}	x|D]\}
}|
|krv|t@r[t
j||�}|	r<||	kr<|tt
�||�}
|d�|
tkr�|tt�nx1|f|	|D]}|tt�||�q�W|tt�||�|
||
<qs|tt|
�||�qb|t|
�||�q\|
tkr|t@r�|tt|
�|dd�}n|t|
�d}||�}
|d�t|||||	�||�|
||
<q\|
tkr?|t@r.|tt�qb|tt�q\|
|kr�|t@rdtd��qbt|�r|
tk	r|
tkr�|tt�n|tt�||�}
|d�||d�||d�t||d|�|tt �||�|
||
<qb|tt�||�}
|d�||d�||d�t||d|�||�|
||
<|
tkr�|tt!�qb|tt"�q\|
t#kr1|dr�|tt$�||ddd�nt||d|�|drb|tt$�||dddd�qbq\|
|krN|t|
�q\|
|kr|t|
�||�}
|d�|ddkr�|d�n;|dj%�\}}||kr�td��n||�t||d|�|tt �||�|
||
<q\|
t&krt|t|
�||�}
|d�t|||�|tt �||�|
||
<q\|
t'kr�|t|
�|t(@r�t)j*||�}n|t@r�t+j*||�}n|t@r�t,j*||�}n|t-|�q\|
t.kr�|t|
�g}|j}xt|dD]h}||�}
|d�t|||�|tt/�|||��|d�||�|
||
<q0W|d�x�|D]}||�|||<q�Wq\|
t0kr'|t|
�|t@r�t1|}n|t@rt2|}n|t3|�q\|
t4krq|t@rR|tt|
�n|t|
�||d�q\|
t5krS|t|
�||dd�||�}|d�t||d|�|dr8|tt/�||�}|d�||�|d||<t||d|�||�|||<qb||�|d||<q\t6d|
��q\WdS)	NrcSstj||�S)N)�_sre�getlower)�literal�flagsr&r&r*�fixupksz_compile.<locals>.fixupz'internal: unsupported template operator�rz(look-behind requires fixed-width patternzunsupported operand type)7�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_ignorecase_fixesr/r0�OPCODES�	IN_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�	OP_IGNORE�IN�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�REPEAT�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARK�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�ATCODES�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�CHCODES�GROUPREF�GROUPREF_EXISTS�
ValueError)�code�patternr2�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�fixes�op�av�lo�skip�kr3�hi�tail�
tailappend�skipyes�skipnor&r&r*rRFs*	

	











 






	











rRcCsE|j}x't||||t@�D]\}}|t|�|tkrLq#|tkre||�q#|tkr�||d�||d�q#|tkr�|j|�q#|t	kr�|j|�q#|t
kr#|t@r�|tt
|�q/|t@r|tt|�q/|t|�q#td��q#W|tt�dS)Nrr4z"internal: unsupported set operator)r5�_optimize_charsetr=r?rBrC�RANGE�CHARSET�extend�
BIGCHARSETrcr<rfrdrerLrD)�charsetr2rjr3rrrlrsrtr&r&r*rG�s.	


rGcCs�g}g}td�}xk|D]c\}}xTyZ|tkr�|r�||�}	d||	<|r�|	|kr�x||	D]}
d||
<qvWq�q�d||<n�|tkrRt|d|dd�}|r�t||�}n|r4|r4xd|D]>}	d||	<|	|kr�x||	D]}
d||
<qWq�q�Wq�xP|D]}	d||	<q;Wn5|tkrt|j||f�n|j||f�Wn�tk
r|t|�dkr�|dd7}w.n|re|re|tkre|\}}
|g}t	t
d|�td|
�||�xe|D]G\}}
||
krE|jt|
f�q|jt||
ff�qWn|j||f�YnXPq.WqWg}d}x�|jd|�}|dkr�Pnt|�dkr�d}Pn|jd|�}|dkr|j|t|�f�Pn|j||f�q�W|dk	r�xW|D]O\}}||dkrj|jt|f�q8|jt||dff�q8W||7}|s�t|�t|�kr�|S|St|�dkr�t
|�}|jt|f�||7}|St|�}i}td�}d}t�}xytddd�D]e}	||	|	d�}||kru||||	d<q:|||	d<||<|d7}||7}q:Wt
|�}|gt|�|dd�<|jt|f�||7}|S)	N�r4rsi�ii�r)�	bytearrayrCr~�range�maprBr5�
IndexErrorr6�_fixup_range�max�min�find�
_mk_bitmapr�bytes�_bytes_to_codesr�)r�r3rr�	isunicode�outry�charmaprsrtr)rw�rrurx�ranges�runs�q�p�data�comps�mapping�block�chunkr&r&r*r}�s�





	
 	!

	

r}cCs�x�t|t||d��D]�}x�t|�D]�\}\}}||kr�t|dkrq||f||<n|j|||f�Pq0||kr�||dkr�||f||<Pq�q0Pq0W|j||f�qWdS)Nr4)r�r��	enumerate�l�insertr5)rurxr�r3r)rwr&r&r*r��s#r���0�1�csL|jt�ddd�����fdd�tt��d��D�S)Nr4cs-g|]#}��|�|�d��qS)rr&)r'r))�	_CODEBITS�_int�sr&r*�
<listcomp>�s	z_mk_bitmap.<locals>.<listcomp>r���)�	translate�_BITS_TRANSr�r6)�bitsr�r�r&)r�r�r�r*r��sr�cCst|�jd�}|j�S)N�I)�
memoryview�cast�tolist)�b�ar&r&r*r��sr�cCsH|dj�\}}||ko-dknoG|dddtkS)Nrr4r)rXrV)rtrurxr&r&r*rM�srMcCs�dgt|�}x|tdt|��D]e}||d}xN||||kr|dkrnd||<Pn||d}q@W|d||<q)W|S)aj
    Generate an overlap table for the following prefix.
    An overlap table is a table of the same size as the prefix which
    informs about the potential self-overlap for each index in the prefix:
    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
      prefix[0:k]
    rr4)r6r�)�prefix�tabler)�idxr&r&r*�_generate_overlap_table�s	
r�cCs�|j�\}}|dkr"dSg}|j}d}g}|j}	|t@sfx�|jD]�\}
}|
tkr�t|�|kr�|d}n||�qZ|
tkr�t|d�dkr�|dd\}
}|
tkr�||�q�PqZPqZW|rf|jrf|jd\}
}|
tkr�|dr�|dd\}
}|
tkrb|	|
|f�q`|
tkr`g}|j}
xU|dD]@}|s�Pn|d\}
}|
tkr�|
|
|f�q�Pq�W|}q`qc|
tkrKg}|j}
xj|dD]@}|sPn|d\}
}|
tkr=|
|
|f�q�Pq�W|}qc|
tkrc|}qcqfn|j}|t	t
�t|�}|d�d}|r�t}t|�|ko�t|j�knr�|t}q�n|r�|t
}n||�|tkr||�n|t�|dt�}|tkrI||�n
|d�|r�|t|��||�|j|�|jt|��n|r�t|||�nt|�|||<dS)Nrr4)rXr5r;r�rCr6rVrarFr?�INFO�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�MAXCODEr�r�rG)rjrkr2rurxr��prefixappend�prefix_skipr��
charsetappendrsrt�c�cappendr�rlrv�maskr&r&r*�
_compile_info�s�		


"
				
+







r�cCst|ttf�S)N)�
isinstance�strr�)�objr&r&r*�isstring!sr�cCsN|jj|B}g}t|||�t||j|�|jtt�|S)N)rkr2r�rRr�r5r?rS)r�r2rjr&r&r*�_code$sr�cCs�t|�r'|}tj||�}nd}t||�}|jjdkr]td��n|jj}dg|jj}x$|j�D]\}}|||<q�Wt	j
|||jjB||jjd||�S)N�dz6sorry, but this version only supports 100 named groupsr4)r��	sre_parse�parser�rk�groups�AssertionError�	groupdict�itemsr/�compiler2)r�r2rkrj�
groupindex�
indexgrouprwr)r&r&r*r�3s 
r��rr�rr�r	r
�rrr
�rr�rr�rr�rr�rr�rr�rr�rr�rr�r r!�r"r#�r$r%)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)&�__doc__r/r��
sre_constantsr�CODESIZEr��setrCrAr7rN�
MIN_REPEATrOr8rSrDr9�ASSERT�
ASSERT_NOTr:�
_equivalencesr>rRrGr}r�r�r��intr�r�rMr�r�r�r�r�r&r&r&r*�<module>sV
		
��
e

?>