AlkantarClanX12

Your IP : 52.14.88.137


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/tokenize.cpython-37.opt-1.pyc

B

� f�i�/@s�dZdZdZddlmZddlmZmZddl	Z	ddl
mZddlm
Z
ddlZddlZddlZdd	lTe�d
ej�Ze�dej�ZddlZejdd
ddgZ[eeeeeeeeee e!e"e#e$e%e&e'e(e)e*e+e,e-e.e/e0e1e2e3e4e5e6e7e8e9e:e;e<e=e>e?e@eAeBeCeDd�.ZEGdd�de	�Fdd��ZGdd�ZHdd�ZIdd�ZJdZKdZLeKeIdeK�eJeL�ZMdZNdZOdZPdZQd ZReHeOePeQeR�ZSd!ZTeHd"d#�eJeT�ZUd$eTZVeHeUeV�ZWeHd%eWd&�ZXeHeXeWeS�ZYd'd(�ZZd)d*�Z[eHeZ��Z\d+Z]d,Z^d-Z_d.Z`eHe\d/e\d0�ZaeHe\d1e\d2�ZbeHd3d4d5d6d7d8d9d:�Zcd;ZdeHd<d=d>�ZeeHecedee�ZfeHeYefebeN�ZgeMegZheHe\d?eHd@d�e\dAeHdBd��ZieHdCeLea�ZjeKeHejeYefeieN�ZkiZlx@eZ�D]6Zme]elemd@<e^elemdB<e_elemd/<e`elemd0<�q�Wen�Zoen�Zpx\eZ�D]RZqx$eqdBeqd@fD]Zreo�ser��qWx$eqd0eqd/fD]Zrep�ser��q(W�q�WdDZtGdEdF�dFeu�ZvGdGdH�dHeu�ZwGdIdJ�dJ�ZxdKd�ZydLdM�ZzdNd
�Z{dOdP�ZdQd�Z|dRdS�Z}dTdU�Z~dVdW�Ze�dXk�r�e�dS)YaoTokenization 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)�lookup�BOM_UTF8N)�
TextIOWrapper)�chain)�*z&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�detect_encoding�
untokenize�	TokenInfo).�(�)�[�]�:�,�;�+�-r�/�|�&�<�>�=�.�%�{�}z==z!=z<=z>=�~�^z<<z>>z**z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//z//=z...z->�@z@=c@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r"�tok_name�_replace)�self�annotated_type�r'�-/opt/alt/python37/lib64/python3.7/tokenize.py�__repr___szTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS)N)r"�OP�string�EXACT_TOKEN_TYPES)r%r'r'r(�
exact_typeds
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r)�propertyr-r'r'r'r(r^sztype string start end linecGsdd�|�dS)Nrrr
)�join)�choicesr'r'r(�groupk�r4cGst|�dS)Nr)r4)r3r'r'r(�anylr5r6cGst|�dS)N�?)r4)r3r'r'r(�maybemr5r8z[ \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]cCsjddddddg}dh}xN|D]F}x@t�|�D]2}x,tjdd	�|D��D]}|�d�|��qFWq,WqW|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr')�upper)�.0�cr'r'r(�
<listcomp>�sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr2)�_valid_string_prefixes�result�prefix�tr;r'r'r(�_all_string_prefixes�s
rLcCst�|tj�S)N)�re�compile�UNICODE)�exprr'r'r(�_compile�srQz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z\*\*=?z>>=?z<<=?z!=z//=?z->z[+\-*/%&@|^=<>]=?rz[][(){}]z\r?\nz\.\.\.z[:;.,@]z'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN)r.r/r0r'r'r'r(rU�srUc@seZdZdS)�StopTokenizingN)r.r/r0r'r'r'r(rV�srVc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encoding)r%r'r'r(�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})z\
r� )rZr[�
ValueError�formatrY�append)r%�start�row�col�
row_offset�
col_offsetr'r'r(�add_whitespace�s

zUntokenizer.add_whitespacecCs4t|�}g}d}�x|D�]
}t|�dkr8|�||�P|\}}}}	}
|tkrV||_q|tkr`P|tkrv|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qWd�|j�S)NF�T���rXrr?)�iter�len�compat�ENCODINGr\�	ENDMARKER�INDENTra�DEDENT�poprZr[�NEWLINE�NLrYrgr2)r%�iterable�it�indents�	startlinerK�tok_type�tokenrb�end�line�indentr'r'r(r
�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}x�t|g|�D]�}|dd�\}}	|tkrR|	|_q.|ttfkrf|	d7}	|t	kr�|rzd|	}	d}nd}|t
kr�|�|	�q.n>|tkr�|��q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.WdS)NrFrhr^Tri)
rYrarrrsrrmr\�NAME�NUMBER�STRINGrorprq)
r%ryrtrv�toks_appendrw�
prevstring�tok�toknum�tokvalr'r'r(rls8
zUntokenizer.compatN)r.r/r0r]rgr
rlr'r'r'r(rW�s
%rWcCs*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)rWr
r\�encode)rt�ut�outr'r'r(r
8s


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N��_rzutf-8zutf-8-)zlatin-1z
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-z
iso-8859-1)�lower�replace�
startswith)�orig_enc�encr'r'r(�_get_normal_nameSs
r�cs�y�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|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.
    NFzutf-8cs y��Stk
rdSXdS)Nr5)�
StopIterationr')�readliner'r(�read_or_stopvsz%detect_encoding.<locals>.read_or_stopcs�y|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}yt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nzutf-8z'invalid or missing encoding declarationz{} for {!r}rXzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorr`�SyntaxError�	cookie_re�matchr�r4r�LookupError)r{�line_string�msgr�r\�codec)�	bom_found�filenamer'r(�find_cookie|s6


z$detect_encoding.<locals>.find_cookieT�z	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�r\�defaultr�r��first�secondr')r�r�r�r(r	^s8
&




cCsVt|d�}y0t|j�\}}|�d�t||dd�}d|_|S|���YnXdS)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    �rbrT)�line_bufferingr:N)�
_builtin_openr	r��seekr�mode�close)r��bufferr\�lines�textr'r'r(r�s

rcCsBddlm}m}t|�\}}t|d�}|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
    logical line; continuation lines are included.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r)r�repeatr5)�	itertoolsrr�r	rj�	_tokenize�__next__)r�rr�r\�consumed�rl_gen�emptyr'r'r(r�s

ccs�d}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}�x�y|}
|�}Wntk
rzd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rt|s�td
|��|�|�}|�r
|�d�}}tt||d|�|||f||�Vd\}}d}nf|�r^|dd�dk�r^|d
d�dk�r^tt	||||t|�f|�Vd}d}qTn||}||}qT�n�|dk�r|�s|�s�Pd}xf||
k�r�||dk�r�|d	7}n6||dk�r�|t
d	t
}n||dk�r�d}nP|d	7}�q�W||
k�rP||dk�r�||dk�r`||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqT||	dk�r�|	�|�tt|d|�|df||f|�Vxp||	dk�r||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�Wn|�s0td|df��d}�x�||
k�r�tt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q8|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�rtt
||||�Vntt||||�V�q�|dk�r>tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}P�q�|tk�s�|dd�tk�s�|dd�tk�rR|ddk�r>||f}tt�|��p t�|d	��p t�|d��}||d�d	}}|}Pntt||||�Vnf|���rptt||||�VnH|dk�r�d	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q8WqTW|
�r0|
ddk�r0ttd|d	t|
�f|d	t|
�d	fd�Vx0|	d	d�D] }ttd|df|dfd�V�q>Wttd|df|dfd�VdS)!Nr�
0123456789)r?rz	utf-8-sigzutf-8)rrr?r5rXzEOF in multi-line string���z\
���z\
r^�	�z#
�#z
riz3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statementrz...rhr��
�\z([{z)]})rrmr�r�rkrUr�rzr�
ERRORTOKEN�tabsize�rstrip�COMMENTrsraro�IndentationErrorrprQ�PseudoToken�spanr~rr�
triple_quoted�endpats�
single_quoted�get�isidentifierr}r*rn)r�r\�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerv�	last_liner{�pos�max�strstart�endprog�endmatchrz�column�
comment_token�pseudomatchrb�spos�eposry�initialr|r'r'r(r��s




*



"
"













. r�cCs
t|d�S)N)r�)r�r'r'r(�generate_tokens�sr�c

s(ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}y�|jr�|j}t|d��}tt|j��}WdQRXnd}t	t
jjd�}xF|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�WW�n8tk
�r:}
z0|
jddd�\}}||
jd|||f�Wdd}
~
XYn�tk
�r�}
z(|
jd\}}||
jd|||f�Wdd}
~
XYn�tk
�r�}
z||
|�Wdd}
~
XYnxtk
�r�}
z||
�Wdd}
~
XYnNtk
�r�td�Yn2tk
�r"}
z�d|
��Wdd}
~
XYnXdS)NrcSst|tjd�dS)N)�file)�print�sys�stderr)�messager'r'r(�perror�szmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srX)r��exit)r�r��location�args)r�r'r(�error�szmain.<locals>.errorzpython -m tokenize)�progr�r7zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrXr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr"r�r-rbrzr�r#r+r�r�rUr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r<rYry�
token_type�token_range�errr{r�r')r�r(�main�sN
&&r��__main__)��__doc__�
__author__�__credits__�builtinsrr��codecsrr�collections�iorr�rrDrMr�ryrN�ASCIIr�r��__all__�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�ELLIPSIS�RARROW�AT�ATEQUALr,�
namedtuplerr4r6r8�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�NumberrLrQ�StringPrefix�Single�Double�Single3�Double3�Triple�String�Operator�Bracket�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�rKr;rGr�r�rUrVrWr
r�r	rr�r�r�r.r'r'r'r(�<module>s






_]:<