�`^c@sSdZddlZddlZddlZddlTejdkrLdZndZd�Zee e
g�Zeee
eg�Zeeeg�Zeeeg�Zd�Zdd �Zd
�Zd�Zd�Zd
�Zd�ZyeWn ek
re d�fZ!nXe d�e ed��fZ!d�Z"d�Z#dd�Z$dS(sInternal support module for srei�N(t*ii�l�cCs|S(N((tx((s!/sys/lib/python2.7/sre_compile.pyt_identityfunctionscCs�|j}t}t}t}t}t}x�|D]�\} }
| |kr�|t@r{|tt| �|t j
|
|��q�t| �||
�q.| tkr!|t@r�|tt| �|d�}n|t| �t}||�}|d�t
|
|||�||�|||<q.| tkrY|t@rH|tt�q�tt�q.| |kr5|t@r�d�|tt�||�}|d�||
d�||
d�t||
d|�|tt�||�|||<q�|
�r�| tk r�| tkr&|tt�n|tt�||�}|d�||
d�||
d�t||
d|�|tt�||�|||<q�tt�||�}|d�||
d�||
d�t||
d|�||�|||<| tkr$|tt�q�tt�q.| tkr�|
drr|tt�||
ddd�nt||
d|�|
dr�tt�||
dddd�q�.| |kr�|t| �q.| |kr�|t| �||�}|d�|
ddkr(|d�n8|
dj�\}
}|
|krVtd�n||
�t||
d|�|tt�||�|||<q.| tkr�t| �||�}|d�t||
|�|tt�||�|||<q.| t kr�|t| �|t!@r7t"j#|
|
�}
n|t$@rVt%j#|
|
�}
n|t&@rut'j#|
|
�}
n|t(|
�q.| t)krX|t| �g}|j}xt|
dD]h}
||�}|d�t||
|�|tt*�|||��|d�||�|||<q�W|d�x�|D]}||�|||<q7Wq.| t+kr�|t| �|t$@r�t,|
}
n|t&@r�t-|
}
n|t.|
�q.| t/kr�t@r�|tt| �n|t| �||
d�q.| t0kr�|t| �||
dd�||�}|d�t||
d|�|
dr�|tt*�||�}|d�||�|d||<t||
d|�||�|||<q�|�|d||<q.t1d| f�q.WdS(NcSstj||�S(N(t_sretgetlower(tliteraltflags((s!/sys/lib/python2.7/sre_compile.pytfixup3sis'internal: unsupported template operatoriis(look-behind requires fixed-width patternsunsupported operand type(2tappendtlent_LITERAL_CODESt_REPEATING_CODESt_SUCCESS_CODESt
_ASSERT_CODEStSRE_FLAG_IGNORECASEtOPCODESt OP_IGNORERRtINRt_compile_charsettANYtSRE_FLAG_DOTALLtANY_ALLtSRE_FLAG_TEMPLATEterrortREPEATt_compiletSUCCESSt_simplet
MAX_REPEATt
REPEAT_ONEtMIN_REPEAT_ONEt MAX_UNTILt MIN_UNTILt
SUBPATTERNtMARKtgetwidthtCALLtATtSRE_FLAG_MULTILINEtAT_MULTILINEtgettSRE_FLAG_LOCALEt AT_LOCALEtSRE_FLAG_UNICODEt
AT_UNICODEtATCODEStBRANCHtJUMPtCATEGORYt CH_LOCALEt
CH_UNICODEtCHCODEStGROUPREFtGROUPREF_EXISTSt
ValueError(tcodetpatternRtemitt_lent
LITERAL_CODEStREPEATING_CODESt
SUCCESS_CODEStASSERT_CODEStoptavRtskiptlothittailt
tailappendtskipyestskipno((s!/sys/lib/python2.7/sre_compile.pyR s
cCs_|j}|dkrt}nx,t||�D]\}}|t|�|tkrWq.|tkrv|||��q.|tkr�|||d��|||d��q.|tkr�|j |�q.|t
kr�j |�q.|tkr@|t@r|t
t|�qI|t@r/|t
t|�qI|t
|�q.td�q.W|tt�dS(Niis"internal: unsupported set operator(RtNoneRt_optimize_charsetRtNEGATEtLITERALtRANGEtCHARSETtextendt
BIGCHARSETR0R)R3R1R+R2RtFAILURE(tcharsetRR7RR9R?R@((s!/sys/lib/python2.7/sre_compile.pyR�s0
cCs/g}|j}dgd}y�x�|D]�\}}|tkrQ|||f�q&|tkrpd|||�<q&|tkr�xLt||d�||d�d�D]}d||<q�Wq&|tkr&|Sq&WWntk
r�t||�SXd}}} g}
|
j}x_|D]W}|r@| dkr3|}n| d} n| r_||| f�d} n|d}qW| r�||| f�nt|
�dkrxQ|
D]I\}} | dkr�|t|f�q�|t||| dff�q�Wt|�t|�kr+|Sn t |�}
|t
|
f�|S|S(Niiii(RRJRKRLtrangeR0t
IndexErrort_optimize_unicodeR t
_mk_bitmapRM(RQRtoutt outappendtcharmapR?R@titptntrunst
runsappendtctdata((s!/sys/lib/python2.7/sre_compile.pyRI�sR
.
"cCs�g}|j}tjdkr'd}nd}|\}}xP|D]H}|rY||}n||}|tkr@||�|\}}q@q@W|S(Niiill(ii(ll(RRtCODESIZEtMAXCODE(tbitsR_t
dataappendtstarttmtvR^((s!/sys/lib/python2.7/sre_compile.pyRUs
cCsNyddl}Wntk
r$|SXdgd}d}y�x�|D]�\}}|tkrcd}qB|tkr�d|||�<qB|tkr�xLt||d�||d�d�D]}d||<q�WqB|tkrB|SqBWWntk
r�|SX|r9tj dkr|Sx&td�D]}||||<qWni}dgd} d}
g}xxtd�D]j}t
||d|dd!�}|j||
�}
|
| |<|
|
kre|
d}
|t|�}qeqeW|
g}t
jdkr�}nd }|jd
| �j�} |j|| �} || j�}||dd+t|fgS(Ni�iiii�iitHtItB(tarraytImportErrorRJRKRLtxrangeR0RStsyst
maxunicodettuplet
setdefaultRURR`ttostringttolistRO(RQRRjRXtnegateR?R@RYtcompstmappingtblockR_tchunktnewtheaderR7((s!/sys/lib/python2.7/sre_compile.pyRT-sX
.
cCsH|dj�\}}||ko-dknoG|dddtkS(Niii(R#R!(R@RBRC((s!/sys/lib/python2.7/sre_compile.pyRbscCsi|j�\}}|dkr"dSg}|j}d}g}|j} |t@sfx�|jD]�\}
}|
tkr�t|�|kr�|d}n||�qZ|
tkr�|d�dkr�dd\}
}|
tkr�|�q�ZPqZW|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��}qc|
tkrc|}qcqfn|j}|t t
�t|�}|d�d}|r�}t|�|ko�t|j�knr�t}q�|r�t
}n||�|tkr||�n|t�|t }|tkrC||�n
|d�|r8|t|��||�|j|�dgdgt|�}x�tt|��D]y}||d||d<xZ||ddkr|||||ddkr|||ddd||d<q�Wq�W|j|d�n|rQt|||�nt|�|||<dS(Niii�(R#RRR_RKR R!R.RRtINFOtSRE_INFO_PREFIXtSRE_INFO_LITERALtSRE_INFO_CHARSETRaRNRlR(R7R8RRBRCtprefixtprefixappendtprefix_skipRQt
charsetappendR?R@R^tcappendRZR9RAtmaskttableRY((s!/sys/lib/python2.7/sre_compile.pyt
_compile_infogs�
"
+
7*tcCs(x!tD]}t||�rdSqWdS(Nii(tSTRING_TYPESt
isinstance(tobjttp((s!/sys/lib/python2.7/sre_compile.pytisstring�s
cCsN|jj|B}g}t|||�t||j|�|jtt�|S(N(R8RR�RR_RRR(RZRR7((s!/sys/lib/python2.7/sre_compile.pyt_code�sicCs�t|�r'|}tj||�}nd}t||�}|jjdkr]td��n|jj}dg|jj}x$|j �D]\}}|||<q�Wt
j|||jjB||jjd||�S(Nids6sorry, but this version only supports 100 named groupsi(
R�t sre_parsetparseRHR�R8tgroupstAssertionErrort groupdicttitemsRtcompileR(RZRR8R7t
groupindext
indexgrouptkRY((s!/sys/lib/python2.7/sre_compile.pyR��s
(%t__doc__RRmR�t
sre_constantsR`RaRtsetRKtNOT_LITERALR
Rt
MIN_REPEATRRRRPRtASSERTt
ASSERT_NOTR
RRHRRIRURTRR�tunicodet NameErrorttypeR�R�R�R�(((s!/sys/lib/python2.7/sre_compile.pyt<module>s4
� 3 + 5 j
|