Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_lib2to3/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_lib2to3/__pycache__/test_parser.cpython-312.opt-2.pyc

�

)Μg]\���	ddlmZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlmZddlmZddlmZddlmZGd	�d
ej0�ZGd�dej0�ZGd
�dej0�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Z Gd�de�Z!Gd�de�Z"Gd�de�Z#Gd�d e�Z$Gd!�d"e�Z%Gd#�d$e�Z&Gd%�d&e�Z'Gd'�d(e�Z(Gd)�d*ej0�Z)Gd+�d,e�Z*Gd-�d.e�Z+Gd/�d0e�Z,Gd1�d2ej0�Z-d3�Z.e/d4k(rej`�yy)5�)�support)�driver�driver_no_print_statement�N)r)�tokenize)�
ParseError)�python_symbolsc��eZdZd�Zy)�
TestDriverc�B�d}tj|�}|j|jdjdjt
j�|j|jdjdjt
j�y)Nzprint 1
print 2
rr)r�parse_string�assertEqual�children�type�syms�
print_stmt)�self�s�ts   �:/usr/local/lib/python3.12/test/test_lib2to3/test_parser.py�
test_formfeedzTestDriver.test_formfeed#sq��(������"��������A��/�/��2�7�7����I�������A��/�/��2�7�7����I�N)�__name__�
__module__�__qualname__r�rrrr!s��Jrrc��eZdZd�Zd�Zejejdud�ejejdvd�d���Z
d�Zy)	�TestPgen2Cachingc�P�tjtjdd��y)NFT��save�force)�pgen2_driver�load_grammarr�grammar_path�rs r�test_load_grammar_from_txt_filez0TestPgen2Caching.test_load_grammar_from_txt_file+s���!�!�'�"6�"6�U�$�Orc�z�tj�}	tjj	|tjjtj��}tjtj|�tj|�}tj|dd��|jtjj|��tj|�tj|dd��tj |�y#tj |�wxYw)NTr F)�tempfile�mkdtemp�os�path�join�basenamerr%�shutil�copyr#�_generate_pickle_namer$�
assertTrue�exists�unlink�rmtree)r�tmpdir�grammar_copy�pickle_names    r�test_load_grammar_from_picklez.TestPgen2Caching.test_load_grammar_from_pickle.s����!�!�#��	"��7�7�<�<��B�G�G�,�,�W�-A�-A�B�D�L��K�K��,�,�l�;�&�<�<�\�J�K��%�%�l��T�J��O�O�B�G�G�N�N�;�7�8��I�I�l�#��%�%�l��e�L��M�M�&�!��F�M�M�&�!�s�C7D#�#D:Nzsys.executable required>�wasi�
emscriptenzrequires working subprocessc�B�tj�}tjj	|d�}	tj
|�tjj
tj�}tjj	||�}tjj	||�}tjtj|�tjtj|�tj|�}tj|�}|j||�tj|dd��|jtjj!|��t#tj$�}d|d<d|�d�}	t&j(dd	|	g}
t+j,|
|�
�|jtjj!|��t/|d�5}t/|d�5}|j1|j3�|j3�d�
�ddd�ddd�tj4|�y#1swY�'xYw#1swY�+xYw#tj4|�wxYw)N�subdirTr �random�PYTHONHASHSEEDzL
from lib2to3.pgen2 import driver as pgen2_driver
pgen2_driver.load_grammar(z%, save=True, force=True)
            z#-Wignore:lib2to3:DeprecationWarningz-c)�env�rbzGGrammar caches generated using different hash seeds were not identical.)�msg)r)r*r+r,r-�mkdirr.rr%r/r0r#r1�assertNotEqualr$r2r3�dict�environ�sys�
executable�
subprocess�
check_call�openr�readr5)
rr6�	tmpsubdir�grammar_baser7�grammar_sub_copyr8�pickle_sub_name�sub_env�code�cmd�
pickle_f_1�
pickle_f_2s
             r�!test_load_grammar_from_subprocessz2TestPgen2Caching.test_load_grammar_from_subprocess@s���
�!�!�#���G�G�L�L���2�	�%	"��H�H�Y���7�7�+�+�G�,@�,@�A�L��7�7�<�<���=�L�!�w�w�|�|�I�|�D���K�K��,�,�l�;��K�K��,�,�.>�?�&�<�<�\�J�K�*�@�@�%�'�O�����_�=�
�%�%�l��T�J��O�O�B�G�G�N�N�;�7�8��2�:�:�&�G�(0�G�$�%�$�&�D��>�>�8����C�
�!�!�3�G�4��O�O�B�G�G�N�N�?�;�<��k�4�(�J���$�/�:�� � ��O�O�%�z���'8�+�!�,�0�)�
�M�M�&�!�
0�/��)�(��
�M�M�&�!�s<�GJ�
I;�1I/�	I;�J�/I8	�4I;�;J�J�Jc�:���tdz�Gd�d��G��fd�d�}|�tj�<|jtj
tj��t
j�d�}|j|jd�y)Nz
.load_testc��eZdZd�Zy)�=TestPgen2Caching.test_load_packaged_grammar.<locals>.MyLoaderc�0�tjddi�S)N�elephant�)�pickle�dumps)r�wheres  r�get_datazFTestPgen2Caching.test_load_packaged_grammar.<locals>.MyLoader.get_dataqs���|�|�Z��$4�5�5rN)rrrr`rrr�MyLoaderrYps��
6rrac�X��eZdZdZej
j
W�W���Zy)�=TestPgen2Caching.test_load_packaged_grammar.<locals>.MyModule�parsertestmoduleN)rrr�__file__�	importlib�util�spec_from_loader�__spec__)ra�modnames��r�MyModulercss ���)�H� �~�~�6�6�w��
�K�HrrkzGrammar.txtr\)
rrG�modules�
addCleanup�operator�delitemr#�load_packaged_grammarrr[)rrk�grarjs   @@r�test_load_packaged_grammarz+TestPgen2Caching.test_load_packaged_grammarnsu����\�)��	6�	6�	L�	L� (�z����G������(�(�#�+�+�w�?��.�.�w�
�F��������R�(r)rrrr'r9�unittest�skipIfrGrH�platformrVrrrrrrr*sb��P�"�$�X�_�_�S�^�^�t�+�-F�G��X�_�_����.�.�0M��("��H�("�T)rrc��eZdZd�Zd�Zy)�GrammarTestc�.�tj|�y)N)rr
�rrRs  r�validatezGrammarTest.validate}s�����T�"rc�Z�	|j|�td��#t$rYywxYw)Nz Syntax shouldn't have been valid)rz�AssertionErrorrrys  r�invalid_syntaxzGrammarTest.invalid_syntax�s6��	E��M�M�$��!�!C�D�D���	��	�s��	*�*N)rrrrzr}rrrrwrw|s
��#�Errwc��eZdZd�Zy)�TestMatrixMultiplicationc�H�|jd�|jd�y)Nza @ bza @= b�rzr&s r�#test_matrix_multiplication_operatorz<TestMatrixMultiplication.test_matrix_multiplication_operator�s���
�
�g���
�
�h�rN)rrrr�rrrrr�s�� rrc��eZdZd�Zy)�
TestYieldFromc�j�|jd�|jd�|jd�y)Nzyield from xz(yield from x) + yz
yield from�rzr}r&s r�test_yield_fromzTestYieldFrom.test_yield_from�s)���
�
�n�%��
�
�*�+����L�)rN)rrrr�rrrr�r��s��*rr�c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestAsyncAwaitc�z�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�|jd�y)NzLasync def foo():
                             await x
                      zYasync def foo():
                             [i async for i in b]
                      z�async def foo():
                             {i for i in b
                                async for i in a if await i
                                  for b in i}
                      zdasync def foo():
                             [await i for i in b if await c]
                      zYasync def foo():
                             [ i for i in b if c]
                      zhasync def foo():

            def foo(): pass

            def foo(): pass

            await x
        zasync def foo(): return await azTdef foo():
            def foo(): pass
            async def foo(): await x
        zawait xz5def foo():
                                   await xzedef foo():
            def foo(): pass
            async def foo(): pass
            await x
        r�r&s r�test_await_exprzTestAsyncAwait.test_await_expr�s����
�
��	�	
�
�
��	�	
�
�
��	�	
�
�
��	�	
�
�
��	�	
�
�
��	
�	
�
�
�;�<��
�
��	
�
	
���I�&����.�	/�	
����	
rc�j�|jd�|jd�|jd�y)Nz	async = 1z	await = 1zdef async(): passr�r&s r�test_async_varzTestAsyncAwait.test_async_var�s'���
�
�o�&��
�
�o�&��
�
�-�.rc�&�|jd�y)NzDasync def foo():
                             async for a in b: passr�r&s r�test_async_forzTestAsyncAwait.test_async_for�s���
�
�7�	8rc�H�|jd�|jd�y)Nz@async def foo():
                             async with a: passz@def foo():
                                   async with a: passr�r&s r�test_async_withzTestAsyncAwait.test_async_with�s(���
�
�3�	4�	
���9�	:rc�H�|jd�|jd�y)NzLasync def foo():
                   return (i * 2 async for i in arange(42))zFdef foo():
                   return (i * 2 async for i in arange(42))r�r&s r�test_async_generatorz#TestAsyncAwait.test_async_generator�s&���
�
�
?�	
�	
�
�
�
?�	
rN)rrrr�r�r�r�r�rrrr�r��s��/
�b/�
8�:�
rr�c�B�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�TestRaiseChangesc�&�|jd�y)N�raiser�r&s r�test_2x_style_1z TestRaiseChanges.test_2x_style_1�s���
�
�g�rc�&�|jd�y)Nz
raise E, Vr�r&s r�test_2x_style_2z TestRaiseChanges.test_2x_style_2�����
�
�l�#rc�&�|jd�y)Nz
raise E, V, Tr�r&s r�test_2x_style_3z TestRaiseChanges.test_2x_style_3�����
�
�o�&rc�&�|jd�y)Nzraise E, V, T, Z�r}r&s r�test_2x_style_invalid_1z(TestRaiseChanges.test_2x_style_invalid_1�s�����.�/rc�&�|jd�y)Nzraise E1 from E2r�r&s r�
test_3x_stylezTestRaiseChanges.test_3x_style�����
�
�(�)rc�&�|jd�y)Nzraise E, V from E1r�r&s r�test_3x_style_invalid_1z(TestRaiseChanges.test_3x_style_invalid_1�s�����0�1rc�&�|jd�y)Nzraise E from E1, E2r�r&s r�test_3x_style_invalid_2z(TestRaiseChanges.test_3x_style_invalid_2�s�����1�2rc�&�|jd�y)Nzraise from E1, E2r�r&s r�test_3x_style_invalid_3z(TestRaiseChanges.test_3x_style_invalid_3�s�����/�0rc�&�|jd�y)Nzraise E fromr�r&s r�test_3x_style_invalid_4z(TestRaiseChanges.test_3x_style_invalid_4�s�����N�+rN)rrrr�r�r�r�r�r�r�r�r�rrrr�r��s/���$�'�0�*�2�3�1�,rr�c���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"y!)"�TestUnpackingGeneralizationsc�&�|jd�y)Nzfunc(1, *(2, 3), 4)r�r&s r�test_mid_positional_starz5TestUnpackingGeneralizations.test_mid_positional_star����
�
�/�0rc�&�|jd�y)Nz,func(**{'eggs':'scrambled', 'spam':'fried'})r�r&s r�test_double_star_dict_literalz:TestUnpackingGeneralizations.test_double_star_dict_literals���
�
�H�Irc�&�|jd�y)Nz*func(spam='fried', **{'eggs':'scrambled'})r�r&s r�,test_double_star_dict_literal_after_keywordszITestUnpackingGeneralizations.test_double_star_dict_literal_after_keywords
s���
�
�F�Grc�H�|jd�|jd�y)Nzfunc(**{'a':2} or {})zfunc(**() or {})r�r&s r�test_double_star_expressionz8TestUnpackingGeneralizations.test_double_star_expression
s���
�
�1�2��
�
�,�-rc�&�|jd�y)Nzfunc(*[] or [2])r�r&s r�test_star_expressionz1TestUnpackingGeneralizations.test_star_expressions���
�
�,�-rc�&�|jd�y)Nz[*{2}, 3, *[4]]r�r&s r�test_list_displayz.TestUnpackingGeneralizations.test_list_display����
�
�+�,rc�&�|jd�y)Nz{*{2}, 3, *[4]}r�r&s r�test_set_displayz-TestUnpackingGeneralizations.test_set_displayr�rc�&�|jd�y)Nz{**{}}r�r&s r�test_dict_display_1z0TestUnpackingGeneralizations.test_dict_display_1r�rc�&�|jd�y)Nz{**{}, 3:4, **{5:6, 7:8}}r�r&s r�test_dict_display_2z0TestUnpackingGeneralizations.test_dict_display_2s���
�
�5�6rc�&�|jd�y)Nzfunc(* [] or [1])r�r&s r�test_complex_star_expressionz9TestUnpackingGeneralizations.test_complex_star_expression s���
�
�)�*rc�&�|jd�y)Nz5func(**{1: 3} if False else {x: x for x in range(3)})r�r&s r�#test_complex_double_star_expressionz@TestUnpackingGeneralizations.test_complex_double_star_expression#s���
�
�M�Nrc�&�|jd�y)Nzf(a, *b, *c, d)r�r&s r�test_argument_unpacking_1z6TestUnpackingGeneralizations.test_argument_unpacking_1&r�rc�&�|jd�y)Nzf(**a, **b)r�r&s r�test_argument_unpacking_2z6TestUnpackingGeneralizations.test_argument_unpacking_2)����
�
�'�(rc�&�|jd�y)Nzf(2, *a, *b, **b, **c, **d)r�r&s r�test_argument_unpacking_3z6TestUnpackingGeneralizations.test_argument_unpacking_3,����
�
�7�8rc�H�|jd�|jd�y)Nzdef f(a, b): call(a, b)zdef f(a, b,): call(a, b,)r�r&s r�test_trailing_commas_1z3TestUnpackingGeneralizations.test_trailing_commas_1/����
�
�/�0��
�
�1�2rc�H�|jd�|jd�y)Nzdef f(a, *b): call(a, *b)zdef f(a, *b,): call(a, *b,)r�r&s r�test_trailing_commas_2z3TestUnpackingGeneralizations.test_trailing_commas_23s���
�
�1�2��
�
�3�4rc�H�|jd�|jd�y)Nzdef f(a, b=1): call(a, b=1)zdef f(a, b=1,): call(a, b=1,)r�r&s r�test_trailing_commas_3z3TestUnpackingGeneralizations.test_trailing_commas_37����
�
�3�4��
�
�5�6rc�H�|jd�|jd�y)Nzdef f(a, **b): call(a, **b)zdef f(a, **b,): call(a, **b,)r�r&s r�test_trailing_commas_4z3TestUnpackingGeneralizations.test_trailing_commas_4;r�rc�H�|jd�|jd�y)Nzdef f(*a, b=1): call(*a, b=1)zdef f(*a, b=1,): call(*a, b=1,)r�r&s r�test_trailing_commas_5z3TestUnpackingGeneralizations.test_trailing_commas_5?����
�
�5�6��
�
�7�8rc�H�|jd�|jd�y)Nzdef f(*a, **b): call(*a, **b)zdef f(*a, **b,): call(*a, **b,)r�r&s r�test_trailing_commas_6z3TestUnpackingGeneralizations.test_trailing_commas_6Cr�rc�H�|jd�|jd�y)Nzdef f(*, b=1): call(*b)zdef f(*, b=1,): call(*b,)r�r&s r�test_trailing_commas_7z3TestUnpackingGeneralizations.test_trailing_commas_7Gr�rc�H�|jd�|jd�y)Nzdef f(a=1, b=2): call(a=1, b=2)z!def f(a=1, b=2,): call(a=1, b=2,)r�r&s r�test_trailing_commas_8z3TestUnpackingGeneralizations.test_trailing_commas_8K����
�
�7�8��
�
�9�:rc�H�|jd�|jd�y)Nzdef f(a=1, **b): call(a=1, **b)z!def f(a=1, **b,): call(a=1, **b,)r�r&s r�test_trailing_commas_9z3TestUnpackingGeneralizations.test_trailing_commas_9Or�rc�H�|jd�|jd�y)Nzf = lambda a, b: call(a, b)zf = lambda a, b,: call(a, b,)r�r&s r�test_trailing_commas_lambda_1z:TestUnpackingGeneralizations.test_trailing_commas_lambda_1Sr�rc�H�|jd�|jd�y)Nzf = lambda a, *b: call(a, *b)zf = lambda a, *b,: call(a, *b,)r�r&s r�test_trailing_commas_lambda_2z:TestUnpackingGeneralizations.test_trailing_commas_lambda_2Wr�rc�H�|jd�|jd�y)Nzf = lambda a, b=1: call(a, b=1)z!f = lambda a, b=1,: call(a, b=1,)r�r&s r�test_trailing_commas_lambda_3z:TestUnpackingGeneralizations.test_trailing_commas_lambda_3[r�rc�H�|jd�|jd�y)Nzf = lambda a, **b: call(a, **b)z!f = lambda a, **b,: call(a, **b,)r�r&s r�test_trailing_commas_lambda_4z:TestUnpackingGeneralizations.test_trailing_commas_lambda_4_r�rc�H�|jd�|jd�y)Nz!f = lambda *a, b=1: call(*a, b=1)z#f = lambda *a, b=1,: call(*a, b=1,)r�r&s r�test_trailing_commas_lambda_5z:TestUnpackingGeneralizations.test_trailing_commas_lambda_5c����
�
�9�:��
�
�;�<rc�H�|jd�|jd�y)Nz!f = lambda *a, **b: call(*a, **b)z#f = lambda *a, **b,: call(*a, **b,)r�r&s r�test_trailing_commas_lambda_6z:TestUnpackingGeneralizations.test_trailing_commas_lambda_6gr�rc�H�|jd�|jd�y)Nzf = lambda *, b=1: call(*b)zf = lambda *, b=1,: call(*b,)r�r&s r�test_trailing_commas_lambda_7z:TestUnpackingGeneralizations.test_trailing_commas_lambda_7kr�rc�H�|jd�|jd�y)Nz#f = lambda a=1, b=2: call(a=1, b=2)z%f = lambda a=1, b=2,: call(a=1, b=2,)r�r&s r�test_trailing_commas_lambda_8z:TestUnpackingGeneralizations.test_trailing_commas_lambda_8o����
�
�;�<��
�
�=�>rc�H�|jd�|jd�y)Nz#f = lambda a=1, **b: call(a=1, **b)z%f = lambda a=1, **b,: call(a=1, **b,)r�r&s r�test_trailing_commas_lambda_9z:TestUnpackingGeneralizations.test_trailing_commas_lambda_9sr�rN)#rrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�r�s���1�J�H�.�.�-�-�$�7�+�O�-�)�9�3�5�7�7�9�9�3�;�;�7�9�;�;�=�=�7�?�?rr�c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�TestFunctionAnnotationsc�&�|jd�y)Nzdef f(x) -> list: passr�r&s r�test_1zTestFunctionAnnotations.test_1z����
�
�2�3rc�&�|jd�y)Nzdef f(x:int): passr�r&s r�test_2zTestFunctionAnnotations.test_2}s���
�
�.�/rc�&�|jd�y)Nzdef f(*x:str): passr�r&s r�test_3zTestFunctionAnnotations.test_3�r�rc�&�|jd�y)Nzdef f(**x:float): passr�r&s r�test_4zTestFunctionAnnotations.test_4�r�rc�&�|jd�y)Nzdef f(x, y:1+2): passr�r&s r�test_5zTestFunctionAnnotations.test_5�s���
�
�1�2rc�&�|jd�y)Nzdef f(a, (b:1, c:2, d)): passr�r&s r�test_6zTestFunctionAnnotations.test_6�s���
�
�9�:rc�&�|jd�y)Nz/def f(a, (b:1, c:2, d), e:3=4, f=5, *g:6): passr�r&s r�test_7zTestFunctionAnnotations.test_7�s���
�
�K�Lrc�*�d}|j|�y)Nzgdef f(a, (b:1, c:2, d), e:3=4, f=5,
                        *g:6, h:7, i=8, j:9=10, **k:11) -> 12: passr��rrs  r�test_8zTestFunctionAnnotations.test_8�s��
G���
�
�a�rc�*�d}|j|�y)Nz�def f(
          a: str,
          b: int,
          *,
          c: bool = False,
          **kwargs,
        ) -> None:
            call(c=c, **kwargs,)r�rs  r�test_9zTestFunctionAnnotations.test_9�s��
$��	
�
�
�a�rc�*�d}|j|�y)Nz@def f(
          a: str,
        ) -> None:
            call(a,)r�rs  r�test_10zTestFunctionAnnotations.test_10�s��
��	
�
�
�a�rc�*�d}|j|�y)NzGdef f(
          a: str = '',
        ) -> None:
            call(a=a,)r�rs  r�test_11zTestFunctionAnnotations.test_11�s��
��	
�
�
�a�rc�*�d}|j|�y)NzHdef f(
          *args: str,
        ) -> None:
            call(*args,)r�rs  r�test_12zTestFunctionAnnotations.test_12�s��
��	
�
�
�a�rc�H�|jd�|jd�y)Nz)def f(a: str, b: int) -> None: call(a, b)z+def f(a: str, b: int,) -> None: call(a, b,)r�r&s r�test_13zTestFunctionAnnotations.test_13�s���
�
�A�B��
�
�C�Drc�H�|jd�|jd�y)Nz+def f(a: str, *b: int) -> None: call(a, *b)z-def f(a: str, *b: int,) -> None: call(a, *b,)r�r&s r�test_14zTestFunctionAnnotations.test_14�s���
�
�C�D��
�
�E�Frc�H�|jd�|jd�y)Nz-def f(a: str, b: int=1) -> None: call(a, b=1)z/def f(a: str, b: int=1,) -> None: call(a, b=1,)r�r&s r�test_15zTestFunctionAnnotations.test_15�����
�
�E�F��
�
�G�Hrc�H�|jd�|jd�y)Nz-def f(a: str, **b: int) -> None: call(a, **b)z/def f(a: str, **b: int,) -> None: call(a, **b,)r�r&s r�test_16zTestFunctionAnnotations.test_16�rrc�H�|jd�|jd�y)Nz/def f(*a: str, b: int=1) -> None: call(*a, b=1)z1def f(*a: str, b: int=1,) -> None: call(*a, b=1,)r�r&s r�test_17zTestFunctionAnnotations.test_17�����
�
�G�H��
�
�I�Jrc�H�|jd�|jd�y)Nz/def f(*a: str, **b: int) -> None: call(*a, **b)z1def f(*a: str, **b: int,) -> None: call(*a, **b,)r�r&s r�test_18zTestFunctionAnnotations.test_18�r rc�H�|jd�|jd�y)Nz$def f(*, b: int=1) -> None: call(*b)z&def f(*, b: int=1,) -> None: call(*b,)r�r&s r�test_19zTestFunctionAnnotations.test_19�s���
�
�<�=��
�
�>�?rc�H�|jd�|jd�y)Nz2def f(a: str='', b: int=2) -> None: call(a=a, b=2)z4def f(a: str='', b: int=2,) -> None: call(a=a, b=2,)r�r&s r�test_20zTestFunctionAnnotations.test_20�����
�
�J�K��
�
�L�Mrc�H�|jd�|jd�y)Nz2def f(a: str='', **b: int) -> None: call(a=a, **b)z4def f(a: str='', **b: int,) -> None: call(a=a, **b,)r�r&s r�test_21zTestFunctionAnnotations.test_21�r'rN)rrrr�r�rrrrr	rrrrrrrrrrr"r$r&r)rrrr�r�ysu��4�0�1�4�3�;�M��
	����E�G�I�I�K�K�@�N�Nrr�c�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�TestVarAnnotationsc�&�|jd�y)Nz
var1: int = 5r�r&s rr�zTestVarAnnotations.test_1�r�rc�&�|jd�y)Nzvar2: [int, str]r�r&s rr�zTestVarAnnotations.test_2�r�rc�&�|jd�y)NzCdef f():
    st: str = 'Hello'
    a.b: int = (1, 2)
    return st
r�r&s rrzTestVarAnnotations.test_3�s���
�
�(�	)rc�&�|jd�y)Nz$def fbad():
    x: int
    print(x)
r�r&s rrzTestVarAnnotations.test_4�s���
�
�'�	(rc�&�|jd�y)Nzeclass C:
    x: int
    s: str = 'attr'
    z = 2
    def __init__(self, x):
        self.x: int = x
r�r&s rrzTestVarAnnotations.test_5�s���
�
�2�	3rc�&�|jd�y)Nzlst: List[int] = []r�r&s rrzTestVarAnnotations.test_6�r�rN)	rrrr�r�rrrrrrrr+r+�s ��'�*�)�(�
3�-rr+c��eZdZd�Zd�Zy)�
TestExceptc�*�d}|j|�y)NzP
            try:
                x
            except E as N:
                yr�rs  r�test_newzTestExcept.test_new����
��
	
�
�
�a�rc�*�d}|j|�y)NzN
            try:
                x
            except E, N:
                yr�rs  r�test_oldzTestExcept.test_oldr6rN)rrrr5r8rrrr3r3�s���rr3c��eZdZdZd�Zy)�TestStringLiterals)*�'�"zr'zr"zR'zR"zu'zu"zU'zU"zb'zb"zB'zB"zf'zf"zF'zF"zur'zur"zUr'zUr"zuR'zuR"zUR'zUR"zbr'zbr"zBr'zBr"zbR'zbR"zBR'zBR"zrb'zrb"zRb'zRb"zrB'zrB"zRB'zRB"c���|jD]P}dj||d��}|j|�dj||d��}|j|��Ry)Nz{p}spamspamspam{s}���)�prz{p}{s}{s}eggs{s}{s}{s})�prefixes�formatrz)r�pre�single�triples    r�test_litzTestStringLiterals.test_litsZ���=�=�C�)�0�0�3�#�b�'�0�B�F��M�M�&�!�-�4�4�s�c�"�g�4�F�F��M�M�&�!�	!rN)rrrr@rErrrr:r:
s��
%�H�"rr:c�$�eZdZd�Zd�Zd�Zd�Zy)�TestSetLiteralc�&�|jd�y)Nzx = {'one'}r�r&s rr�zTestSetLiteral.test_1!r�rc�&�|jd�y)Nzx = {'one', 1,}r�r&s rr�zTestSetLiteral.test_2$r�rc�&�|jd�y)Nzx = {'one', 'two', 'three'}r�r&s rrzTestSetLiteral.test_3'r�rc�&�|jd�y)Nzx = {2, 3, 4,}r�r&s rrzTestSetLiteral.test_4*s���
�
�*�+rN)rrrr�r�rrrrrrGrG s��)�-�9�,rrGc��eZdZd�Zy)�TestIdentifierc��|jd�|jd�|jd�|jd�y)Nu!Örter = 'places'
grün = 'green'u蟒 = a蟒 = 锦蛇 = 1uµ = aµ = µµ = 1uA𝔘𝔫𝔦𝔠𝔬𝔡𝔢 = a_𝔘𝔫𝔦𝔠𝔬𝔡𝔢 = 1r�r&s r�test_non_ascii_identifiersz)TestIdentifier.test_non_ascii_identifiers1s6���
�
�:�;��
�
�/�0��
�
�+�,��
�
�Y�ZrN)rrrrOrrrrMrM0s��[rrMc��eZdZd�Zd�Zy)�TestNumericLiteralsc�H�|jd�|jd�y)N�0o7777777777777�0o7324528887r�r&s r�test_new_octal_notationz+TestNumericLiterals.test_new_octal_notation9s���
�
�+�,����.�/rc�H�|jd�|jd�y)N�0b101010�	0b0101021r�r&s r�test_new_binary_notationz,TestNumericLiterals.test_new_binary_notation=s���
�
�n�%����O�,rN)rrrrUrYrrrrQrQ8s��0�-rrQc��eZdZd�Zy)�TestClassDefc��|jd�|jd�|jd�|jd�|jd�y)Nzclass B(t=7): passzclass B(t, *args): passzclass B(t, **kwargs): passz!class B(t, *args, **kwargs): passz'class B(t, y=9, *args, **kwargs,): passr�r&s r�test_new_syntaxzTestClassDef.test_new_syntaxCsC���
�
�*�+��
�
�/�0��
�
�2�3��
�
�9�:��
�
�?�@rN)rrrr]rrrr[r[Bs��Arr[c� �eZdZ	d�Zd�Zd�Zy)�TestParserIdempotencyc	��tjjrtd|���t	|d�5}tj|j�d}ddd�|jd|z�t	|d|��5}|j�}ddd�	tj�}t�}|k7r+tt!|||��|jd
|z�yy#1swY��xYw#1swY�gxYw#t$rH	tj�}n.#t$r"}|jd|�d|�d	��Yd}~nd}~wwxYwY��wxYw)NzParse file: rArzcan't detect encoding for %s�r)�encodingzParseError on file z (�)zIdempotency failed: %s)�testr�verbose�printrKr�detect_encoding�readline�assertIsNotNonerLrr
rr�fail�str�
diff_texts)r�filepath�fprb�source�tree�err�news        r�
parse_filez TestParserIdempotency.parse_fileOs/���<�<����L��
�+�,�
�(�D�
!�R��/�/����<�Q�?�H�"����X�;�h�F�	H�
�(�C�(�
3�r��W�W�Y�F�4�	J��&�&�v�.�D��$�i���&�=��*�V�S�(�3�4��I�I�.��9�:��"�
!��4�
3���	J�
J�0�=�=�f�E����
J��	�	�(�C�H�I�I��
J��	J�sS�#C.�C:�D�.C7�:D�	E�D&�%E�&	E�/E�E�E�E�Ec��tj�D].}|j|��5|j|�ddd��0y#1swY�;xYw)N)rm)r�all_project_files�subTestrs)rrms  r�test_all_project_filesz,TestParserIdempotency.test_all_project_filesds>���1�1�3�H����x��0�����)�1�0�4�0�0�s�A�A	c��tjd�tjd�tjd�tjd�y)Nz
a, *b, c = x
z[*a, b] = x
z(z, *y, w) = m
zfor *z, m in d: pass
�rr
r&s r�test_extended_unpackingz-TestParserIdempotency.test_extended_unpackingis=�����,�-����O�,����.�/����4�5rN)rrrrsrwrzrrrr_r_Ks��6�;�**�
6rr_c�$�eZdZd�Zd�Zd�Zd�Zy)�TestLiteralsc�Z�tjtj|�dz�y)Nz

)rr
r�dedentrs  rrzzTestLiterals.validaters�����G�N�N�1�-��6�7rc�*�d}|j|�y)Nu�
            md5test(b"ª" * 80,
                    (b"Test Using Larger Than Block-Size Key "
                     b"and Larger Than One Block-Size Data"),
                    "6f630fad67cda0ee1fb1f562db3aa53e")
            r�rs  r�test_multiline_bytes_literalsz*TestLiterals.test_multiline_bytes_literalsu���
��	
�
�
�a�rc�*�d}|j|�y)Nz�
            b"""
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN">
            """
            r�rs  r�'test_multiline_bytes_tripquote_literalsz4TestLiterals.test_multiline_bytes_tripquote_literals~r�rc�*�d}|j|�y)Nu�
            md5test("ª" * 80,
                    ("Test Using Larger Than Block-Size Key "
                     "and Larger Than One Block-Size Data"),
                    "6f630fad67cda0ee1fb1f562db3aa53e")
            r�rs  r�test_multiline_str_literalsz(TestLiterals.test_multiline_str_literals�r�rN)rrrrzr�r�r�rrrr|r|ps��8���rr|c�&�eZdZ	d�Zd�Zd�Zd�Zy)�TestNamedAssignmentsc�.�tjd�y)Nzif f := x(): pass
ryr&s r�test_named_assignment_ifz-TestNamedAssignments.test_named_assignment_if�s�����1�2rc�.�tjd�y)Nzwhile f := x(): pass
ryr&s r�test_named_assignment_whilez0TestNamedAssignments.test_named_assignment_while�s�����4�5rc�.�tjd�y)Nz0any((lastNum := num) == 1 for num in [1, 2, 3])
ryr&s r�test_named_assignment_generatorz4TestNamedAssignments.test_named_assignment_generator�s�����O�Prc�.�tjd�y)Nz-[(lastNum := num) == 1 for num in [1, 2, 3]]
ryr&s r�test_named_assignment_listcompz3TestNamedAssignments.test_named_assignment_listcomp�s�����L�MrN)rrrr�r�r�r�rrrr�r��s��,�3�6�Q�Nrr�c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestPositionalOnlyArgsc�.�tjd�y)Nz!def one_pos_only_arg(a, /): pass
ryr&s r�test_one_pos_only_argz,TestPositionalOnlyArgs.test_one_pos_only_arg�s�����@�Arc�.�tjd�y)Nz4def all_markers(a, b=2, /, c, d=4, *, e=5, f): pass
ryr&s r�test_all_markersz'TestPositionalOnlyArgs.test_all_markers�s�����G�	Irc�.�tjd�y)Nz�def all_markers_with_args_and_kwargs(
                           aa, b, /, _cc, d, *args, e, f_f, **kwargs,
                   ):
                       pass
ryr&s r�test_all_with_args_and_kwargsz4TestPositionalOnlyArgs.test_all_with_args_and_kwargs�s�����!�	"rc�.�tjd�y)Nz,lambda a, b, /, c, d, *args, e, f, **kw: kw
ryr&s r�test_lambda_soupz'TestPositionalOnlyArgs.test_lambda_soup�s�����?�	Arc�.�tjd�y)Nzdef func(a,b,/,*,g,e=3): pass
ryr&s r�test_only_positional_or_keywordz6TestPositionalOnlyArgs.test_only_positional_or_keyword�s�����=�>rN)rrrr�r�r�r�r�rrrr�r��s��B�I�"�A�?rr�c��eZdZd�Zy)�TestPickleableExceptionc�2�tdddd�}ttjdz�D]�}tjtj
||���}|j
|j|j�|j
|j|j�|j
|j|j�|j
|j|j�|j
|j|j���y)NrB�)r�contextr)�protocol)r�ranger]�HIGHEST_PROTOCOL�loadsr^r�argsrBr�valuer�)rrq�proto�err2s    r�test_ParseErrorz'TestPickleableException.test_ParseError�s������4��8���6�2�2�Q�6�7�E��<�<����S�5� A�B�D����S�X�X�t�y�y�1����S�W�W�d�h�h�/����S�X�X�t�y�y�1����S�Y�Y��
�
�3����S�[�[�$�,�,�7�
8rN)rrrr�rrrr�r��s��8rr�c	�z�|j�}|j�}tj||||ddd��S)Nz
(original)z(reserialized)�)�lineterm)�
splitlines�difflib�unified_diff)�a�b�filenames   rrlrl�s<��	����A�	����A�����1�h�� ,�.>�)+�-�-r�__main__)1r�rrrr�rfrnr+r]r/rIrGr)�test.supportrdrs�
lib2to3.pgen2r#r�lib2to3.pgen2.parser�lib2to3.pygramr	r�TestCaserrrwrr�r�r�r�r�r+r3r:rGrMrQr[r_r|r�r�r�rlr�mainrrr�<module>r�s�����6����	�
�
��
����1�"�*�1�J��!�!�J�O)�w�'�'�O)�d
E�'�"�"�
E� �{� �*�K�*�J
�[�J
�Z,�{�,�@r?�;�r?�l]N�k�]N�B-��-�<���$"��"�,,�[�,� [�[�[�-�+�-�A�;�A�"6�G�,�,�"6�J�;��B
N�;�
N� ?�[�?�0	8�h�/�/�	8�-��z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists