f _&c @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*+?{Z 0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz zzz  z z z \)z\a\bz\fz\nz\rz\tz\vz\\) z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)iLZmsxaZtuc@s eZdZdS)VerboseN)__name__ __module__ __qualname__rr"/usr/lib64/python3.10/sre_parse.pyr Gsr c@sBeZdZddZeddZdddZdd Zd d Zd d Z dS)StatecCsd|_i|_dg|_d|_dS)Nr)flags groupdict groupwidthslookbehindgroupsselfrrr__init__LszState.__init__cC t|jSN)lenrrrrrgroupsQz 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)rrappend MAXGROUPSerrorrget)rnamegidZogidrrr opengroupTs   zState.opengroupcCs||j|<dSr)getwidthr)rr#prrr closegroup`zState.closegroupcCs||jko|j|duSr)rr)rr#rrr checkgroupbr(zState.checkgroupcCs6|jdur2||s|d||jkr2|ddS)Ncannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr)r )rr#sourcerrrchecklookbehindgroupes     zState.checklookbehindgroupr) r r rrpropertyrr$r'r)r,rrrrrJs  rc@s`eZdZdddZdddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ dS) SubPatternNcCs"||_|durg}||_d|_dSr)statedatawidth)rr/r0rrrros 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 )ZendZORZELSEFz ) Ztuplelistr0ZprintstrINBRANCHZ enumeratedumpGROUPREF_EXISTS isinstancer.) rZlevelZnlZseqtypesopavr r condgroupitem_yesitem_norrrr8vsH        zSubPattern.dumpcCrr)Zreprr0rrrr__repr__r(zSubPattern.__repr__cCrr)rr0rrrr__len__r(zSubPattern.__len__cCs |j|=dSrr0rindexrrr __delitem__r(zSubPattern.__delitem__cCs&t|trt|j|j|S|j|Sr)r:Zslicer.r/r0rCrrr __getitem__s zSubPattern.__getitem__cCs||j|<dSrrBrrDcoderrr __setitem__r(zSubPattern.__setitem__cCs|j||dSr)r0insertrGrrrrJr(zSubPattern.insertcCs|j|dSr)r0r)rrHrrrrr(zSubPattern.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)Nrr3)r1r0r7 MAXREPEATr%minmaxZCALL SUBPATTERN _REPEATCODES _UNITCODESGROUPREFr/rr9ZSUCCESS) rlohir;r<rZjZlZhrrrr%sZ                  zSubPattern.getwidthrr) r r rrr8r@rArErFrIrJrr%rrrrr.ms  (r.c@sbeZdZddZddZddZddZd d Zd d Ze d dZ ddZ ddZ dddZ dS) TokenizercCs@t|t|_||_|js"t|d}||_d|_d|_|dS)NZlatin1r)r:r5istextstringdecoded_stringrDnext_Tokenizer__next)rrYrrrrs  zTokenizer.__init__cCs|j}z|j|}Wnty.d|_YdS0|dkr|d7}z||j|7}Wn,ty~td|jt|jddYn0|d|_||_dS)Nrr3zbad escape (end of pattern))rDrZ IndexErrorr[r rYr)rrDcharrrrZ__nexts$   zTokenizer.__nextcCs||jkr|dSdS)NTFr[r\)rr^rrrmatchs zTokenizer.matchcCs|j}||Srr_)rthisrrrr!sz Tokenizer.getcCs8d}t|D]&}|j}||vr"q4||7}|q |SNr2)ranger[r\)rZnZcharsetresultZ_crrrgetwhiles  zTokenizer.getwhilecCsld}|j}||dur@|s,|d||d|t|||kr^|sh|d|dqh||7}q|S)Nr2zmissing zmissing %s, unterminated namer3)r[r\r r)rZ terminatorr"rdrerrrgetuntil s  zTokenizer.getuntilcC|jt|jpdSrbrDrr[rrrrposrz Tokenizer.poscCrhrbrirrrrtellr(zTokenizer.tellcCs||_|dSr)rDr\rCrrrseek szTokenizer.seekrcCst||j||Sr)r rYrk)rmsgZoffsetrrrr $r(zTokenizer.errorNrV)r r rrr\r`r!rfrgr-rjrkrlr rrrrrWs   rWc 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)Nrr3rLrincomplete escape %sr U N{ missing {}character nameundefined character name %r\N{}.octal escape value %s outside of range 0-0o377 bad escape %s)ESCAPESr! CATEGORIESr6rf HEXDIGITSrr LITERALintrXchr unicodedatar`rgordlookupKeyError OCTDIGITSDIGITS ValueError ASCIILETTERS)r+escaperHrercharnamerrr _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)Nr3rLrrnrorpr rqrrrsrtrurrvrwrxryrzr{0r|r}r*invalid group reference %dr~)rr!rrfrrr rrrXrrr`rgrrrrrr[rr)r,rSrr)r+rr/rHrerrgrouprrr_escapecs                        rcCstt|Sr)r4ZdictZfromkeys)itemsrrr_uniqr(rcCsVg}|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)Nr3|r) rr`rk_parserr.rr6NEGATEZextendrr7)r+r/verbosenestedrZ itemsappend sourcematchstart subpatternZprefixitemsetr;r<rrr _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|)z#rrrz[r3z"Possible nested set at position %drq)Z stacklevelz^zunterminated character setz]z-&~|zPossible set %s at position %d-Z differencez&Z intersectionz~zsymmetric differenceZunionz&Possible set difference at position %drLzbad character range %s-%sz?)rr3rz+rvrxr2z,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rrKznothing to repeatzmultiple repeatZ.z(Tzunexpected end of patternZP<> group namebad character in group name %rz=)unknown group name %rr*zunknown extension ?P:zmissing ), unterminated commentz=!r?rZerrZ sub_verboserr;r<rrrrst                                                                                                           .         rcCs|j}d}d}|dkrt|}|jr<|dkrRd}||n|dkrRd}||||O}|t@r||t@|kr|d}|||}|dur|d|d vrq|tvr|rd nd}||t|q|d kr|j|O_dS|t@r|d d |dkr|}|dur|d|tvrF|r2d nd}||t|t|}|t@rfd}||||O}|}|dur|d|dkrq|tvrF|rd nd}||t|qF|t@r|dd ||@r|dd ||fS)Nrrrz8bad inline flags: cannot use 'L' flag with a str patternr z:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:z unknown flagrz,bad inline flags: cannot turn on global flagr3z missing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z missing :rz-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off) r!rrXr TYPE_FLAGSZisalpharr GLOBAL_FLAGS)r+r/r^rrrZflagrmrrrr]sl                   rcCsjt|tr>|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)r:r5SRE_FLAG_LOCALErSRE_FLAG_ASCIISRE_FLAG_UNICODE)Zsrcrrrr fix_flagss   rNcCst|}|durt}||_||_zt|||t@d}Wn@tyxt}|tB|_||_|dt||dd}Yn0t||j j|j _|j dur| d|t @r| |S)NrTzunbalanced parenthesis)rWrrr5rrr rlrr/r[r SRE_FLAG_DEBUGr8)r5rr/r+r&rrrparses&     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)Nrr2)rr rjoinr)rDrjrZliteralliteralsrr/rraddgroups  z parse_template..addgrouprrr3gr2rz missing sz"parse_template..)rWr!r groupindexr`r rgrrr]rrrrr[rrrrrrr:r5) r+r/ZsgetZlappendrrrarer"rDZisoctalrrrparse_templates                "           rcCst|j}|jdd}|\}}|dd}z"|D]\}}||p@|||<q.Wntyhtd|Yn0||S)Nrr)rrYr]r r)Ztemplater`rZemptyrrrDrrrrexpand_templates   r)F)rN)sp                 #rH<M: r< U