Your IP : 3.138.114.198


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/tokenize.cpython-310.opt-2.pyc

o

6��fAe�@sR	dZdZddlmZddlmZmZddlZddl	Z	ddl
mZddlZ
ddlZddlZddlTddlmZe�d	ej�Ze�d
ej�ZddlZejgd�Z[Gdd
�d
e�d
d��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+e	j,d%d&��Z-ee+��Z.d'Z/d(Z0d)Z1d*Z2ee.d+e.d,�Z3ee.d-e.d.�Z4ee5ej6e7ed/d0���Z8ed1e8�Z9ee*e9e4e�Z:ee:Z;ee.d2ed3d�e.d4ed5d��Z<ed6ee3�Z=eee=e*e9e<e�Z>iZ?e+�D]Z@e/e?e@d3<e0e?e@d5<e1e?e@d+<e2e?e@d,<�qeA�ZBeA�ZCe+�D]%ZDeDd5eDd3fD]ZEeB�FeE��qHeDd,eDd+fD]ZEeC�FeE��qY�q>d7ZGGd8d9�d9eH�ZIGd:d;�d;eH�ZJGd<d=�d=�ZKd>d?�ZLd@dA�ZMdBdC�ZNdDdE�ZdFdG�ZOdHdI�ZPdJdK�ZQdLdM�ZReSdNk�r�eR�dSdS)OzKa-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/python310/lib64/python3.10/tokenize.py�__repr__/s
�zTokenInfo.__repr__cCs$|jtkr|jtvrt|jS|jS�N)r
�OP�stringr�rrrr�
exact_type4s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr.srztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group;sr$cG�t|�dS)Nr�r$r"rrr�any<�r'cGr%)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�|��qqq	|S)N)�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>_sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr-rrr�_all_string_prefixesTs��r>cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilecsrCz[^'\\]*(?:\\.[^'\\]*)*'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@�eZdZdS)�
TokenErrorN�rrrrrrrrI�r(rIc@rH)�StopTokenizingNrJrrrrrK�r(rKc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�s
zUntokenizer.__init__cCs�|\}}||jks||jkr||jkrtd�|||j|j���||j}|r1|j�d|�d|_||j}|rB|j�d|�dSdS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rOrP�
ValueError�formatrN�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

�zUntokenizer.add_whitespacecCs,t|�}g}d}|D]�}t|�dkr|�||�nv|\}}}}	}
|tkr)||_q
|tkr/na|tkr9|�|�q
|tkrH|�	�|	\|_
|_q
|tt
fvrQd}n|rn|rn|d}|dt|�krl|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fvr�|j
d7_
d|_q
d�|j�S)NF�T���rMrr1)�iter�len�compat�ENCODINGrQ�	ENDMARKER�INDENTrW�DEDENT�poprOrP�NEWLINE�NLrNr]r!)r�iterable�it�indents�	startliner=�tok_type�tokenrX�end�line�indentrrrr�sH


�zUntokenizer.untokenizec
Cs�g}|jj}|dttfv}d}t�|g|�D]W}|dd�\}}	|tkr)|	|_q|tt	fvr3|	d7}	|t
kr@|r=d|	}	d}nd}|tkrL|�|	�q|tkrU|�
�q|ttfvr^d}n|rj|rj||d�d}||	�qdS)NrFr^rTTr_)rNrWrhrir6�chainrcrQ�NAME�NUMBER�STRINGrerfrg)
rrorjrl�toks_appendrm�
prevstring�tok�toknum�tokvalrrrrb�s:

�zUntokenizer.compatN)rrrrRr]rrbrrrrrL�s

%rLcCs,	t�}|�|�}|jdur|�|j�}|Sr)rLrrQ�encode)rj�ut�outrrrrs

rcCsJ	|dd����dd�}|dks|�d�rdS|dvs!|�d�r#dS|S)	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�Wntyd�Ynwd�d}d}�fdd�}��fdd�}|�}|�t�r8d�|dd�}d	}|s>|gfS||�}|rI||gfSt�|�sS||gfS|�}|s]||gfS||�}|ri|||gfS|||gfS)
NFr�csz��WStyYdSw�N�)�
StopIterationr��readlinerr�read_or_stopAs
�z%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wntyd}�durd�|��}t|��wt�|�}|s(dSt|�d��}zt|�}Wnt	yR�durHd|}t|��d��|�}t|��w�rp|dkrl�durcd}t|��d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rMzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrV�SyntaxError�	cookie_re�matchr�r$r�LookupError)rq�line_string�msgr�rQ�codec)�	bom_found�filenamerr�find_cookieGs@�
���	
�z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rQ�defaultr�r��first�secondr)r�r�r�rr
)s<�&




r
cCsP	t|d�}zt|j�\}}|�d�t||dd�}d|_|WS|���)N�rbrT)�line_bufferingr,)�
_builtin_openr
r��seekr�mode�close)r��bufferrQ�lines�textrrrr�s

rcCs8	t|�\}}t�d�}t�|t|d�|�}t|j|�Sr�)r
r6�repeatrsr`�	_tokenize�__next__)r�rQ�consumed�empty�rl_genrrrr�s

rccsl�d}}}d}d\}}d}dg}	|dur%|dkrd}tt|ddd�Vd}
d}	z|}
|�}Wnty<d}Ynw|durF|�|�}|d
7}dt|�}}
|r�|sZtd|��|�|�}|r�|�d�}}tt||d|�|||f||�Vd\}}d}�n|r�|dd�d
kr�|dd�dkr�tt	||||t|�f|�Vd}d}q)||}||}q)|dk�r�|�s�|s��n)d}||
kr�||dkr�|d
7}n||dkr�|t
d
t
}n
||dkr�d}nn|d
7}||
ks�||
kr��n�||dv�r8||dk�r$||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�Vq)||	dk�rU|	�|�tt|d|�|df||f|�V||	dk�r�||	v�rjtdd|||f��|	dd�}	ttd||f||f|�V||	dk�s\n|�s�td|df��d}||
k�r�tt��||�}|�r�|�d
�\}}||f||f|}}}||k�r��q�|||�||}}||v�s�|dk�r�|dk�r�|dk�r�tt||||�Vn�|dv�r|dk�r�tt
||||�Vn�tt||||�Vn�|dk�rtt||||�Vn�|tv�rItt|�}|�||�}|�r<|�d�}|||�}tt||||f|�Vn�||f}||d�}|}n�|tv�s`|dd�tv�s`|dd�tv�r�|ddk�r�||f}tt�|��p�t�|d
��p�t�|d��}||d�d
}}|}nXtt||||�VnI|���r�tt||||�Vn:|dk�r�d
}n2|d v�r�|d
7}n	|d!v�r�|d
8}tt||||�Vntt	||||f||d
f|�V|d
7}||
k�s�q*|
�r|
ddv�r|
���d��sttd|d
t|
�f|d
t|
�d
fd�V|	d
d�D]}ttd|df|dfd�V�qtt d|df|dfd�VdS)"Nr�
0123456789)r1rr�r�)rrr1r�TrMzEOF in multi-line string���rS���z\
rT�	�z#
�#z
r_z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...r^r��
�\z([{z)]})!rrcr�r�rarIr�rprv�
ERRORTOKEN�tabsize�rstrip�COMMENTrirWre�IndentationErrorrfrC�PseudoToken�spanrurh�
triple_quoted�endpats�
single_quoted�get�isidentifierrtr�stripr�rd)r�rQ�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerl�	last_linerq�pos�max�strstart�endprog�endmatchrp�column�
comment_token�pseudomatchrX�spos�eposro�initialrrrrrr��s*�
�


�$
�
�
��
"

���









��





�
��$#.r�cCs	t|d�Sr)r�r�rrrr	fs
r	c

s2ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}zQ|jrP|j}t|d��}tt|j��}Wd�n1sJwYn	d}t	t
jjd�}|D]}|j}|j
rf|j}d|j|j}	td|	t||jf�q[WdSty�}
z|
jddd�\}}||
jd|||f�WYd}
~
dSd}
~
wty�}
z|
jd\}}||
jd|||f�WYd}
~
dSd}
~
wty�}
z||
|�WYd}
~
dSd}
~
wty�}
z||
�WYd}
~
dSd}
~
wt�ytd�YdSt�y}
z�d|
��d}
~
ww)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorrszmain.<locals>.perrorcsR|r|f||f}�d|�n|r�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srM)r��exit)r�r��location�args�r�rr�errorvs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%-15rrMr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrXrp�printrrr�r�rIr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r.rNro�
token_type�token_range�errrqr�rr�r�mainnsf������$�$�����r��__main__)T�
__author__�__credits__�builtinsrr��codecsrr�collections�	functools�ior�	itertoolsr6r?r�rorr@�ASCIIr�r��__all__�
namedtuplerr$r'r*�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr>�	lru_cacherC�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r=r-r9r�r�rIrKrLrr�r
rr�r	r�rrrrr�<module>s�
��


�
���

�_]8
=
�

?>