✏️ 编辑:tokenize.cpython-39.pyc
路径:
/usr/lib64/python3.9/lib2to3/pgen2/__pycache__/tokenize.cpython-39.pyc
大小:14.8 KB · 修改:2026-08-12 15:51:23 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a �iR � @ s� d Z dZdZddlZddlZddlmZmZ ddlT ddl m Z d d � ee �D �g d� Z[ ze W n eyz eZ Y n0 dd � Zdd� Zdd� Zdd� ZdZdZeede � ee� ZdZdZdZdZedd�Zeeeee�ZdZedd�ee� Zd e Zeee�Z ed!e d" �Z!ee!e e�Z"d#Z#d$Z$d%Z%d&Z&d'Z'ee'd( e'd) �Z(ee'd* e'd+ �Z)ed,d-d.d/d0d1d2d3d4� Z*d5Z+ed6d7d8�Z,ee*e+e,�Z-ee"e-e)e�Z.ee. Z/ee'd9 ed:d� e'd; ed<d� �Z0edee(�Z1eee1e"e-e0e� Z2e3ej4e/e2e%e&f�\Z5Z6Z7Z8ed=d>d?d@�ed=d>dAdB�B h dC�B Z9e�4e#�e�4e$�e7e8dD�dEdF� e9D ��dGdF� e9D ��dHdF� e9D ��Z:d(d)hdIdJ� e9D �B dKdJ� e9D �B Z;d:d<hdLdJ� e9D �B dMdJ� e9D �B Z<dNZ=G dOdP� dPe>�Z?G dQdR� dRe>�Z@dSdT� ZAeAfdUdV�ZBdWdX� ZCG dYdZ� dZ�ZDe�4d[ejE�ZFe�4d\ejE�ZGd]d^� ZHd_d`� ZIdadb� ZJdcdd� ZKeLdek�r�ddlMZMeNeMjO�dk�r|eBePeMjOd �jQ� neBeMjRjQ� dS )fa� Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" 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 Older entry points tokenize_loop(readline, tokeneater) tokenize(readline, tokeneater=printtoken) are the same, except instead of generating tokens, tokeneater is a callback function to which the 5 fields described above are passed as 5 arguments, each time a new token is found.zKa-Ping Yee <ping@lfw.org>z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro� N)�BOM_UTF8�lookup)�*� )�tokenc C s g | ]}|d dkr|�qS )r �_� )�.0�xr r �./usr/lib64/python3.9/lib2to3/pgen2/tokenize.py� <listcomp>% � r )�tokenize�generate_tokens� untokenizec G s dd� | � d S )N�(�|�))�join��choicesr r r �group0 r r c G s t | � d S )Nr �r r r r r �any1 r r c G s t | � d S )N�?r r r r r �maybe2 r r c s t � fdd�� D ��S )Nc 3 s4 | ],}� d D ]}|� � |� � kr|| V qqdS ))� N)�casefold)r r �y��lr r � <genexpr>4 s z _combinations.<locals>.<genexpr>)�setr r r r � _combinations3 s �r# z[ \f\t]*z #[^\r\n]*z\\\r?\nz\w+z0[bB]_?[01]+(?:_[01]+)*z(0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?z0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?z[1-9]\d*(?:_\d+)*[lL]?z0[lL]?z[eE][-+]?\d+(?:_\d+)*z\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?z\.\d+(?:_\d+)*z\d+(?:_\d+)*z\d+(?:_\d+)*[jJ]z[jJ]z[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?�'''�"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z\*\*=?z>>=?z<<=?z<>z!=z//=?z->z[+\-*/%&@|^=<>]=?�~z[][(){}]z\r?\nz:=z[:;.,`@]z'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"�r�R�f�F�b�B> ZuR�u�urZUr�UZUR)r'