f _Gh@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)*))ii1)si)i)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)rtrr r >s rcCs ||@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_iscasedunicode_tolower_ignorecase_fixes ascii_iscased ascii_tolowerOP_LOCALE_IGNORE OP_IGNOREOP_UNICODE_IGNORE IN_UNI_IGNORE NOT_LITERALNEGATELITERALFAILUREIN_optimize_charset IN_LOC_IGNORE IN_IGNORE_compile_charsetANYSRE_FLAG_DOTALLANY_ALLSRE_FLAG_TEMPLATEerror_simple MAX_REPEAT REPEAT_ONEMIN_REPEAT_ONE_compileSUCCESSREPEAT MAX_UNTIL MIN_UNTIL SUBPATTERNMARKrgetwidthCALLATSRE_FLAG_MULTILINE AT_MULTILINEget AT_LOCALE AT_UNICODEBRANCHJUMPCATEGORY CH_LOCALE CH_UNICODEGROUPREFGROUPREF_LOC_IGNOREGROUPREF_IGNOREGROUPREF_UNI_IGNOREGROUPREF_EXISTS)codepatternremit_len LITERAL_CODESREPEATING_CODES SUCCESS_CODES ASSERT_CODESiscasedtolowerfixesopavloskipkcharsethascasedgrouprrphitail tailappendskipyesskipnorrr r>GsB                                                                r>cCs|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 BIGCHARSETrOr rPr!rQr9r/)rgrrWrYrbrcrrr r4s,      r4c 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) NFrTriri) bytearrayr.rprangemapanyr-r IndexErrorrrqfind _mk_bitmaprrbytes_bytes_to_codesrt)rgr_fixupraoutrlcharmaprhrbrcrdrfrr runsqrjdatacompsmappingblockchunkrrr r1s                   r1rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|tdddfddttd DS)Ncs"g|]}||dqS)rr)rr  _CODEBITS_intsrr sz_mk_bitmap..r) translate _BITS_TRANSrxr)bitsrrrrr r}sr}cCst|d}|S)NI) memoryviewcasttolist)barrr rsrcCsDt|dkrdS|d\}}|tur<|dduo:t|dS|tvS)NrFrr)rrCr: _UNIT_CODES)rjrbrcrrr r:s   r:cCsndgt|}tdt|D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)Nrr)rrx)prefixtabler idxrrr _generate_overlap_tables  rcCs |t@s dS|t@rtjStjSr)rr!r"r#r&)rrrr _get_iscaseds rcCsg}|j}d}t|}|jD]\}}|turF|r<||r<q||q|tur|\}} } } t|| | } | t@rz| t@rzqt| | \} }}|dur|durt |}n|durt ||}| | |sqqqq||dfS||dfS)NTF) rrrr.rCrrr _get_literal_prefixrrs)rXrr prefixappend prefix_skipr_rbrcrirrrjflags1prefix1 prefix_skip1got_allrrr rs4        rc 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)rrCrrr rr.rMrr0rprzryrx) rXrrbrcrirrr_rg charsetappendrjrrr _get_charset_prefixsN           rc 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)rEMAXCODErsINFOrr rrrrSRE_INFO_PREFIXSRE_INFO_LITERALSRE_INFO_CHARSETminrr1r4) rWrXrrdrkrrrgrrYremaskrhrrr _compile_infosP           rcCst|ttfSr) isinstancestrr~)objrrr isstringSsrcCs8|jj|B}g}t|||t||j||t|Sr)staterrr>rrr?)rjrrWrrr _codeVs    rcCsdddd|DS)N[%s], css$|]}dtjdd|fVqdS)z%#0*xrN)r"CODESIZErxrrr r frz_hex_code..)joinrWrrr _hex_codeesrcsNddltdtttdfdddtdS)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 rend)addprint)rargs)labelslevel offset_widthstartrr print_ps  z!dis..dis_..print_cs"tdddt|dS)N rr)r)r)rrrr print_2xsz"dis..dis_..print_2rz %#02x (%r) rz%#02x %#02x (%r-%r)rurc3s|]}|tjjVqdSr)to_bytesr"r byteorderr)sysrr r sz$dis..dis_..branch MAXREPEATrz prefix_skipz prefixrrcss|]}d|VqdS)z%#02xNrrrrr r rz(%r)z overlapin)9OPCODESr?r/r5r7rArBr-r.r,LITERAL_IGNORENOT_LITERAL_IGNORELITERAL_UNI_IGNORENOT_LITERAL_UNI_IGNORELITERAL_LOC_IGNORENOT_LITERAL_LOC_IGNOREchrrGrATCODESrOCHCODESr0r3r+r2rprqrrrrrtlistrr"rrxrDrRrTrUrSrNrMr@r<r=rrVASSERT ASSERT_NOTrbinrryr ValueError)rrrrr rbargrerdrkrr rmaxr prefix_lenrrrWdis_rrrr)rr ros                                 zdis..dis_)rsetrrrrrr dishsrc Cst|r|}t||}nd}t||}|t@r>tt||jj}dg|jj }| D]\}}|||<q\t |||jj B||jj d|t|S)Nr)r sre_parseparserSRE_FLAG_DEBUGrrr groupdictgroupsitemsr"compilerr)rjrrXrW groupindex indexgrouprfr rrr rs"   r)NNN)r),r"r sre_constantsr.r,rr@ MIN_REPEATr;rr?r/rrrrr5r0r _equivalencesr%rrr>r4r1rrrrintr}rr:rrrrrrrrrrrrrr  sF  $ 3    ,;