U e5d& @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*+?{ 0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz      \)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.8/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|dk r^|j|d}|dk rTtd|||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|dk Sr#)r%r)r!r+rrr checkgroupbszState.checkgroupcCs6|jdk r2||s|d||jkr2|ddS)Ncannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+sourcerrrchecklookbehindgroupes     zState.checklookbehindgroup)N) rrrr"propertyr%r-r0r1r4rrrrrJs  rc@s`eZdZdddZdddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ dS) SubPatternNcCs"||_|dkrg}||_d|_dSr#)statedatawidth)r!r7r8rrrr"os zSubPattern.__init__rc Csd}ttf}|jD]t\}}t|dt|dd|tkrlt|D]"\}}t|ddt||qFq|tkrtt|dD]*\}}|rt|dd||dqq|t kr|\}} } td|| |d| rt|dd| |dqt ||r~d}|D]T}t |t rJ|s6t||dd}n"|s\td ddt|ddd}q|stqtd|qdS) NTz )endORELSEF ) tuplelistr8printstrINBRANCH enumeratedumpGROUPREF_EXISTS isinstancer6) r!levelnlseqtypesopavrr condgroupitem_yesitem_norrrrGvsH        zSubPattern.dumpcCs t|jSr#)reprr8r rrr__repr__szSubPattern.__repr__cCs t|jSr#)r$r8r rrr__len__szSubPattern.__len__cCs |j|=dSr#r8r!indexrrr __delitem__szSubPattern.__delitem__cCs&t|trt|j|j|S|j|Sr#)rIslicer6r7r8rVrrr __getitem__s zSubPattern.__getitem__cCs||j|<dSr#rUr!rWcoderrr __setitem__szSubPattern.__setitem__cCs|j||dSr#)r8insertr[rrrr^szSubPattern.insertcCs|j|dSr#)r8r&)r!r\rrrr&szSubPattern.appendc Cs|jdk r|jSd}}|jD]\}}|tkr|td}d}|dD]$}|\}}t||}t||}qD||}||}q|tkr|\}}||}||}q|tkr|d\}}||}||}q|t kr|d\}}|||d}|||d}q|t kr$|d}|d}q|t krP|j j |\}}||}||}q|tkr|d\}}|ddk r|d\}}t||}t||}nd}||}||}q|tkrqqt|tdt|tf|_|jS)Nrr<)r9r8rE MAXREPEATr.minmaxCALL SUBPATTERN _REPEATCODES _UNITCODESGROUPREFr7rrHSUCCESS) r!lohirMrNr jlhrrrr.sZ                  zSubPattern.getwidth)N)r) rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms  (r6c@sbeZdZddZddZddZddZd d Zd d Ze d dZ ddZ ddZ dddZ dS) TokenizercCs@t|t|_||_|js"t|d}||_d|_d|_|dS)Nlatin1r)rIrCistextstringdecoded_stringrWnext_Tokenizer__next)r!rrrrrr"s  zTokenizer.__init__cCs|j}z|j|}Wntk r0d|_YdSX|dkr|d7}z||j|7}Wn.tk rtd|jt|jddYnX|d|_||_dS)Nr r<zbad escape (end of pattern))rWrs IndexErrorrtr(rrr$)r!rWcharrrr__nexts&  zTokenizer.__nextcCs||jkr|dSdS)NTFrtru)r!rwrrrmatchs zTokenizer.matchcCs|j}||Sr#ry)r!thisrrrr)sz Tokenizer.getcCs8d}t|D]&}|j}||kr"q4||7}|q |SNr:)rangertru)r!ncharsetresult_crrrgetwhiles  zTokenizer.getwhilecCsld}|j}||dkr@|s,|d||d|t|||kr^|sh|d|dqh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r! terminatorr*rrrrrgetuntil s  zTokenizer.getuntilcCs|jt|jpdSr|rWr$rtr rrrpossz Tokenizer.poscCs|jt|jpdSr|rr rrrtellszTokenizer.tellcCs||_|dSr#)rWrurVrrrseek szTokenizer.seekrcCst||j||Sr#)r(rrr)r!msgoffsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)rrr5rrrr(rrrrros   roc Cst|}|r|St|}|r0|dtkr0|SzJ|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||}Wn2tk r|d|t|tdYnXt|fWS|tkr.||dt7}t |ddd }|dkr$|d|t|t|fWS|tkr|dkrddl }|j d| dt|d d t | |f}|dt ks|dt krd| |f}||t| dt||d}|d}||kr*d| |f}||t| dt||t||ffn"|dtkrV|dd}||q t|}| |dkr|ddt kr|r|t|ddfn ||dn"|r|dtdf|t|fq"| tkr.| } | dkrd\}}nB| dkrdt}}n*| dkr0dt}}n| dkr4|jdkrX|t | | fq"dt}}d }}|jtkr||7}qj|d!r|jtkr||7}qn|}|ds|t | | f|| q"|rt|}|tkrtd"|rBt|}|tkrtd"||krB|d#| | ntd$|f|rV|d%d}nd}|rr|ddtkr|d&| | t| |ddtkr|d'| | t| |ddt kr|dd\}}}}|dkr|s|s|}|drt!|||ff|d%<nt"|||ff|d%<q"| d(krF|t#dfq"| d)k r| d} d*}d}!d}d}|d r|}|dkr|d+|d,kr|d-r|$d.d/}!|!%sd0|!}||t|!dn|d1r|$d2d/}!|!%sd0|!}||t|!d|j&|!}"|"dkrFd3|!}||t|!d|'|"sf|d4t|!d|(|"||t)|"fq"n2|}|dkr|d+|d5|t|dnd|d6krd}nR|dkr |jdkr|d7| | |d2krq"qq"n|d8krd}#|d-kr||}|dkr>|d+|d9kr`|d:|t|dd%}#|j*}$|$dkr||j+|_*t,||||d}|#dkr|$dkrd|_*|d2s|d;| | |d1kr|t-|#|ffq"|t.|#|ffq"n$|d)k rj|$d2d/}%|%% rL|j&|%}&|&dk rd3|%}||t|%dnzt|%}&|&dk rdt/Wn4t/k rd0|%}||t|%ddYnX|& s|d r0t1||||d}(|jd>k r4|d?nd}(|d2 sT|d;| | |t2|&|'|(ffq"n|t3k s~|dk rt4|||})|)dk r| r| rddl }|j d@|j5ddAt|j5dAk rdBnd ft6|d d |j7t8@r"|s"t9q"|)\}}d}n|dC|t|d|dk rrz|:|!}Wn<tk rp}*z||*j;t|!ddW5d}*~*XYnX| s|t8@ o|t8@ }+t,|||+|d}|d2 s|d;| | |dk r|<|||t ||||ffq"| d k r|tt=fq"| dDk r|tt>fq"tdE|fq"t?t|ddd%D]N},||,\}-}.|-t k r@|.\}}}}|dk r@| s@| s@|||,|,d< q@|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 %dr`zbad 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 %rr2zunknown extension ?P:zmissing ), unterminated commentz=!|t@rtd|t@s,|tO}qf|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)rIrCSRE_FLAG_LOCALErSRE_FLAG_ASCIISRE_FLAG_UNICODE)srcrrrr fix_flagss   rNcCst|}|dkrt}||_||_zt|||t@d}WnBtk rzt}|tB|_||_|dt||dd}YnXt||j j|j _|j dk r| d|t @r| |S)NrTzunbalanced parenthesis)rorrrCrrrrrr7rtr(SRE_FLAG_DEBUGrG)rCrr7r3r/rrrparses&    rc st|j}gggj}fdd}j}|}|dkrLq|ddkr|d}|dkrJd}dsd d d }|rz ||} Wn tk rt d |YnXnlzt |} | dkrt Wn0t k rd |t |ddYnX| t kr4d| t |d|| t |dq|dkrjtkr||7}jtkr||7}|tt |dddd@q|tkrZd} jtkr4||7}|tkr4|dtkr4jtkr4||7}d} t |ddd}|dkr(d|t ||t|| s|t |ddt |dnRztt|d}Wn4tk r|tkrd|t |YnX||q:||q:rΈdt|tsddDfS)NcsX|jkrd||r8ddd=t|fddS)Nrr:)r%r(r&joinr$)rWrr%literalliteralsrr7rraddgroups  z parse_template..addgrouprr r<gr:rz missing sz"parse_template..)ror)r& groupindexrzr(rrrrvrrr$r'rtrrrrrrrIrC) r3r7sgetlappendrrr{rr*rWisoctalrrrparse_templates               "           rcCsv|j}|jdd}|\}}|dd}z"|D]\}}||p@|||<q.Wn tk rjtd|YnX||S)Nrr)rrrrvr(r)templaterzremptyr%rrWrrrrexpand_templates  r")F)rN)< sre_constantsrr frozensetrrrrrrrrfrrrDrrCATEGORYrgrrrZAT_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_TEMPLATEr rrrr  Exceptionrrr6rorrrrrrrrrr"rrrrsp                 #rH<M: r< U