o bcEm@sdZddlZddlZddlTeehZeee hZ e e hZ eehZeeehBZdZddeDZejfddZd d Zd d Zd,d dZejdZde>dZdZeefddZ ddZ!ddZ"ddZ#ddZ$ddZ%ddZ&d d!Z'd"d#Z(d$d%Z)d&d'Z*d(d)Z+d-d*d+Z,dS).zInternal support module for sreN)*))ii1)si)i)iEii)ii)ii)ii)ii)ii)ii)ii)ii)ii)ii)i2i)i4i)i>i)iAi)iBii)iJi)ici)iiK)iai)iics.i|]}|D]tfdd|DqqS)c3s|] }|kr|VqdSN).0jirl/home/lily/lilypond-2.24.1/release/binaries/dependencies/install/Python-3.10.8/lib/python3.10/sre_compile.py Nsz.)tuple)rtrr r Ns rcCs ||@r ||M}||B|@Srr)flags add_flags del_flags TYPE_FLAGSrrr _combine_flagsQs rcCs|j}t}t}t}t}t}d} d} d} |t@r.|t@s.|t@r(t j } t j } t } nt j } t j} |D]4\} } | |vr|t@sF|| || q0|t@rU|t| || q0| | sb|| || q0| | }| ss|t| ||q0|| vr|t| ||q0|t||}|d| tur|t|f| |D] }|t||q|t|||||<q0| turt| | | | \}}|t@r|t@r|tn|s|tn | s|tn|t||}|dt||||||||<q0| tur |t@r|tq0|tq0| |vr|t@rt d| ft!| dr[| t"ur.|t#n|t$||}|d|| d|| dt%|| d||t&|||||<q0|t'||}|d|| d|| dt%|| d||||||<| t"ur|t(q0|t)q0| t*ur| \}}}}|r|t+||ddt%||t,||||r|t+||dddq0| |vr|| q0| |vr|| ||}|d| ddkr|dn| d-\}}||krt d||t%|| d||t&|||||<q0| t.ur=|| ||}|dt%|| ||t&|||||<q0| t/urm|| |t0@rQt12| | } |t@r]t32| | } n |t@rht42| | } || q0| t5ur|| g}|j}| dD]'} ||}|dt%|| ||t6||||d|||||<q|t|D] }|||||<qq0| t7ur|| |t@rt8| } n |t@rt9| } || q0| t:ur|t@s|| n|t@r|t;n | s|t<n|t=|| dq0| t>ur_|| || dd||}|dt%|| d|| drT|t6||}|d|||d||<t%|| d||||||<q0|||d||<q0t d| fdS)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_charsetANYSRE_FLAG_DOTALLANY_ALLSRE_FLAG_TEMPLATEerror_simple MAX_REPEAT REPEAT_ONEMIN_REPEAT_ONE_compileSUCCESSREPEAT MAX_UNTIL MIN_UNTIL SUBPATTERNMARKrgetwidthZCALLATSRE_FLAG_MULTILINEZ AT_MULTILINEgetZ AT_LOCALEZ AT_UNICODEBRANCHJUMPCATEGORY CH_LOCALE CH_UNICODEGROUPREFGROUPREF_LOC_IGNOREGROUPREF_IGNOREGROUPREF_UNI_IGNOREGROUPREF_EXISTS)codepatternremit_lenZ LITERAL_CODESZREPEATING_CODESZ SUCCESS_CODESZ ASSERT_CODESiscasedZtolowerfixesopavloskipkcharsethascasedgrouprrphitailZ tailappendZskipyesZskipnorrr r8WsJ                                                            r8cCs|j}|D]d\}}|||turq|tur||q|tus#|tur0||d||dq|tur:||q|turD||q|turc|t @rS|t |q|t @r^|t |q||qt d|f|tdS)Nrrz%internal: unsupported set operator %r)rr'r(RANGERANGE_UNI_IGNORECHARSETextend BIGCHARSETrErrFr rGr3r))rXrrMrOrSrTrrr r. s,       r.c Csxg}g}td}d}|D]\}} z|tur?|r:|| } d|| <|r1| |vr1|| D]} d|| <q*|s9|| r9d}ngd|| <nb|turt| d| dd} |r|rnt|| D]} d|| <| |vrl|| D]} d|| <qeqWn t|| D]} d|| <qs|stt|| }n| D]} d|| <qn|tur||| fn||| fWn(tyt |dkr|dd7}Yq|rd}|turt }||| fYnw q g}d} | d|}|dkrn%t |dkrd}n| d|}|dkr||t |fn|||fq|durB|D] \}}||dkr|t|fq |t||dffq ||7}|s:t |t |kr>||fS||fSt |dkr\t |}|t |f||7}||fSt|}i}td}d}t}tdd dD],} || | d}||vr|||| d<qq||| d<||<|d7}||7}qqt |}|gt||dd<|t|f||7}||fS) NFTrriri) bytearrayr(r^rangemapanyr'r IndexErrorrr_find _mk_bitmapr`bytes_bytes_to_codesrb)rXrQZfixuprRoutr]ZcharmaprYrSrTrUrWrr Zrunsqr[datacompsmappingZblockZchunkrrr r+$s                    r+rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|tdddfddttd DS)Ncs"g|] }||dqS)rr)rr  _CODEBITS_intsrr sz_mk_bitmap..r) translate _BITS_TRANSrfr)bitsrwrxrrvr rksrkcCst|d}|S)NI) memoryviewcasttolist)barrr rmsrmcCsDt|dkrdS|d\}}|tur|dduot|dS|tvS)NrFrru)rr=r4 _UNIT_CODES)r[rSrTrrr r4s  r4cCs|dgt|}tdt|D]-}||d}||||kr5|dkr'd||<n||d}||||ks|d||<q|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] rr)rrf)prefixZtabler Zidxrrr _generate_overlap_tables    rcCs |t@sdS|t@r tjStjSr)rr r!r"r$)rrrr _get_iscaseds rcCsg}|j}d}t|}|jD]Y\}}|tur#|r||rnO||q|turf|\}} } } t|| | } | t@r=| t@r=n0t| | \} }}|dur\|durRt |}n |dur\t ||}| | |senqn||dfS||dfS)NTF) rrrqr(r=rrr_get_literal_prefixrra)rNrrZ prefixappend prefix_skiprQrSrTrZrrr[Zflags1Zprefix1Z prefix_skip1got_allrrr rs6         rc CsZ |jsdS|jd\}}|turn|\}}}}t|||}|t@r(|t@r(dSqt|}|tur>|r9||r9dS||fgS|turng}|j} |dD] } | sRdS| d\}}|turi|rb||si| ||fqKdS|S|t ur|}|r|D]0\}}|tur||rdSqx|t ur|ddkrdSt t |t |d|ddrdSqx|SdS)NTrri)rqr=rrrrr(rCrr*r^rhrgrf) rNrrSrTrZrrrQrXZ charsetappendr[rrr _get_charset_prefixsV          rc Csl|\}}|tkr t}|dkr|tdd||gdSg}d}g}|t@r*|t@s9t||\}}}|s9t||}|j} | tt |} | dd} |rYt } |durX|rX| t B} n|r_| t B} | | |tkrl| |n | t|dt}| t |t|r| t ||durt |}| ||||t|n|rt|\}} t|||t || || <dS)Nr)r?MAXCODEraINFOrrrrrrSRE_INFO_PREFIXZSRE_INFO_LITERALSRE_INFO_CHARSETminrr+r.) rMrNrrUr\rrrXrrOrVZmaskrYrrr _compile_info0sR         rcCst|ttfSr) isinstancestrrl)objrrr isstringksrcCs8|jj|B}g}t|||t||j||t|Sr)staterrr8rqrr9)r[rrMrrr _codens   rcCsdddd|DS)N[%s], css&|]}dtjdd|fVqdS)z%#0*xrN)r!CODESIZErxrrr r ~s$z_hex_code..)joinrMrrr _hex_code}srcsNddltdtttdfdddtdS)Nrrc sddfdd }fdd}d7}||kr||}|d7}t|}|tttttttfvr=||n|tt t t t t ttfvr^|}|d7}||d|t|fnz|tur{|}|d7}tt|}|||ddn]|tur|}|d7}tt|}|||d dn@|ttttfvr|}|||||d|d||||7}n|ttfvr||d \}} |d 7}||d || t|t| fn|tur||t||d t|d t7}n|turS|}|d7}t d !fdd||d t"j#D} |||| |d t"j#7}d7t$|D]} |t||d t|d t7}q5d8n|t%t&t't(t)fvrl|}|d7}|||nl|t*ur|}|||||d|d7}nT|t+urƈ|}|||||d|r|d||||7}||}|r|d|||dn|t|s|d7}n|t,t-t.fvr||d\}} } | t/krd} |||| | ||d|d||||7}n|t0ur||d \}}||||||d|d 7}n|t1t2fvr@||d \}}||||||d|d ||||7}n|t3urԈ||d\}}} } | t/krXd} |||t4|| | ||d|d|t5@r|d|d\}}|d||d|}|ddd!dd|Ddd!t6t||7|d||7|t7@rψd7|d||d8||7}nt8|||ksd8dS)N)tocsX|dur||d|ff7}tdvrdndfdddt|dS)Nz(to %d)z%*d%s :.z rend)addprint)rargs)labelslevel offset_widthstartrr print_s   z!dis..dis_..print_cs"tdddt|dS)N rr)r)r)rrrr print_2s z"dis..dis_..print_2rz %#02x (%r) rz%#02x %#02x (%r-%r)rcc3s |] }|tjjVqdSr)to_bytesr!r byteorderr)sysrr r sz$dis..dis_..Zbranch MAXREPEATrz prefix_skipz prefixrrcss|]}d|VqdS)z%#02xNrrrrr r sz(%r)z overlapin)9ZOPCODESr9r)r/r1r;r<r'r(r&ZLITERAL_IGNOREZNOT_LITERAL_IGNOREZLITERAL_UNI_IGNOREZNOT_LITERAL_UNI_IGNOREZLITERAL_LOC_IGNOREZNOT_LITERAL_LOC_IGNOREchrr@rZATCODESrEZCHCODESr*r-r%r,r^r_r`rrwrblistrr!rrfr>rHrJrKrIrDrCr:r6r7rrLASSERT ASSERT_NOTrbinrrgr ValueError)rrrrr rSargrVrUr\rsr rmaxrZ prefix_lenrrrMdis_rrrr)rr rs       "                     szdis..dis_)rsetrrrrrr dissrc Cst|r |}t||}nd}t||}|t@rtt||jj}dg|jj }| D]\}}|||<q.t |||jj B||jj d|t|S)Nr)r sre_parseparserSRE_FLAG_DEBUGrrrZ groupdictZgroupsitemsr!compilerr)r[rrNrMZ groupindexZ indexgrouprWr rrr rs"   r)NNN)r)-__doc__r!r sre_constantsr(r&rr:Z MIN_REPEATr5rr9r)rrrrr/r*rZ _equivalencesr#rrr8r.r+rrwrr|intrkrmr4rrrrrrrrrrrrrr sJ   4 3   ,;