QfR R dZdZddlmZddlmZmZddlZddl Z ddl m Z ddl Z ddlZddlZddlddlmZddlZej&d ej(Zej&d ej(ZddlZej.gd zZ[Gd d ej0d dZdZdZdZdZdZeedezzeezZdZ dZ!dZ"dZ#dZ$ee!e"e#e$Z%dZ&eddee&zZ'de&zZ(ee'e(Z)ede)dzZ*ee*e)e%Z+d Z,e jZd!Z.ee,Z/d"Z0d#Z1d$Z2d%Z3ee/d&ze/d'zZ4ee/d(ze/d)zZ5ee6ejne8ed*+Z9ed,e9Z:ee+e:e5e Z;ee;zZ<ee/d-zed.dze/d/zed0dzZ=ed1ee4Z>eee>e+e:e=e zZ?iZ@e,D]"ZAe0e@eAd.z<e1e@eAd0z<e2e@eAd&z<e3e@eAd'z<$[AeBZCeBZDe,D]BZEeEd0zeEd.zfD]ZFeCjeFeEd'zeEd&zfD]ZFeDjeFD[E[Fd2ZHGd3d4eIZJGd5d6eIZKGd7d8ZLd9ZMd:ZNd;ZOd<Zd=ZPd>ZQd?ZRd@ZSdCdAZTeUdBk(reRyy)DzKa-Ping Yee zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord)open)lookupBOM_UTF8N) TextIOWrapper)*)EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$))tokenizegenerate_tokensdetect_encoding untokenize TokenInfoc"eZdZdZedZy)r cpd|jt|jfz}d|j|zS)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))type)rtok_name_replace)selfannotated_types //opt/alt/python312/lib64/python3.12/tokenize.py__repr__zTokenInfo.__repr__0s9"dii$))1D%EEJ > 23 4c|jtk(r%|jtvrt|jS|jSN)rOPstringrrs r exact_typezTokenInfo.exact_type5s2 99?t{{.??$T[[1 199 rN)__name__ __module__ __qualname__rpropertyrrrr r /s4 rr ztype string start end linec0ddj|zdzS)N(|))joinchoicess rgroupr*<sC#((7"33c99rct|dzS)Nrr*r(s ranyr-=s%/C//rct|dzS)N?r,r(s rmayber0>sE7Oc11rz[ \f\t]*z #[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]c  gd}dh}|D]q}tj|D]W}tj|Dcgc]}||jfc}D]"}|j dj |$Ys|Scc}w)N)brufbrfr) _itertools permutationsproductupperaddr')_valid_string_prefixesresultprefixtcr4s r_all_string_prefixesrCUs>TF(((0A ''!)D!Q1aggi.!)DE 2771:&F1) M*EsB cJtj|tjSr)recompileUNICODE)exprs r_compilerIds ::dBJJ ''rz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z \\\r?\n|\Zc eZdZy) TokenErrorNrrr r"rrrOrOrrOc eZdZy)StopTokenizingNrPr"rrrSrSrQrrSc*eZdZdZdZdZdZdZy) UntokenizercJg|_d|_d|_d|_d|_y)Nr)tokensprev_rowprev_col prev_typeencodingrs r__init__zUntokenizer.__init__s%    rc|\}}||jks||jk(r@||jkr1tdj|||j|j||jz }|r%|jj d|zd|_||jz }|r|jj d|zyy)Nz+start ({},{}) precedes previous end ({},{})z\ r )rYrZ ValueErrorformatrXappend)rstartrowcol row_offset col_offsets radd_whitespacezUntokenizer.add_whitespacesS  #"63;NJ$fS#t}}dmmLN N4==(  KK  v 2 3DM4==(  KK  sZ/ 0 rc @g}d}|D]}|dk(r|rd}n|j||dk(rRtdtjdj|dddD}|dzd k(r|j|nd }|j|d j |S) NF}{c3 K|]}dyw)rWNr").0chars r z.Untokenizer.escape_brackets..s$#$A#s \rTr8)rbsumr9 takewhile__eq__r')rtoken charactersconsume_until_next_bracket character n_backslashess rescape_bracketszUntokenizer.escape_bracketss %*"IC-16.%%i0C #$","6"6 "26r6*#$! !1$)%%i015.   i (#$wwz""rcXt|}g}d}|D]}t|dk(r|j||n|\}}}} } |tk(r||_@|t k(rn|t k(r|j|g|tk(r |j| \|_ |_ |ttfvrd}n|rF|rD|d} |dt| k\r+|jj| t| |_ d}n|tk(r]d|vsd|vr|j!|}|j"d} | \} }| j%d| j%d z}| ||zf} nA|t&t(fvr3|j*t&t,fvr|jjd |j/||jj|| \|_ |_ |ttfvr|xjdz c_ d |_ ||_d j1|jS) NFrsTrrrWrkrjz{{z}}r_rr8)iterlencompatENCODINGr\ ENDMARKERINDENTrbDEDENTpoprYrZNEWLINENLrXFSTRING_MIDDLEr| splitlinescountSTRING FSTRING_STARTr[ FSTRING_ENDrhr')riterableitindents startlinerAtok_typerwrcendlineindent last_lineend_lineend_col extra_charss rr zUntokenizer.untokenizes (^ A1v{ Ar"01 -HeUC8# % 9$6!u%V# /2, t}gr]* w 8s6{*KK&&v.$'KDM! ^+%<3%< 007E 0 0 0 22 6I(+%Hg"+//$"7)//$:O"OK#W{%:;Cfm44FT_K`9` ""3'    & KK  u %+. (DM4=GR=( " ! %DNSTwwt{{##rc,g}|jj}|dttfv}d}d}t j |g|D]L}|dd\} } | t k(r| |_| ttfvr| dz } | tk(r |rd| z} d}nd}| tk(r|dz }n| tk(r|dz}| tk(r|j| }| tk(r|j| ttfvrd}n,|r|r||dd}n| t k(r|j#| } | dvr%|jr|jd| k(r|rd| z} | ttfvr3|j$ttfvr|jjd|| | |_Oy) NrFrsr_TrWrr>rkrj)rXrbrrr9chainrr\NAMENUMBERrrrrrrrr|r[) rrwrr toks_appendr prevstring in_fstringtoktoknumtokvals rrzUntokenizer.compatskk(( !H" -   ##UGX6C !WNFF! & $'#  6\F! " &a ;&a v&6! GR=( wGBK(! >)--f5#  B68QV`v&-00T^^P[G\5\ ""3'  #DNY7rN)rrr r]rhr|r rr"rrrUrUs 1#..$`3$rrUc t}|j|}|j|j|j}|Sr)rUr r\encode)rutouts rr r :s?& B -- !C {{jj% Jrc |ddjjdd}|dk(s|jdry|dvs|jdry|S) N _-utf-8zutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)lowerreplace startswith)orig_encencs r_get_normal_namerUsY2 3B-    ' 'S 1C g~1 66 ~~AB Orcl jjdd}d}fd}fd}|}|jtr d|dd}d}|s|gfS||}|r||gfSt j |s||gfS|}|s||gfS||}|r|||gfS|||gfS#t$rdYwxYw)NFrc2 S#t$rYywxYw)Nr) StopIterationreadlinesr read_or_stopz%detect_encoding..read_or_stopxs" :   s  c |jd}tj |}|syt |jd} t|}r5|dk7r+ d}t|dj}t||d z }|S#t$r"d}dj|}t|wxYw#t$r0d|z}t|dj|}t|wxYw) Nrz'invalid or missing encoding declarationz {} for {!r}rWzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) decodeUnicodeDecodeErrorra SyntaxError cookie_rematchrr*r LookupError)r line_stringmsgrr\codec bom_foundfilenames r find_cookiez$detect_encoding..find_cookie~s( #++g.K ,#EKKN3 #8$E 7"#3C"#&&=CCHMC!#&&  H=" #;C##**39c" "  # #*X5c" "6<>%  ^F 6"H%(( UFO ##O sB%% B32B3c t|d} t|j\}}|jdt ||d}d|_|S#|j xYw)NrbrT)line_bufferingr3) _builtin_openr rseekrmodeclose)rbufferr\linestexts rrrsd8T *F)&//:% AVXdC    s ?AA"c#K t|\}}tj|t|d}||dk(rd}t t |dddt |j|dEd{y7w)Nrrr)rrr8T extra_tokens)r r9rr~r r!_generate_tokens_from_c_tokenizer__next__)rr\consumedrl_gens rr r sr$)2Hh   hXs(; .perrors& ! rc|r|f|z|fz}d|zn|r|d|n d|ztjdy)Nz%s:%d:%d: error: %sz : error: z error: %srW)rexit)rrlocationargsrs rerrorzmain..errorsO ;)WJ6D (4/ 0  h8 9 ;( )  rzpython -m tokenize)progrr/z filename.pyz'the file to tokenize; defaults to stdin)destnargsmetavarhelpz-ez--exactexact store_truez(display token names using the exact type)ractionrrzTrz %d,%d-%d,%d:2015rWrz interrupted zunexpected error: %s)NN)argparseArgumentParser add_argument parse_argsrrlistr rrrstdinrrrrcrprintrrIndentationErrorrrOrOSErrorKeyboardInterrupt Exception)rrparserrrr5rXrw token_type token_rangeerrrcolumnrs @rmainr s $ $*> $ ?F Zs -FH iglGI    D" ==}}Hx.!hqzz23/.!H6 ""7F EJzz"-- (EKK%)),CDK  4ellD E /. 5xx{1Q' f chhqk8dF^44 5xx{ f chhqk8dF^44  c8  c  o %+, sg$E D= BE =EE H&.F H&+G H& G H&'G44H& H& H!!H&c d|vry|S)Nz)unterminated triple-quoted string literalzEOF in multi-line stringr")rs r_transform_msgr /s 3c9) Jrc#lK |tj||}ntj|||} |D]}tj|y#t$rR}t |tk7r|dt |j}t||j|jfdd}~wwxYww)Nr)r\r) _tokenize TokenizerIterr _makerrr rrOlinenooffset)sourcer\rrinfoers rrr9sa  $ $V, G  $ $Vh\ Z>D//$' ' > 7k ! QUU#qxx23= >s)4B4AB4 B1A B,,B11B4__main__)NF)V __author__ __credits__builtinsrrcodecsrr collections functoolsior itertoolsr9rErrwrr rFASCIIrr__all__ namedtupler r*r-r0 WhitespaceCommentIgnoreName Hexnumber Binnumber Octnumber Decnumber IntnumberExponent PointfloatExpfloat Floatnumber ImagnumberNumberrC lru_cacherI StringPrefixSingleDoubleSingle3Double3TripleStringmapescapesortedSpecialFunny PlainTokenTokenContStr PseudoExtras PseudoTokenendpats_prefixset single_quoted triple_quotedrAr4r=tabsizerrOrSrUr rr r r r r rrr"rrrHs,*  +# # BJJ@"(( K 2::0"(( ; --6 6  & &&{4PQ :/1  c*z12 2U7^ C  &  . )Y 9 = ( ?)+-28_= ( *J) +[7-B C z; 2  (( *,-  $ # 2 2 |e#\E%9 : |==== ? RYY'8$ GH I h  65&$ /   ==c:&'==c:&' (]GV4 5vugtLL #%G#GGcM#GGcM&GGeO&GGeO &     A#gq3w ! %iU #!$ q !!&Y%P$P$f6 Z$z _8J=~ >  zFr