U if?R @sdZdZddlZddlZddlmZmZddlTddlm Z dd e e Dd d d gZ [ ze Wne k rzeZ YnXd dZddZddZddZdZdZeedeeeZdZdZdZdZeddZeeeeeZdZedd eeZd!eZeeeZed"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/d0d1d2d3d4d5 Z)d6Z*ed7d8d9Z+ee)e*e+Z,ee!e,e(eZ-ee-Z.ee&d:ed;de&d<ed=dZ/edee'Z0eee0e!e,e/eZ1e2ej3e.e1e$e%f\Z4Z5Z6Z7ed>d?d@dAed>d?dBdCBdDdEdFdGdHdIhBZ8e3e"e3e#e6e7dJdKdLe8DdMdLe8DdNdLe8DZ9d)d*hdOdPe8DBdQdPe8DBZ:d;d=hdRdPe8DBdSdPe8DBZ;dTZGdWdXdXe=Z?dYdZZ@e@fd[d ZAd\d]ZBGd^d_d_ZCe3d`ejDZEe3daejDZFdbdcZGdddeZHdfd ZIdgd ZJeKdhkrddlLZLeMeLjNdkreAeOeLjNdjPn eAeLjQjPdS)izKa-Ping Yee z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip MontanaroN)BOM_UTF8lookup)*)tokencCsg|]}|ddkr|qS)r_).0xrr;/opt/alt/python38/lib64/python3.8/lib2to3/pgen2/tokenize.py %s r tokenizegenerate_tokens untokenizecGsdd|dS)N(|))joinchoicesrrr group0rcGs t|dS)Nrrrrrr any1rrcGs t|dS)N?rrrrr maybe2rrcstfddDS)Nc3s4|],}dD]}||kr||VqqdS))N)casefold)r r ylrr 4s  z _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"\\]*)*"rRfFbBuUZurZuRZUrZUR)r'r(r$r%cCsi|]}|dtqSr$) single3progr prefixrrr ysr5cCsi|]}|dtqSr%) double3progr3rrr r5zscCsi|] }|dqSNrr3rrr r5{scCsh|]}|dqSr1rr3rrr sr9cCsh|]}|dqSr6rr3rrr r9scCsh|]}|dqS)r'rr3rrr r9scCsh|]}|dqS)r(rr3rrr r9sc@s eZdZdS) TokenErrorN__name__ __module__ __qualname__rrrr r;sr;c@s eZdZdS)StopTokenizingNr<rrrr r@sr@c Cs4|\}}|\}}td||||t|t|fdS)Nz%d,%d-%d,%d: %s %s)printtok_namerepr) typerZxxx_todo_changemeZxxx_todo_changeme1lineZsrowZscolZerowZecolrrr printtokens rFcCs(zt||Wntk r"YnXdSr8) tokenize_loopr@)readline tokeneaterrrr r s cCst|D] }||qdSr8)r)rHrIZ token_inforrr rGs rGc@s,eZdZddZddZddZddZd S) UntokenizercCsg|_d|_d|_dS)Nrr)tokensprev_rowprev_col)selfrrr __init__szUntokenizer.__init__cCs*|\}}||j}|r&|jd|dS)N )rMrKappend)rNstartrowcol col_offsetrrr add_whitespaces zUntokenizer.add_whitespacecCs|D]p}t|dkr$|||qv|\}}}}}|||j||\|_|_|ttfkr|jd7_d|_qd |jS)Nrrr) lencompatrVrKrQrLrMNEWLINENLr)rNiterablettok_typerrRendrErrr rs      zUntokenizer.untokenizec Csd}g}|jj}|\}}|ttfkr,|d7}|ttfkr|t kr| q@n*|ttfkrd}n|r|r||dd}||q@dS)NFrPTrW) rKrQNAMENUMBERrZr[ASYNCAWAITINDENTDEDENTpop) rNrr\ startlineindents toks_appendtoknumtokvaltokrrr rYs0     zUntokenizer.compatN)r=r>r?rOrVrrYrrrr rJsrJz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)cCsH|dddd}|dks*|dr.dS|dks@|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-rq)lowerreplace startswith)orig_encencrrr _get_normal_namesrwcsdd}d}fdd}fdd}|}|trHd|dd}d }|sT|gfS||}|rj||gfSt|s~||gfS|}|s||gfS||}|r|||gfS|||gfS) NFrpcs(zWStk r"tYSXdSr8) StopIterationbytesr)rHrr read_or_stopsz%detect_encoding..read_or_stopcsz|d}Wntk r$YdSXt|}|s8dSt|d}z t|}Wn tk rrtd|YnXr|j dkrtd|d7}|S)Nasciirzunknown encoding: rpzencoding problem: utf-8z-sig) decodeUnicodeDecodeError cookie_rematchrwrr LookupError SyntaxErrorname)rE line_stringrencodingcodec) bom_foundrr find_cookie s"   z$detect_encoding..find_cookieTz utf-8-sig)rtrblank_rer)rHrdefaultrzrfirstsecondr)rrHr detect_encodings0         rcCst}||Sr8)rJr)r\utrrr r:sccstd}}}d\}}d}dg}d}d} d} d} z |} Wntk rPd} YnX|d}dt| } }|r2| s|td||| }|r|d} }t|| d||||f|| fVd\}}d}nd|r| dddkr| d dd krt|| ||t| f|fVd}d}q.n|| }|| }q.nB|dkr\|s\| sLqd}| |kr| | d krr|d}n8| | d kr|tdt}n| | d krd}nq| d} qP| |krĐq|r|Vd}| | dkr| | dkrT| | 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||dkr4||krt dd|| | f|dd}| r| |dkrd} d} d} td|| f|| f| fVq| rt| rt| |dkrtd} d} d} n| sptd|dfd}| |kr.t| | }|r|d\}}||f||f|}}} | ||| |}}|tjks|dkr|dkrt|||| fVq|dkrJt}|dkrt }n | r&d} |r6|Vd}||||| fVq|dkrx|rd|Vd}t |||| fVq|tkrt|}|| | }|r|d} | || }|r|Vd}t|||| f| fVn||f}| |d}| }q.q|tks$|ddtks$|ddtkr|ddkrx||f}t|p\t|dp\t|d}| |dd}}| }q.n |r|Vd}t|||| fVq|rr|dkr| r|dkrtnt|||| fVqtt|||| f}|dkr|s|}qt|dkrZ|rZ|dtkrZ|ddkrZd} |d} t|d|d|d|dfVd}|rj|Vd}|Vnz|dkr|r|Vd}t |||| f| fVd}nF|dkr|d}n|d kr|d}|r|Vd}t|||| fVn(t| | || f|| df| fV| d} qtq.|r,|Vd}|ddD]}td|df|dfdfVq8td|df|dfdfVdS)!Nr)rrFrrzEOF in multi-line stringz\ z\ rP  z# #z r`z3unindent does not match any outer indentation levelz zEOF in multi-line statement.TrWr )asyncawaitrdef\z([{z)]})rxrXr;rr_STRING ERRORTOKENtabsizerstripCOMMENTr[rQreIndentationErrorrf pseudoprogspanstringZdigitsrbrZ triple_quotedendprogs single_quoted isidentifierrcrdraOP ENDMARKER)rHlnumparenlev continuedcontstrneedcontcontlineriZstashedZ async_defZasync_def_indentZ async_def_nlrEposmaxstrstartendprogendmatchr_column comment_tokenZnl_pos pseudomatchrRsposeposrinitialnewlinermindentrrr rOs     *                                   __main__)R __author__ __credits__rrecodecsrrZlib2to3.pgen2.tokenrrdir__all__ry NameErrorstrrrrr# WhitespaceCommentIgnoreName Binnumber Hexnumber Octnumber Decnumber IntnumberExponent PointfloatExpfloat Floatnumber ImagnumberNumberSingleDoubleSingle3Double3Z _litprefixTripleStringZOperatorZBracketSpecialFunny PlainTokenTokenContStr PseudoExtras PseudoTokenmapcompileZ tokenprogrr2r7Z _strprefixesrrrr Exceptionr;r@rFr rGrJASCIIr~rrwrrrr=sysrXargvopenrHstdinrrrr s                    8 Ib