a Z^?R @sdZdZddlZddlZddlmZmZddlTddlm Z dd e e Dgd Z [ ze Wne yveZ Yn0d d Zd dZddZddZdZdZeedeeeZdZdZdZdZeddZeeeeeZdZeddeeZdeZeeeZed ed!Z ee eeZ!d"Z"d#Z#d$Z$d%Z%d&Z&ee&d'e&d(Z'ee&d)e&d*Z(ed+d,d-d.d/d0d1d2d3 Z)d4Z*ed5d6d7Z+ee)e*e+Z,ee!e,e(eZ-ee-Z.ee&d8ed9de&d:ed;dZ/edee'Z0eee0e!e,e/eZ1e2ej3e.e1e$e%f\Z4Z5Z6Z7edd?edGdPdQdQe=Z?dRdSZ@e@fdTdUZAdVdWZBGdXdYdYZCe3dZejDZEe3d[ejDZFd\d]ZGd^d_ZHd`daZIdbdcZJeKddkrddlLZLeMeLjNdkrxeAeOeLjNdjPn eAeLjQjPdS)ezKa-Ping Yee z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip MontanaroN)BOM_UTF8lookup)*)tokencCsg|]}|ddkr|qS)r_).0xrr./usr/lib64/python3.9/lib2to3/pgen2/tokenize.py %r )tokenizegenerate_tokens untokenizecGsdd|dS)N(|))joinchoicesrrr group0r rcGs t|dS)Nrrrrrr any1r rcGs t|dS)N?rrrrr maybe2r rcstfddDS)Nc3s4|],}dD]}||kr||VqqdS))N)casefold)r r ylrr 4sz _combinations..)setrrrr _combinations3s r#z[ \f\t]*z #[^\r\n]*z\\\r?\nz\w+z0[bB]_?[01]+(?:_[01]+)*z(0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?z0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?z[1-9]\d*(?:_\d+)*[lL]?z0[lL]?z[eE][-+]?\d+(?:_\d+)*z\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?z\.\d+(?:_\d+)*z \d+(?:_\d+)*z\d+(?:_\d+)*[jJ]z[jJ]z[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?'''"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z\*\*=?z>>=?z<<=?z<>z!=z//=?z->z[+\-*/%&@|^=<>]=?~z[][(){}]z\r?\nz:=z[:;.,`@]z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"rRfFbB>ZuRurZURUuZUr)r'r(r$r%cCsi|]}|dtqSr$) single3progr prefixrrr yr r6cCsi|]}|dtqSr%) double3progr4rrr r6zr cCsi|] }|dqSNrr4rrr r6{r cCsh|]}|dqSr2rr4rrr r r:cCsh|]}|dqSr7rr4rrr r:r cCsh|]}|dqS)r'rr4rrr r:r cCsh|]}|dqS)r(rr4rrr r:r c@s eZdZdS) TokenErrorN__name__ __module__ __qualname__rrrr r<r r<c@s eZdZdS)StopTokenizingNr=rrrr rAr rAc Cs4|\}}|\}}td||||t|t|fdS)Nz%d,%d-%d,%d: %s %s)printtok_namerepr) typerZxxx_todo_changemeZxxx_todo_changeme1lineZsrowZscolZerowZecolrrr printtokens rGcCs&zt||Wnty Yn0dSr9) tokenize_looprA)readline tokeneaterrrr rs  rcCst|D] }||qdSr9)r)rIrJZ token_inforrr rHs rHc@s,eZdZddZddZddZddZd S) UntokenizercCsg|_d|_d|_dS)Nrr)tokensprev_rowprev_col)selfrrr __init__szUntokenizer.__init__cCs*|\}}||j}|r&|jd|dS)N )rNrLappend)rOstartrowcol col_offsetrrr add_whitespaces zUntokenizer.add_whitespacecCs|D]p}t|dkr$|||qv|\}}}}}|||j||\|_|_|ttfvr|jd7_d|_qd |jS)Nrrr) lencompatrWrLrRrMrNNEWLINENLr)rOiterablettok_typerrSendrFrrr rs      zUntokenizer.untokenizec Csd}g}|jj}|\}}|ttfvr,|d7}|ttfvr|t kr| q@n*|ttfvrd}n|r|r||dd}||q@dS)NFrQTrX) rLrRNAMENUMBERr[r\ASYNCAWAITINDENTDEDENTpop) rOrr] startlineindents toks_appendtoknumtokvaltokrrr rZs0     zUntokenizer.compatN)r>r?r@rPrWrrZrrrr rKsrKz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)cCsH|dddd}|dks*|dr.dS|dvs@|drDdS|S) N r-utf-8zutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-rr)lowerreplace startswith)orig_encencrrr _get_normal_namesrxcsdd}d}fdd}fdd}|}|trHd|dd}d }|sT|gfS||}|rj||gfSt|s~||gfS|}|s||gfS||}|r|||gfS|||gfS) NFrqcs&zWSty tYS0dSr9) StopIterationbytesr)rIrr read_or_stops z%detect_encoding..read_or_stopcsz|d}Wnty"YdS0t|}|s6dSt|d}z t|}Wntyntd|Yn0r|j dkrtd|d7}|S)Nasciirzunknown encoding: rqzencoding problem: utf-8z-sig) decodeUnicodeDecodeError cookie_rematchrxrr LookupError SyntaxErrorname)rF line_stringrencodingcodec) bom_foundrr find_cookie s"     z$detect_encoding..find_cookieTz utf-8-sig)rurblank_rer)rIrdefaultr{rfirstsecondr)rrIr detect_encodings0         rcCst}||Sr9)rKr)r]utrrr r:srccsrd}}}d\}}d}dg}d}d} d} d} z |} WntyNd} Yn0|d}dt| } }|r0| sztd||| }|r|d} }t|| d||||f|| fVd\}}d}nd|r| dddkr| d dd krt|| ||t| f|fVd}d}q.n|| }|| }q.nB|dkrZ|sZ| sJqd}| |kr| | d krp|d}n8| | d kr|tdt}n| | d krd}nq| d} qN| |krq|r|Vd}| | dvr| | dkrR| | dd}| t|}t ||| f|| t|f| fVt | |d||f|t| f| fVq.t t f| | dk| | d|| f|t| f| fVq.||dkr| |t | d| |df|| f| fV||dkr2||vrt dd|| | f|dd}| r| |dkrd} d} d} td|| f|| f| fVq| rr| rr| |dkrrd} d} d} n| sntd|dfd}| |kr.t| | }|r|d\}}||f||f|}}} | ||| |}}|tjvs|dkr|dkrt|||| fVq|dvrHt}|dkrt }n | r$d} |r4|Vd}||||| fVq|dkrv|rb|Vd}t |||| fVq|tvrt|}|| | }|r|d} | || }|r|Vd}t|||| f| fVn||f}| |d}| }q.q|tvs"|ddtvs"|ddtvr|ddkrv||f}t|pZt|dpZt|d}| |dd}}| }q.n |r|Vd}t|||| fVq|rp|dvr| r|dkrtnt|||| fVqrt|||| f}|dkr|s|}qr|dkrX|rX|dtkrX|ddkrXd} |d} t|d|d|d|dfVd}|rh|Vd}|Vnz|dkr|r|Vd}t |||| f| fVd}nF|dvr|d}n|d vr|d}|r|Vd}t|||| fVn(t| | || f|| df| fV| d} qrq.|r*|Vd}|ddD]}td|df|dfdfVq6td|df|dfdfVdS)!Nr)rrFrrzEOF in multi-line stringz\ z\ rQ  z# #z raz3unindent does not match any outer indentation levelz zEOF in multi-line statement.TrXr )asyncawaitrdef\z([{z)]})ryrYr<rr`STRING ERRORTOKENtabsizerstripCOMMENTr\rRrfIndentationErrorrg pseudoprogspanstringdigitsrcr[ triple_quotedendprogs single_quoted isidentifierrdrerbOP ENDMARKER)rIlnumparenlev continuedcontstrneedcontcontlinerjZstashedZ async_defZasync_def_indentZ async_def_nlrFposmaxstrstartendprogendmatchr`column comment_tokenZnl_pos pseudomatchrSsposeposrinitialnewlinernindentrrr rOs      *                              r__main__)R __author__ __credits__rrecodecsrrZlib2to3.pgen2.tokenrrdir__all__rz NameErrorstrrrrr# WhitespaceCommentIgnoreName Binnumber Hexnumber Octnumber Decnumber IntnumberExponent PointfloatExpfloat Floatnumber ImagnumberNumberSingleDoubleSingle3Double3Z _litprefixTripleStringZOperatorZBracketSpecialFunny PlainTokenTokenContStr PseudoExtras PseudoTokenmapcompileZ tokenprogrr3r8Z _strprefixesrrrr Exceptionr<rArGrrHrKASCIIrrrxrrrr>sysrYargvopenrIstdinrrrr s                     8 Ib &