B /g^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.7/sre_parse.pyr Gsr c@sBeZdZddZeddZdddZdd Zd d Zd d Z dS)PatterncCsd|_i|_dg|_d|_dS)Nr)flags groupdict groupwidthslookbehindgroupsselfrrr__init__LszPattern.__init__cC t|jSN)lenrrrrrgroupsQzPattern.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)rrappend MAXGROUPSerrorrget)rnamegidZogidrrr opengroupTs   zPattern.opengroupcCs||j|<dSr)getwidthr)rr#prrr closegroup`zPattern.closegroupcCs||jko|j|dk Sr)rr)rr#rrr checkgroupbr(zPattern.checkgroupcCs6|jdk r2||s|d||jkr2|ddS)Ncannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr)r )rr#sourcerrrchecklookbehindgroupes     zPattern.checklookbehindgroupr) r r rrpropertyrr$r'r)r,rrrrrJs   rc@s`eZdZdddZdddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ dS) SubPatternNcCs"||_|dkrg}||_d|_dSr)patterndatawidth)rr/r0rrrros zSubPattern.__init__rc Csd}ttf}x|jD]\}}t|dt|dd|tkrttx*|D]"\}}t|ddt||qLWq|tkrtx:t|dD]*\}}|rt|dd||dqWq|t kr|\}} } td|| |d| rt|dd| |dqt ||rd}x\|D]T}t |t rX|sDt||dd}n"|sjtd ddt|ddd}q(W|stqtd|qWdS) 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|jdk r|jSd}}x|jD]\}}|tkrtd}d}x0|dD]$}|\}}t||}t||}qJW||}||}q"|tkr|\}}||}||}q"|tkr|d\}}||}||}q"|t kr|d\}}|||d}|||d}q"|t kr,|d}|d}q"|t krX|j j |\}}||}||}q"|tkr|d\}}|ddk r|d\}}t||}t||}nd}||}||}q"|tkr"Pq"Wt|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}y|j|}Wntk r.d|_dSX|dkr|d7}y||j|7}Wn.tk rtd|jt|jddYnX|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.getcCs:d}x0t|D]$}|j}||kr"P||7}|qW|SNr2)ranger[r\)rZnZcharsetresultZ_crrrgetwhiles zTokenizer.getwhilecCshd}x^|j}||dkr>|s*|d|d|t|||krX|sV|ddP||7}qW|S)Nr2zmissing group namezmissing %s, unterminated namer3)r[r\r r)rZ terminatorrdrerrrgetuntil 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   rWcCst|}|r|St|}|r0|dtkr0|Sy|dd}|dkr||dt7}t|dkrx|d|t|tt |dddfS|dkr|j r||dt7}t|d kr|d|t|tt |dddfS|d krH|j rH||d t7}t|d kr&|d|t|t |ddd}t |t|fS|t kr||dt 7}t |ddd }|d kr|d|t|t|fS|t krtt|dkr|tkr|d|t|tt|dfSWntk rYnX|d|t|dS)Nrr3rLrincomplete escape %sr U .octal escape value %s outside of range 0-0o377 bad escape %s)ESCAPESr! CATEGORIESr6rf HEXDIGITSrr LITERALintrXchr OCTDIGITSDIGITS ValueError ASCIILETTERSord)r+escaperHrerrr _class_escape'sR         rcCst|}|r|St|}|r$|Syv|dd}|dkr||dt7}t|dkrl|d|t|tt|dddfS|dkr|j r||dt7}t|dkr|d|t|tt|dddfS|d kr<|j r<||d t7}t|d kr|d|t|t|ddd}t |t|fS|d krl||dt 7}tt|ddd fS|t kr^|j t kr||7}|dt kr|dt kr|j t kr||7}t|ddd }|d kr|d|t|t|fSt|dd}||jkrF||s2|dt||||t|fS|d|t|dt|dkr|tkr|d|t|tt|dfSWntk rYnX|d|t|dS)Nr3rLrrnrorpr rqrrrsrt0rurvr*invalid group reference %drw)ryr!rxrfrzrr r{r|rXr}r~rr[rr)r,rSrrr)r+rstaterHregrouprrr_escapeWsn                  rcCstt|Sr)r4ZdictZfromkeys)itemsrrr_uniqr(rcCs`g}|j}|j}|}x.|t||||d| o4| |dsPqWt|dkr\|dSt|}x^d} xR|D]*} | szP| dkr| d} qp| d| krpPqpWx|D] } | d=qW|| qfPqfWg} x|D]b} t| dkrP| d\} } | tkr| | | fq| tkr.| ddtk r.| | qPqW|tt | f|S|t d|ff|S)Nr3|r) rr`rk_parserr.r{r6NEGATEZextendrr7)r+rverbosenestedrZ itemsappend sourcematchstart subpatternZprefixitemsetr;r<rrr _parse_subsP            rFc/ Cs t|}|j}|j}|j}t} t} x|j} | dkr6P| dkr@P||r|| tkrTq&| dkr|x|} | dkst| dkr^Pq^Wq&| ddkrt|| |} || q&| t kr|t | | fq&| dkr| d} g}|j}|jdkrddl }|j d| t|d d |d }xT|} | dkr8|d | | | d krL|rLPn| ddkrft|| }n~|r| dkr|j| krddl }|j d| dkrdn| dkrdn| dkrdnd| dft|d d t | | f}|dr@|}|dkr|d | | |d krP|dtkr6|dd}|||t | dfP|ddkrjt||}n>|dkrddl }|j d| dt|d d t | |f}|dt ks|dt krd| |f}||t| dt||d}|d}||kr.d| |f}||t| dt||t||ffn"|dtkrZ|dd}||qWt|}| |dkr|ddt kr|r|t|ddfn ||dn"|r|dtdf|t|fq&| tkr<| } | dkrd\}}nJ| dkrdt}}n2| dkr6dt}}n| dkrB|jdkr^|t | | fq&dt}}d }}x|jtkr||7}qrW|d!rx"|jtkr||7}qWn|}|ds|t | | f|| q&|rt|}|tkrtd"|rPt|}|tkr"td"||krP|d#| | ntd$|f|rd|d%d}nd}|r|ddtkr|d&| | t| |ddtkr|d'| | t| |ddt kr |dd\}}}}|dkr |s |s |}|dr(t!|||ff|d%<nt"|||ff|d%<q&| d(krT|t#dfq&| d)k r| d} d*}d}!d}d}|d r(|}|dkr|d+|d,kr|d-r|$d.}!|!%sd/|!}||t|!dn|d0r|$d1}!|!%sd/|!}||t|!d|j&|!}"|"dkrPd2|!}||t|!d|'|"sp|d3t|!d|(|"||t)|"fq&n2|}|dkr|d+|d4|t|dnf|d5krd}nT|dkrx4|jdkr|d6| | |d1krPqWq&n|d7k rd}#|d-kr|}|dkrL|d+|d8krn|d9|t|dd%}#|j*}$|$dkr|j+|_*t,||||d}|#dkr|$dkrd|_*|d1s|d:| | |d0kr|t-|#|ffq&|t.|#|ffq&n"|d)k rv|$d1}%|%% rX|j&|%}&|&dk rd2|%}||t|%dnyt|%}&|&dk rpt/Wn4t/k rd/|%}||t|%ddYnX|& s|d;t|%d|&t0k rd<|&}||t|%d|(|&|t1||||d}'|d= rnd}(|d1 s`|d:| | |t2|&|'|(ffq&n|t3k s|dk rt4|||})|)dk r| r| rddl }|j d?|j5dd@t|j5d@k rdAnd ft6|d d |j7t8@r&|s&t9q&|)\}}d}n|dB|t|d|dk r~y|:|!}Wn<tk r|}*z||*j;t|!ddWdd}*~*XYnX| s|t8@ o|t8@ }+t,|||+|d}|d1 s|d:| | |dk r|<|||t ||||ffq&| d k r|tt=fq&| dCk r&|tt>fq&tdD|fq&Wxht?t|ddd%D]N},||,\}-}.|-t k rP|.\}}}}|dk rP| sP| sP|||,|,d< qPW|S)ENz|)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+Z{Z}r2z,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rrKznothing to repeatzmultiple repeatZ.z(Tzunexpected end of patternZP<>bad character in group name %rz=)unknown group name %rr*zunknown extension ?P:zmissing ), unterminated commentz=!r?rZerrZ sub_verboserr;r<rrrrsP                                                                                            *         rcCs|j}d}d}|dkrxt|}|jr>|dkrTd}||n|dkrTd}||||O}|t@r~|t@|kr~d}|||}|dkr|d|d krP|tkr|rd nd}||t|qW|d kr|j|O_dS|t@r|d d |dkr|}|dkr|d|tkrJ|r6d nd}||t|xt|}|t@rld}||||O}|}|dkr|d|dkrP|tkrL|rd nd}||t|qLW|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+rr^rrrZflagrmrrrrEsp                   rcCsjt|tr>|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)r:r5SRE_FLAG_LOCALErSRE_FLAG_ASCIISRE_FLAG_UNICODE)Zsrcrrrr fix_flagss   rNcCst|}|dkrt}||_||_yt|||t@d}WnBtk rzt}|tB|_||_|dt||dd}YnXt||j j|j _|j dk r| d|t @r| |S)NrTzunbalanced parenthesis)rWrrr5rrr rlrr/r[r SRE_FLAG_DEBUGr8)r5rr/r+r&rrrparses&    rc st|j}gggj}fdd}j}x||}|dkrNP|ddkr|d}|dkrJd}dsd d }|ry ||} Wn tk rt d |YnXnlyt |} | 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 |dnRytt|d}Wn4tk r|tkrd|t |YnX||q>||q>WrЈdt|tsddDfS)NcsX|jkrd||r8ddd=t|fddS)Nrr2)rr rjoinr)rDrjrZliteralliteralsr/rrraddgroups  z parse_template..addgrouprrr3gr2rz missing sz"parse_template..)rWr!r groupindexr`r rgrZKeyErrorr]r|rrrr[r~r}rrxrrr:r5) r+r/ZsgetZlappendrrrarer"rDZisoctalrrrparse_templates             "            rcCsz|j}|jdd}|\}}|dd}y&x |D]\}}||pB|||<q0WWn tk rntd|YnX||S)Nrr)rrYr]r r)Ztemplater`rZemptyrrrDrrrrexpand_templates r)F)rN)sj                #rH0A: r< U