Server : Apache System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64 User : nobody ( 99) PHP Version : 8.1.23 Disable Function : NONE Directory : /opt/alt/python38/lib64/python3.8/lib2to3/__pycache__/ |
U ��,a� � @ s� d Z ddlZddlmZmZmZmZmZmZ ddl m Z ddl mZ G dd� de�Z d d � ZG dd� de�Zejejejdd �Zdd� Zdd� Zdd� ZdS )z#Guido van Rossum <guido@python.org>� N� )�driver�literals�token�tokenize�parse�grammar)�pytree)�pygramc @ s e Zd ZdS )�PatternSyntaxErrorN)�__name__� __module__�__qualname__� r r �4/opt/alt/python38/lib64/python3.8/lib2to3/patcomp.pyr s r c c sL t jt jt jh}t�t�| �j�}|D ] }|\}}}}}||kr&|V q&d S �N) r �NEWLINE�INDENT�DEDENTr �generate_tokens�io�StringIO�readline) �input�skip�tokensZ quintuple�type�value�start�endZ line_textr r r �tokenize_wrapper s r c @ s: e Zd Zd dd�Zddd�Zdd� Zdd d �Zdd� ZdS )�PatternCompilerNc C sZ |d krt j| _t j| _nt�|�| _t �| j�| _t j| _ t j | _tj| jt d�| _d S )N)Zconvert)r Zpattern_grammarr Zpattern_symbols�symsr Zload_grammarZSymbolsZpython_grammarZ pygrammarZpython_symbols�pysymsZDriver�pattern_convert)�selfZgrammar_filer r r �__init__( s zPatternCompiler.__init__Fc C sp t |�}z| jj||d�}W n2 tjk rN } ztt|��d �W 5 d }~X Y nX |rb| �|�|fS | �|�S d S )N)�debug)r r Zparse_tokensr Z ParseErrorr �str�compile_node)r% r r'