f _Ghc@sddlZddlZddlTeehZeeehZ e e hZ e ehZeeehBZdZddeDZejfddZdd Zd d Zd+d d ZejdZde>dZdZeefddZddZ ddZ!ddZ"ddZ#ddZ$ddZ%dd Z&d!d"Z'd#d$Z(d%d&Z)d'd(Z*d,d)d*Z+dS)-N)Z*))iii1)isi)ii)iEii)ii)ii)ii)ii)ii)ii)ii)ii)ii)ii)iai)iics.i|]&}|D]tfdd|Dq qS)c3s|]}|kr|VqdSN).0jir$/usr/lib64/python3.10/sre_compile.py >z.)tuple)rZtrrr >s r cCs ||@r||M}||B|@Srr)flags add_flags del_flags TYPE_FLAGSrrr_combine_flagsAs rcCs|j}t}t}t}t}t}d} d} d} |t@r\|t@s\|t@rPt j } t j } t } n t j } t j} |D]\} } | |vr||t@s|| || n^|t@r|t| || n>| | s|| || n"| | }| s|t| ||n|| vr|t| ||n|t||}|d| tur<|t|f| |D]}|t||qJ|t|||||<q`| tur t| | | | \}}|t@r|t@r|tn(|s|tn| s|tn|t||}|dt||||||||<q`| tur6|t@r,|tn|tq`| |vrF|t@rXt d| ft!| dr| t"urz|t#n|t$||}|d|| d|| dt%|| d||t&|||||<n|t'||}|d|| d|| dt%|| d||||||<| t"ur<|t(n|t)q`| t*ur| \}}}}|rz|t+||ddt%||t,||||r|t+||dddq`| |vr|| q`| |vrT|| ||}|d| ddkr|dn*| d-\}}||kr"t d||t%|| d||t&|||||<q`| t.ur|| ||}|dt%|| ||t&|||||<q`| t/ur|| |t0@rt12| | } |t@rt32| | } n|t@rt42| | } || q`| t5ur|| g}|j}| dD]N} ||}|dt%|| ||t6||||d|||||<q |t|D]}|||||<q|q`| t7ur|| |t@rt8| } n|t@rt9| } || q`| t:ur0|t@s|| n,|t@r |t;n| s|t<n|t=|| dq`| t>ur|| || dd||}|dt%|| d|| dr|t6||}|d|||d||<t%|| d||||||<n$|||d||<q`t d| fq`dS)Nrz*internal: unsupported template operator %rz(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?appendlen_LITERAL_CODES_REPEATING_CODES_SUCCESS_CODES _ASSERT_CODESSRE_FLAG_IGNORECASESRE_FLAG_LOCALESRE_FLAG_UNICODE_sreunicode_iscasedZunicode_tolower_ignorecase_fixes ascii_iscasedZ ascii_tolowerZOP_LOCALE_IGNOREZ OP_IGNOREZOP_UNICODE_IGNORE IN_UNI_IGNORE NOT_LITERALNEGATELITERALFAILUREIN_optimize_charset IN_LOC_IGNORE IN_IGNORE_compile_charsetANYZSRE_FLAG_DOTALLANY_ALLZSRE_FLAG_TEMPLATEerror_simple MAX_REPEAT REPEAT_ONEMIN_REPEAT_ONE_compileSUCCESSREPEAT MAX_UNTIL MIN_UNTIL SUBPATTERNMARKrgetwidthZCALLATZSRE_FLAG_MULTILINEZ AT_MULTILINEZgetZ AT_LOCALEZ AT_UNICODEBRANCHJUMPCATEGORY CH_LOCALE CH_UNICODEGROUPREFGROUPREF_LOC_IGNOREGROUPREF_IGNOREGROUPREF_UNI_IGNOREGROUPREF_EXISTS)codepatternr emitZ_lenZ LITERAL_CODESZREPEATING_CODESZ SUCCESS_CODESZ ASSERT_CODESiscasedZtolowerfixesopavloskipkcharsethascasedgroupr rphitailZ tailappendZskipyesZskipnorrrr1GsB                                                                r1cCs|j}|D]\}}|||tur$q |tur6||q |tusF|tur`||d||dq |turt||q |tur||q |tur|t @r|t |n.|t @r|t |n||q t d|fq |tdS)Nrrz%internal: unsupported set operator %r)rr"r#RANGERANGE_UNI_IGNORECHARSETextend BIGCHARSETr<rr=rr>r,r$)rNr rDrFrIrJrrrr)s,      r)c Csg}g}td}d}|D]\}} z.|tur|rv|| } d|| <|rd| |vrd|| D] } d|| <qV|s~|| r~d}nd|| <n|tur&t| d| dd} |r|rt|| D]*} d|| <| |vr|| D] } d|| <qqnt|| D] } d|| <q|s$tt|| }n>| D]} d|| <qn(|tur@||| fn||| fWqtyt |dkr|dd7}Yq"|rd}|turt }||| fYq0qg}d}| d|}|dkrҐq&t |dkrd}q&| d|}|dkr||t |fq&|||fq|dur|D]@\}}||dkr\|t|fq4|t||dffq4||7}|st |t |kr||fS||fSt |dkrt |}|t |f||7}||fSt|}i}td}d}t}tdd dD]X} || | d}||vr6|||| d<q||| d<||<|d7}||7}qt |}|gt||dd<|t|f||7}||fS) NFrTrsiri)Z bytearrayr#rTrangemapanyr"rZ IndexErrorrrUZfind _mk_bitmaprVbytes_bytes_to_codesrX)rNrGZfixuprHZoutrSZcharmaprOrIrJrKrMZrrZrunsZqrQdataZcompsmappingZblockZchunkrrrr&s                   r&irs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|tdddfddttd DS)Ncs"g|]}||dqS)rr)rr _CODEBITS_intZsrrZ sz_mk_bitmap..r)Z translate _BITS_TRANSrZr)Zbitsrdrerrcrr]sr]cCst|d}|S)NZI)Z memoryviewZcastZtolist)ZbZarrrr_sr_cCsDt|dkrdS|d\}}|tur<|dduo:t|dS|tvS)NrFrrb)rr6r- _UNIT_CODES)rQrIrJrrrr-s   r-cCsndgt|}tdt|D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)Nrr)rrZ)prefixZtablerZidxrrr_generate_overlap_tables  ricCs |t@s dS|t@rtjStjSr)rrrrr)r rrr _get_iscaseds rjcCsg}|j}d}t|}|jD]\}}|turF|r<||r<q||q|tur|\}} } } t|| | } | t@rz| t@rzqt| | \} }}|dur|durt |}n|durt ||}| | |sqqqq||dfS||dfS)NTF) rrjr`r#r6rrr_get_literal_prefixrrW)rEr rhZ prefixappend prefix_skiprGrIrJrPr rrQZflags1Zprefix1Z prefix_skip1got_allrrrrks4        rkc Cs^|js dS|jd\}}|tur"qN|\}}}}t|||}|t@r|t@rdSt|}|turx|rn||rndS||fgS|turg}|j} |dD]@} | sdS| d\}}|tur|r||s| ||fqdS|S|t urZ|}|rV|D]d\}}|tur||rTdS|t ur|ddkr.dSt t |t |d|ddrdSq|SdS)Nrri)r`r6rrrrjr#r:rr%rTr\r[rZ) rEr rIrJrPr rrGrNZ charsetappendrQrrr_get_charset_prefixsN           rnc Csr|\}}|tkrt}|dkr8|tdd||gdSg}d}g}|t@rT|t@srt||\}}}|srt||}|j} | tt |} | dd} |rt } |dur|r| t B} n |r| t B} | | |tkr| |n| t|dt}| t |t|r@| t ||durt |}| ||||t|n|r^t|\}} t|||t || || <dS)Nr)r8MAXCODErWINFOrrrkrnrrSRE_INFO_PREFIXZSRE_INFO_LITERALSRE_INFO_CHARSETminrir&r)) rDrEr rKrRrhrlrNrmrFrLZmaskrOrrr _compile_infosP           rucCst|ttfSr)Z isinstancestrr^)ZobjrrrisstringSrwcCs8|jj|B}g}t|||t||j||t|Sr)stater rur1r`rr2)rQr rDrrr_codeVs    rzcCsdddd|DS)N[%s], css$|]}dtjdd|fVqdS)z%#0*xrN)rCODESIZErZxrrrrfr z_hex_code..)joinrDrrr _hex_codeerxrcsNddltdtttdfdddtdS)Nrrc sddfdd }fdd}d7}||kr||}|d7}t|}|tttttttfvrx||q2|tt t t t t ttfvr|}|d7}||d|t|fq2|tur|}|d7}tt|}|||ddq2|tur*|}|d7}tt|}|||d dq2|ttttfvrr|}|||||d|d||||7}q2|ttfvr||d \}} |d 7}||d || t|t| fq2|tur||t||d t|d t7}q2|tur|}|d7}t d !fdd||d t"j#D} |||| |d t"j#7}d7t$|D].} |t||d t|d t7}qdd8q2|t%t&t't(t)fvrΈ|}|d7}|||q2|t*ur|}|||||d|d7}q2|t+ur~|}|||||d|rt|d||||7}||}|rh|d|||dq |tq |d7}q2|t,t-t.fvr||d\}} } | t/krd} |||| | ||d|d||||7}q2|t0ur ||d \}}||||||d|d 7}q2|t1t2fvrr||d \}}||||||d|d ||||7}q2|t3ur||d\}}} } | t/krd} |||t4|| | ||d|d|t5@r`|d|d\}}|d||d|}|ddd!dd|Ddd!t6t||7|d||7|t7@rd7|d||d8||7}q2t8|q2d8dS)N)tocsX|dur"||d|ff7}tdvr6dndfdddt|dS)Nz(to %d)z%*d%s z:Z.z rend)Zaddprint)rargs)labelslevel offset_widthstartrrprint_ps  z!dis..dis_..print_cs"tdddt|dS)Nz rr)r)r)rrrrprint_2xsz"dis..dis_..print_2rz %#02x (%r)ii rz%#02x %#02x (%r-%r)rYr c3s|]}|tjjVqdSr)Zto_bytesrr}Z byteorderr~)sysrrrsz$dis..dis_..Zbranch MAXREPEATroiz prefix_skipz prefixr{r|css|]}d|VqdS)z%#02xNrr~rrrrr z(%r)Zz overlapZin)9ZOPCODESr2r$r*r+r4r5r"r#r!ZLITERAL_IGNOREZNOT_LITERAL_IGNOREZLITERAL_UNI_IGNOREZNOT_LITERAL_UNI_IGNOREZLITERAL_LOC_IGNOREZNOT_LITERAL_LOC_IGNOREZchrr9rvZATCODESr<ZCHCODESr%r(r r'rTrUrVrrdrXZlistrrr}rZr7r?rArBr@r;r:r3r/r0rrCASSERT ASSERT_NOTrqZbinrrr[rsZ ValueError)rrrrrrIZargrLrKrRrarrtZmaxr Z prefix_lenrlrhrDdis_rrrr)rrros                                 zdis..dis_)rZsetrrvrrrrdishsrc Cst|r|}t||}nd}t||}|t@r>tt||jj}dg|jj }| D]\}}|||<q\t |||jj B||jj d|t|S)Nr)rw sre_parseZparserzZSRE_FLAG_DEBUGrrryZ groupdictZgroupsZitemsrcompiler r )rQr rErDZ groupindexZ indexgrouprMrrrrrs"   r)NNN)r),rrZ sre_constantsr#r!rr3Z MIN_REPEATr.rr2r$rrrrr*r%rgZ _equivalencesrrrr1r)r&r}rdrprfZintr]r_r-rirjrkrnrurwrzrrrrrrrZ sF  $ 3    ,;