f _& @sddlTdZdZedZedZedZedZedZee e hZ ee e eeeehZeed feed feed feed feed feedfeedfeedfdZeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfeefd Z e!e"e#e$e%e&e'e(dZ)e&e"Be(BZ*e+e'BZ,Gddde-Z.GdddZ/GdddZ0GdddZ1ddZ2ddZ3d d!Z4d"d#Z5d2d%d&Z6d'd(Z7d)d*Z8d3d,d-Z9d.d/Z:d0d1Z;d+S)4)*z .\[{()*+?^$|z*+?{ 012345678901234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz      \)z\a\bz\fz\nz\rz\tz\vz\\) z\Ar z\Bz\dz\Dz\sz\Sz\wz\Wz\Z)iLmsxatuc@s eZdZdS)VerboseN)__name__ __module__ __qualname__rr"/usr/lib64/python3.10/sre_parse.pyrGsrc@sBeZdZddZeddZdddZdd Zd d Zd d Z dS)StatecCsd|_i|_dg|_d|_dS)Nr)flags groupdict groupwidthslookbehindgroupsselfrrr__init__LszState.__init__cCs t|jSN)lenrr!rrrgroupsQsz State.groupsNcCsb|j}|jd|jtkr$td|dur^|j|d}|durTtd|||f||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r&rappend MAXGROUPSerrorrget)r"namegidogidrrr opengroupTs   zState.opengroupcCs||j|<dSr$)getwidthr)r"r,prrr closegroup`szState.closegroupcCs||jko|j|duSr$)r&r)r"r,rrr checkgroupbszState.checkgroupcCs6|jdur2||s|d||jkr2|ddS)Ncannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)r r2r))r"r,sourcerrrchecklookbehindgroupes     zState.checklookbehindgroup)N) rrrr#propertyr&r.r1r2r5rrrrrJs  rc@s`eZdZdddZdddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ dS) SubPatternNcCs"||_|durg}||_d|_dSr$)statedatawidth)r"r8r9rrrr#os zSubPattern.__init__rc Csd}ttf}|jD]v\}}t|dt|dd|turlt|D]"\}}t|ddt||qFq|turtt|dD]*\}}|rt|dd||dqq|t ur|\}} } td|| |d| rt|dd| |dqt ||rd}|D]V}t |t rL|s6t||dd}q|s^td ddt|ddd}q|stqtd|qdS) NTz )endORELSEF ) tuplelistr9printstrINBRANCH enumeratedumpGROUPREF_EXISTS isinstancer7) r"levelnlseqtypesopavrr condgroupitem_yesitem_norrrrHvsH        zSubPattern.dumpcCs t|jSr$)reprr9r!rrr__repr__szSubPattern.__repr__cCs t|jSr$)r%r9r!rrr__len__szSubPattern.__len__cCs |j|=dSr$r9r"indexrrr __delitem__szSubPattern.__delitem__cCs&t|trt|j|j|S|j|Sr$)rJslicer7r8r9rWrrr __getitem__s zSubPattern.__getitem__cCs||j|<dSr$rVr"rXcoderrr __setitem__szSubPattern.__setitem__cCs|j||dSr$)r9insertr\rrrr_szSubPattern.insertcCs|j|dSr$)r9r')r"r]rrrr'szSubPattern.appendc Cs|jdur|jSd}}|jD]\}}|tur|td}d}|dD]$}|\}}t||}t||}qD||}||}q|tur|\}}||}||}q|tur|d\}}||}||}q|t vr|d\}}|||d}|||d}q|t vr$|d}|d}q|t urP|j j |\}}||}||}q|tur|d\}}|ddur|d\}}t||}t||}nd}||}||}q|turqqt|tdt|tf|_|jS)Nrr=)r:r9rF MAXREPEATr/minmaxCALL SUBPATTERN _REPEATCODES _UNITCODESGROUPREFr8rrISUCCESS) r"lohirNrOrjlhrrrr/sZ                  zSubPattern.getwidth)N)r) rrrr#rHrTrUrYr[r^r_r'r/rrrrr7ms  (r7c@sbeZdZddZddZddZddZd d Zd d Ze d dZ ddZ ddZ dddZ dS) TokenizercCs@t|t|_||_|js"t|d}||_d|_d|_|dS)Nlatin1r)rJrDistextstringdecoded_stringrXnext_Tokenizer__next)r"rsrrrr#s  zTokenizer.__init__cCs|j}z|j|}Wnty.d|_YdS0|dkr|d7}z||j|7}Wn,ty~td|jt|jddYn0|d|_||_dS)Nr r=zbad escape (end of pattern))rXrt IndexErrorrur)rsr%)r"rXcharrrr__nexts$   zTokenizer.__nextcCs||jkr|dSdS)NTFrurv)r"rxrrrmatchs zTokenizer.matchcCs|j}||Sr$rz)r"thisrrrr*sz Tokenizer.getcCs8d}t|D]&}|j}||vr"q4||7}|q |SNr;)rangerurv)r"ncharsetresult_crrrgetwhiles  zTokenizer.getwhilecCsld}|j}||dur@|s,|d||d|t|||kr^|sh|d|dqh||7}q|S)Nr;zmissing zmissing %s, unterminated namer=)rurvr)r%)r" terminatorr+rrrrrgetuntil s  zTokenizer.getuntilcCs|jt|jpdSr}rXr%rur!rrrpossz Tokenizer.poscCs|jt|jpdSr}rr!rrrtellszTokenizer.tellcCs||_|dSr$)rXrvrWrrrseek szTokenizer.seekrcCst||j||Sr$)r)rsr)r"msgoffsetrrrr)$szTokenizer.errorN)r)rrrr#rvr{r*rrr6rrrr)rrrrrps   rpc Cst|}|r|St|}|r0|dtur0|SzH|dd}|dkr||dt7}t|dkrx|d|t|tt |dddfWS|dkr|j r||dt7}t|d kr|d|t|tt |dddfWS|d krN|j rN||d t7}t|d kr*|d|t|t |ddd}t |t|fWS|d kr|j rddl }| ds~|d|dd}zt||}Wn0ty|d|t|tdYn0t|fWS|tvr,||dt7}t |ddd }|dkr"|d|t|t|fWS|tvr:tt|dkrx|tvrf|d|t|tt|dfWSWntyYn0|d|t|dS)Nrr=rarincomplete escape %srU N{ missing {}character nameundefined character name %r\N{}.octal escape value %s outside of range 0-0o377 bad escape %s)ESCAPESr* CATEGORIESrEr HEXDIGITSr%r)LITERALintrrchr unicodedatar{rordlookupKeyError OCTDIGITSDIGITS ValueError ASCIILETTERS)r4escaper]rrcharnamerrr _class_escape'sp                 rc Csbt|}|r|St|}|r$|Sz|dd}|dkr||dt7}t|dkrl|d|t|tt|dddfWS|dkr|j r||dt7}t|dkr|d|t|tt|dddfWS|d krB|j rB||d t7}t|d kr|d|t|t|ddd}t |t|fWS|d kr|j rd dl }| dsr|d| dd}zt||}Wn0ty|d|t|tdYn0t|fWS|dkr||dt7}tt|ddd fWS|tvr|jtvr||7}|dtvr|dtvr|jtvr||7}t|ddd }|dkr|d|t|t|fWSt|dd}||jkr||s|dt||||t|fWS|d|t|dt|dkr2|tvr |d|t|tt|dfWSWntyHYn0|d|t|dS)Nr=rarrrrrrrrrrrrrrrrr0rrr3invalid group reference %dr)rr*rrrr%r)rrrrrrr{rrrrrrrur&r2r5rirr)r4rr8r]rrrgrouprrr_escapecs                        rcCstt|Sr$)rBdictfromkeys)itemsrrr_uniqsrcCsVg}|j}|j}|}|t||||d| o2| |dsqDqt|dkrX|dSt|}d} |D].} | stq| dur| d} qh| d| krhqqh|D] } | d=q|| q`qq`g} |D]h} t| dkrq@| d\} } | tur| | | fq| tur"| ddtur"| | qq@q|tt | f|S|t d|ff|S)Nr=|r) r'r{r_parser%r7rrENEGATEextendrrF)r4r8verbosenestedr itemsappend sourcematchstart subpatternprefixitemsetrNrOrrr _parse_subsN        rFc/ Cs t|}|j}|j}|j}t} t} |j} | dur4 q4| dvr@ q4||rx| tvrTq"| dkrx|} | dusv| dkr\q"q\q"| ddkrt|| |} || q"| t vr|t | | fq"| dkr| d} g}|j}|jdkrddl }|j d| t|d d |d }|} | dur0|d | | | d krF|rFqdn| ddkr`t|| }n~|r| dvr|j| krddl }|j d| dkrdn| dkrdn| dkrdnd| dft|d d t | | f}|dr>|}|dur |d | | |d krL|dtur0|dd}|||t | dfqd|ddkrft||}n>|dkrddl }|j d| dt|d d t | |f}|dt ks|dt krd| |f}||t| dt||d}|d}||kr*d| |f}||t| dt||t||ffq |dturX|dd}||q t|}| |dkr|ddt ur|r|t|ddfn2||dnz|r|dtdf|t|fq"| tvr4| } | dkrd\}}nB| dkrdt}}n*| dkr4dt}}n| dkr8|jdkr\|t | | fq"dt}}d }}|jtvr||7}qn|d!r|jtvr||7}qn|}|ds|t | | f|| q"|rt|}|tkrtd"|rFt|}|tkrtd"||krF|d#| | ntd$|f|rZ|d%d}nd}|rv|ddtur|d&| | t| |ddtvr|d'| | t| |ddt ur|dd\}}}}|dur|s|s|}|dr t!|||ff|d%<nt"|||ff|d%<q"| d(krL|t#dfq"| d)k r| d} d*}d}!d}d}|d r$|}|dur|d+|d,kr|d-r|$d.d/}!|!%sd0|!}||t|!dnD|d1r|$d2d/}!|!%sd0|!}||t|!d|j&|!}"|"durNd3|!}||t|!d|'|"sn|d4t|!d|(|"||t)|"fq"n|}|dur|d+|d5|t|dnb|d6krd}nP|dkr|jdur|d7| | |d2krq"qq"n|d8v rd}#|d-kr|}|durH|d+|d9vrj|d:|t|dd%}#|j*}$|$dur|j+|_*t,||||d}|#dkr|$durd|_*|d2s|d;| | |d1kr|t-|#|ffq"|t.|#|ffq"n"|d)k rr|$d2d/}%|%% rV|j&|%}&|&du rd3|%}||t|%dnzt|%}&|&dk rnt/Wn2t/ yd0|%}||t|%ddYn0|& s|d r8t1||||d}(|jd>k r<|d?nd}(|d2 s\|d;| | |t2|&|'|(ffq"n|t3v s|dk r t4|||})|)du r| r| rddl }|j d@|j5ddAt|j5dAk rdBnd ft6|d d |j7t8@r"|s"t9q"|)\}}d}n|dC|t|d|du r|z|:|!}Wn>t yz}*z$||*j;t|!ddWYd}*~*n d}*~*00| s|t8@ o|t8@ }+t,|||+|d}|d2 s|d;| | |du r|<|||t ||||ffq"| d k r |tt=fq"| dDk r$|tt>fq"tdE|fq"t?t|ddd%D]N},||,\}-}.|-t u rJ|.\}}}}|du rJ| sJ| sJ|||,|,d< qJ|S)FNz|)#rrr [r=z"Possible nested set at position %dr) stacklevel^zunterminated character set]z-&~|zPossible set %s at position %d- difference& intersection~zsymmetric differenceunionz&Possible set difference at position %drazbad character range %s-%s?)rr=r+rrr;,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr`znothing to repeatzmultiple repeat.(Tzunexpected end of patternP<> group namebad character in group name %r=)unknown group name %rr3zunknown extension ?P:zmissing ), unterminated commentz=!|t@rtd|t@s,|tO}n:|t@rftdn(|t@rNtd|t@rf|t@rftd|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rJrDSRE_FLAG_LOCALErSRE_FLAG_ASCIISRE_FLAG_UNICODE)srcrrrr fix_flagss   rNcCst|}|durt}||_||_zt|||t@d}Wn@tyxt}|tB|_||_|dt||dd}Yn0t||j j|j _|j dur| d|t @r| |S)NrTzunbalanced parenthesis)rprrrDrrrrrr8rur)SRE_FLAG_DEBUGrH)rDrr8r4r0rrrparses&     rc st|j}gggj}fdd}j}|}|durLq|ddkr|d}|dkrDd}dsd d d }|rz ||} Wntyt d |Ynl0zt |} | dkrt Wn.t y d |t |ddYn0| t kr.d| t |d|| t |dnj|dkrjtvrz||7}jtvrz||7}|tt |dddd@n|tvrTd} jtvr.||7}|tvr.|dtvr.jtvr.||7}d} t |ddd}|dkr"d|t ||t|| s|t |ddt |dnZztt|d}Wn2ty|tvrd|t |Yn0||q:||q:rƈdt|tsddDfS)NcsX|jkrd||r8ddd=t|fddS)Nrr;)r&r)r'joinr%)rXrr&literalliteralsrr8rraddgroups  z parse_template..addgrouprr r=gr;rz missing z"parse_template..)rpr*r' groupindexr{r)rrrrwrrr%r(rurrrrrrrJrD) r4r8sgetlappendrrr|rr+rXisoctalrrrparse_templates                "           r!cCst|j}|jdd}|\}}|dd}z"|D]\}}||p@|||<q.Wntyhtd|Yn0||S)Nrr)rrsrwr)r)templater{remptyr&rrXrrrrexpand_templates   r$)F)rN)< sre_constantsrr frozensetrrrrrrrrgrrrErrCATEGORYrhrrrZAT_BEGINNING_STRINGZ AT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ CATEGORY_WORDZCATEGORY_NOT_WORDZ AT_END_STRINGrSRE_FLAG_IGNORECASEr SRE_FLAG_MULTILINESRE_FLAG_DOTALLrr SRE_FLAG_TEMPLATErrrrr  Exceptionrrr7rprrrrrrrrr!r$rrrrsp                 #rH<M: r< U