%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/__pycache__/tokenize.cpython-38.pyc

U

nad@sHdZdZdZddlmZddlmZmZddl	Z	ddl
mZddlZ
ddlZddlZddlTdd	lmZed
ejZedejZddlZejdd
dddgZ[Gddde	ddZddZddZddZdZdZeedeeeZdZdZ dZ!dZ"d Z#ee e!e"e#Z$d!Z%ed"d#ee%Z&d$e%Z'ee&e'Z(ed%e(d&Z)ee)e(e$Z*d'd(Z+d)d*Z,ee+Z-d+Z.d,Z/d-Z0d.Z1ee-d/e-d0Z2ee-d1e-d2Z3ee4ej5e6ed3d4Z7ed5e7Z8ee*e8e3eZ9ee9Z:ee-d6ed7de-d8ed9dZ;ed:ee2Z<eee<e*e8e;eZ=iZ>e+D]6Z?e.e>e?d7<e/e>e?d9<e0e>e?d/<e1e>e?d0<q,e@ZAe@ZBe+D]JZCeCd9eCd7fD]ZDeAEeDqeCd0eCd/fD]ZDeBEeDqqvd;ZFGd<d=d=eGZHGd>d?d?eGZIGd@dAdAZJdBdZKdCdDZLdEdZMdFdGZdHdZNdIdJZOdKd
ZPdLdMZQeRdNkrDeQdS)OaoTokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
zKa-Ping Yee <ping@lfw.org>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@s eZdZddZeddZdS)rcCs$d|jt|jf}d|j|dS)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))type)r
tok_name_replace)selfannotated_typer$/usr/local/lib/python3.8/tokenize.py__repr__.s
zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdSN)r
OPstringrrrrr
exact_type3s
zTokenInfo.exact_typeN)__name__
__module____qualname__rpropertyrrrrrr-sztype string start end linecGsdd|dS)N(|))joinchoicesrrrgroup:r$cGst|dS)Nrr$r"rrrany;r%r'cGst|dS)N?r&r"rrrmaybe<r%r)z[ \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]cCs^ddddddg}dh}|D]>}t|D].}tjdd	|DD]}|d|q@q(q|S)
NbrufbrfrcSsg|]}||fqSr)upper).0crrr
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)
_itertoolspermutationsproductaddr!)_valid_string_prefixesresultprefixtr,rrr_all_string_prefixesSsr=cCst|tjSr)recompileUNICODE)exprrrr_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z
\\\r?\n|\Zc@seZdZdS)
TokenErrorNrrrrrrrrGsrGc@seZdZdS)StopTokenizingNrHrrrrrIsrIc@s,eZdZddZddZddZddZd	S)
UntokenizercCsg|_d|_d|_d|_dS)Nr)tokensprev_rowprev_colencodingrrrr__init__szUntokenizer.__init__cCs|\}}||jks&||jkr>||jkr>td|||j|j||j}|rb|jd|d|_||j}|r|jd|dS)Nz+start ({},{}) precedes previous end ({},{})\
r )rMrN
ValueErrorformatrLappend)rstartrowcol
row_offset
col_offsetrrradd_whitespaces

zUntokenizer.add_whitespacecCs6t|}g}d}|D]}t|dkr8|||q*|\}}}}	}
|tkrV||_q|tkrdq*|tkrz||qnl|tkr|	|	\|_
|_qnL|tt
fkrd}n:|r|r|d}|dt|kr|j|t||_d}|||j||	\|_
|_|tt
fkr|j
d7_
d|_qd|jS)NFTrKrr0)iterlencompatENCODINGrO	ENDMARKERINDENTrUDEDENTpoprMrNNEWLINENLrLr[r!)riterableitindents	startliner<tok_typetokenrVendlineindentrrrrsF



zUntokenizer.untokenizec
Csg}|jj}|dttfk}d}t|g|D]}|dd\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr|rzd|	}	d}nd}|tkr||	q.n>|tkr|
q.n*|ttfkrd}n|r|r||dd}||	q.dS)NrFr\rRTr])rLrUrfrgr5chainrarONAMENUMBERSTRINGrcrdre)
rrmrhrjtoks_appendrk
prevstringtoktoknumtokvalrrrr`s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJs
%rJcCs*t}||}|jdk	r&||j}|S)aTransform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output bytes will tokenize back to the input
        t1 = [tok[:2] for tok in tokenize(f.readline)]
        newcode = untokenize(t1)
        readline = BytesIO(newcode).readline
        t2 = [tok[:2] for tok in tokenize(readline)]
        assert t1 == t2
    N)rJrrOencode)rhutoutrrrrs


cCsH|dddd}|dks*|dr.dS|dks@|drDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N_-utf-8zutf-8-)zlatin-1
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r)lowerreplace
startswith)orig_encencrrr_get_normal_namesrcszjjWntk
r$dYnXdd}d}fdd}fdd}|}|trpd|d	d}d
}|s||gfS||}|r||gfSt|s||gfS|}|s||gfS||}|r|||gfS|||gfS)a
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file.  It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263.  If both a bom and a cookie are present,
    but disagree, a SyntaxError will be raised.  If the encoding cookie is an
    invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    NFrcs$zWStk
rYdSXdS)Nr%)
StopIterationrreadlinerrread_or_stop?sz%detect_encoding.<locals>.read_or_stopcsz|d}Wn4tk
rBd}dk	r6d|}t|YnXt|}|sVdSt|d}zt|}Wn:t	k
rdkrd|}nd|}t|YnXr|dkr؈dkrd}n
d}t||d	7}|S)
Nrz'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
decodeUnicodeDecodeErrorrTSyntaxError	cookie_rematchrr$rLookupError)roline_stringmsgrrOcodec)	bom_foundfilenamerrfind_cookieEs8


z$detect_encoding.<locals>.find_cookieT	utf-8-sig)__self__nameAttributeErrorrrblank_rer)rrOdefaultrrfirstsecondr)rrrrr
's8
&




cCsXt|d}z2t|j\}}|dt||dd}d|_|WS|YnXdS)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    rbrT)line_bufferingr+N)
_builtin_openr
rseekrmodeclose)rbufferrOlinestextrrrrs

rcCs6t|\}}td}t|t|d|}t|j|S)a
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r%)r
r5repeatrqr^	_tokenize__next__)rrOconsumedemptyrl_genrrrrs
ccs|d}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|dddVd}
d}z|}
|}Wntk
rvd}YnX|dk	r||}|d	7}dt|}}
|rp|std
|||}|r|d}}tt||d||||f||Vd\}}d}nf|rZ|dddkrZ|d
ddkrZtt	||||t|f|Vd}d}qPn||}||}qPn|dkr|s|sqd}||
kr||dkr|d	7}n8||dkr|t
d	t
}n||dkrd}nq|d	7}q||
krq||dkr||dkr^||dd}tt|||f||t|f|V|t|7}tt
||d||f|t|f|VqP||	dkr|	|tt|d||df||f|V||	dkr.||	krtdd|||f|	dd}	ttd||f||f|Vqn|s*td|dfd}||
krPtt||}|r|d	\}}||f||f|}}}||krq.|||||}}||ks|dkr|dkr|dkrtt||||Vq|dkr|dkrtt
||||Vntt||||Vq|dkrB|dr,ttt||||Vq|tkrtt|}|||}|r|d}|||}tt||||f|Vn||f}||d}|}qPq|tks|ddtks|ddtkrV|ddkrB||f}tt|p$t|d	p$t|d}||dd	}}|}qPntt||||Vnf|rttt||||VnH|dkrd	}n8|dkr|d	7}n|d kr|d	8}tt||||Vn*tt	||||f||d	f|V|d	7}q.qP|
r0|
ddkr0ttd|d	t|
f|d	t|
d	fdV|	d	dD] }ttd|df|dfdVq<tt d|df|dfdVdS)!Nr
0123456789)r0rrr)rrr0r%rKzEOF in multi-line stringrQz\
rR	z#
#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement.z...
r\r\z([{z)]})!rrarrr_rGrrnrt
ERRORTOKENtabsizerstripCOMMENTrgrUrcIndentationErrorrdrBPseudoTokenspanrsrfendswithAssertionError
triple_quotedendpats
single_quotedgetisidentifierrrrrb)rrOlnumparenlev	continuednumcharscontstrneedcontcontlinerj	last_lineroposmaxstrstartendprogendmatchrncolumn
comment_tokenpseudomatchrVsposeposrminitialrprrrrs>




*






"

 














.rcCs
t|dS)zTokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    N)rrrrrr	dsc

s$ddl}dddfdd	}|jdd}|jdd	d
dd|jd
ddddd|}z|jr|j}t|d}tt|j}W5QRXnd}t	t
jjd}|D]>}|j}|j
r|j}d|j|j}	td|	t||jfqWn8tk
r6}
z0|
jddd\}}||
jd|||fW5d}
~
XYntk
r|}
z(|
jd\}}||
jd|||fW5d}
~
XYntk
r}
z||
|W5d}
~
XYnxtk
r}
z||
W5d}
~
XYnNtk
rtdYn2tk
r}
zd|
W5d}
~
XYnXdS)NrcSstj|tjddS)Nr)sysstderrwrite)messagerrrperrorpszmain.<locals>.perrorcsR|r"|f||f}d|n"|r8d||fnd|tddS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)rexit)rrlocationargsrrrerrortszmain.<locals>.errorzpython -m tokenize)progrr(zfilename.pyz'the file to tokenize; defaults to stdin)destnargsmetavarhelpz-ez--exactexact
store_truez(display token names using the exact type)ractionrrz<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKrzinterrupted
zunexpected error: %s)NN)argparseArgumentParseradd_argument
parse_argsrrlistrrrrstdinr
rrrVrnprintrrrrrGrOSErrorKeyboardInterrupt	Exception)
rrparserrrr-rLrm
token_typetoken_rangeerrrorrrrmainlsT&&r__main__)S__doc__
__author____credits__builtinsrrcodecsrrcollectionsior	itertoolsr5r>rrmrr?ASCIIrr__all__
namedtuplerr$r'r)
WhitespaceCommentIgnoreName	Hexnumber	Binnumber	Octnumber	Decnumber	IntnumberExponent
PointfloatExpfloatFloatnumber
ImagnumberNumberr=rBStringPrefixSingleDoubleSingle3Double3TripleStringmapescapesortedSpecialFunny
PlainTokenTokenContStrPseudoExtrasrr_prefixsetrrr<r,r8rrrGrIrJrrr
rrr	rrrrrr<module>s






_]8=


Zerion Mini Shell 1.0