Hacked By AnonymousFox

Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/tokenize.cpython-39.opt-1.pyc

a

���ee�@sBdZdZdZddlmZddlmZmZddl	Z	ddl
mZddlZ
ddlZddlZddlTdd	lmZe�d
ej�Ze�dej�ZddlZejgd�Z[Gd
d�de	�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZ dZ!dZ"dZ#ee e!e"e#�Z$dZ%edd �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-d-�Z2ee-d.e-d/�Z3ee4ej5e6ed0d1���Z7ed2e7�Z8ee*e8e3e�Z9ee9Z:ee-d3ed4d�e-d5ed6d��Z;ed7ee2�Z<eee<e*e8e;e�Z=iZ>e+�D]6Z?e.e>e?d4<e/e>e?d6<e0e>e?d,<e1e>e?d-<�q&e@�ZAe@�ZBe+�D]JZCeCd6eCd4fD]ZDeA�EeD��q�eCd-eCd,fD]ZDeB�EeD��q��qpd8ZFGd9d:�d:eG�ZHGd;d<�d<eG�ZIGd=d>�d>�ZJd?d@�ZKdAdB�ZLdCdD�ZMdEdF�ZdGdH�ZNdIdJ�ZOdKdL�ZPdMdN�ZQeRdOk�r>eQ�dS)PaoTokenization 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)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$))�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$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/python39/lib64/python3.9/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtvrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-srztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<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]cCsVgd�}dh}|D]>}t�|�D].}tjdd�|D��D]}|�d�|��q8q q|S)N)�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^r%z(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�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|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�r%rGc@seZdZdS)�StopTokenizingNrHrrrrrI�r%rIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__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 ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fvr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fvr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfv}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fvrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfvr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdur&|�|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)rJrrO�encode)rh�ut�outrrrrs


rcCsH|dd����dd�}|dks*|�d�r.dS|dvs@|�d�rDd	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�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wnty"d�Yn0d�d}d}�fdd�}��fdd�}|�}|�t�rnd�|d	d�}d
}|sz|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.
    NFr�cs"z��WStyYdS0dS)Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn2ty@d}�dur4d�|��}t|��Yn0t�|�}|sTdSt|�d��}zt|�}Wn8t	y��dur�d|}nd��|�}t|��Yn0�r�|dkrԈdur�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




r
cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���Yn0dS)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��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}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
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
rccszd}}}d}d\}}d}dg}	|durH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntytd}Yn0|dur�|�|�}|d	7}dt|�}}
|�rn|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rX|dd�dk�rX|d
d�dk�rXtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dv�r�||dk�r\||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r,||	v�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s(td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r~�q,|||�||}}||v�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dv�r|dk�r�tt
||||�Vntt||||�V�q�|dk�r0tt||||�V�q�|tv�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tv�s�|dd�tv�s�|dd�tv�rD|ddk�r0||f}tt�|��pt�|d	��pt�|d��}||d�d	}}|}qPntt||||�Vnf|���rbtt||||�VnH|dk�rrd	}n8|dv�r�|d	7}n|d v�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q,qP|
�r.|
ddv�r.|
���d��s.ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q:tt d|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...r\r��
�\z([{z)]})!rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�
triple_quoted�endpats�
single_quoted�get�isidentifierrrr�stripr�rb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s&




�*
�



��
"

� 

���





����





�$.r�cCs
t|d�S)z�Tokenize 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)r�r�rrrr	dsr	c

s@ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}Wd�q�1s�0Ynd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n@t�yL}
z8|
jddd�\}}||
jd|||f�WYd}
~
n�d}
~
0t�y�}
z0|
jd\}}||
jd|||f�WYd}
~
n�d}
~
0t�y�}
z||
|�WYd}
~
n�d}
~
0t�y�}
z||
�WYd}
~
nVd}
~
0t�ytd�Yn4t�y:}
z�d|
��WYd}
~
n
d}
~
00dS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<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: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.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%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT��.�**r��__main__)S�__doc__�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
��

�
���

_]8=


Hacked By AnonymousFox1.0, Coded By AnonymousFox