Current File : //usr/local/apps/python3/lib/python3.11/lib2to3/tests/__pycache__/test_parser.cpython-311.opt-1.pyc |
�
�KeW\ � �` � d Z ddlmZ ddlmZmZ ddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZ ddlmZ dd lmZ dd
lmZ G d� dej � � Z G d
� dej � � Z G d� dej � � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z! G d� de� � Z" G d� de� � Z# G d� d e� � Z$ G d!� d"e� � Z% G d#� d$e� � Z& G d%� d&e� � Z' G d'� d(e� � Z( G d)� d*e� � Z) G d+� d,ej � � Z* G d-� d.e� � Z+ G d/� d0e� � Z, G d1� d2e� � Z- G d3� d4ej � � Z.d5� Z/e0d6k r ej1 � � dS dS )7aF Test suite for 2to3's parser and grammar files.
This is the place to add tests for changes to 2to3's grammar, such as those
merging the grammars for Python 2 and 3. In addition to specific tests for
parts of the grammar we've changed, we also make sure we can parse the
test_grammar.py files from both Python 2 and Python 3.
� )�support)�driver�driver_no_print_statement� N)r )�tokenize� )�
ParseError)�python_symbolsc � � e Zd Zd� ZdS )�
TestDriverc � � d}t j |� � }| � |j d j d j t
j � � | � |j d j d j t
j � � d S )Nzprint 1
print 2
r r )r �parse_string�assertEqual�children�type�syms�
print_stmt)�self�s�ts �C/usr/local/apps/python3/lib/python3.11/lib2to3/tests/test_parser.py�
test_formfeedzTestDriver.test_formfeed# so � �(�����"�"�������A��/��2�7���I�I�I������A��/��2�7���I�I�I�I�I� N)�__name__�
__module__�__qualname__r � r r r r ! s( � � � � � �J� J� J� J� Jr r c � � e Zd Zd� Zd� Z ej ej du d� � ej ej dv d� � d� � � � � Z
d� ZdS ) �TestPgen2Cachingc �H � t j t j dd�� � d S )NFT��save�force)�pgen2_driver�load_grammarr �grammar_path�r s r �test_load_grammar_from_txt_filez0TestPgen2Caching.test_load_grammar_from_txt_file+ s# � ��!�'�"6�U�$�O�O�O�O�O�Or c �d � t j � � } t j � |t j � t j � � � � }t j t j |� � t j |� � }t j |dd�� � | �
t j � |� � � � t j |� � t j |dd�� � t j |� � d S # t j |� � w xY w)NTr! F)�tempfile�mkdtemp�os�path�join�basenamer r&