403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.117
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/parso/python/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/parso/python/__pycache__/diff.cpython-312.pyc
�

̑�a������dZddlZddlZddlmZddlZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZej"e�Zd	Zd
Zej,Zej.Zej0Zej2Zej4Zd�Zd�Zd
�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d#d�Z%d�Z&d�Z'd�Z(d�Z)Gd�de*�Z+d�Z,Gd�d�Z-Gd�d �Z.Gd!�d"�Z/y)$aa
The diff parser is trying to be a faster version of the normal parser by trying
to reuse the nodes of a previous pass over the same file. This is also called
incremental parsing in parser literature. The difference is mostly that with
incremental parsing you get a range that needs to be reparsed. Here we
calculate that range ourselves by using difflib. After that it's essentially
incremental parsing.

The biggest issue of this approach is that we reuse nodes in a mutable way. The
intial design and idea is quite problematic for this parser, but it is also
pretty fast. Measurements showed that just copying nodes in Python is simply
quite a bit slower (especially for big files >3 kLOC). Therefore we did not
want to get rid of the mutable nodes, since this is usually not an issue.

This is by far the hardest software I ever wrote, exactly because the initial
design is crappy. When you have to account for a lot of mutable state, it
creates a ton of issues that you would otherwise not have. This file took
probably 3-6 months to write, which is insane for a parser.

There is a fuzzer in that helps test this whole thing. Please use it if you
make changes here. If you run the fuzzer like::

    test/fuzz_diff_parser.py random -n 100000

you can be pretty sure that everything is still fine. I sometimes run the
fuzzer up to 24h to make sure everything is still ok.
�N)�
namedtuple)�split_lines)�Parser)�	EndMarker)�PythonToken�BOM_UTF8_STRING)�PythonTokenTypesF)�INDENT�ERROR_DEDENT�DEDENTc�H�|jdk(xr|jtvS)N�
error_leaf)�type�
token_type�_INDENTATION_TOKENS��nodes �3/usr/lib/python3/dist-packages/parso/python/diff.py�_is_indentation_error_leafr3s ���9�9��$�O����<O�)O�O�c�\�|r)t|�r|j�}|rt|�r�|S�N)r�get_previous_leaf��leafs r�!_get_previous_leaf_if_indentationr7s-��
�-�d�3��%�%�'���-�d�3��Krc�\�|r)t|�r|j�}|rt|�r�|Sr)r�
get_next_leafrs r�_get_next_leaf_if_indentationr=s-��
�-�d�3��!�!�#���-�d�3��Krc�2�t|jd�S�N�)�_get_indentation�children��	tree_nodes r�_get_suite_indentationr'Cs���I�.�.�q�1�2�2rc� �|jdSr!)�	start_posr%s rr#r#Gs�����q�!�!rc�<�	|j}|D]%}|j|k(s	J||f��t|��'y#t$�rX|jdk(r0|j
tvr|jrJ�|jrJ�Yyt|j��}|�|j}d}nG|j|jks	J||f��|j|jz}|j}d|vsd|vr0t|�}|dt|�zdz
}|t|d�f}nK|d|dt|�zf}|jt �r |j#�dk(r
|d|ddz
f}|j|k(sJ|j|f��YywxYw)	z~
    Checks if the parent/children relationship is correct.

    This is a check that only runs during debugging/testing.
    rN)r"r�
�
rr"���)r$�parent�_assert_valid_graph�AttributeErrorrrr�value�prefixrr�end_posr)r�len�
startswithr�get_start_pos_of_prefix)	rr$�child�
previous_leaf�content�previous_start_pos�splitted�line�actuals	         rr/r/Ks���%'��=�=��D�	'�E��<�<�4�'�6�$���6�'���&�	'��C�B��9�9��$����<O�)O��z�z�!�>��{�{�"�?��:�$�:P�:P�:R�S�
�� ��k�k�G�!%�� �(�(�D�N�N�:�
&���%�
&�:�$�)�)�D�K�K�7�G�!.�!8�!8���7�?�d�g�o�"�7�+�H�%�a�(�3�x�=�8�1�<�D��3�x��|�,�,�F�'��*�,>�q�,A�C��L�,P�P�F��!�!�/�2��4�4�6�&�@����F�1�I��M�1���~�~��'�A�$�.�.�&�)A�A�'�?B�s�9�AF�DF�Fc�n�	|j}	|j}t||�D]\}}t||��t|�t|�k(s"Jdt|�zdzt|�z��y#t$r
J||f��wxYw#t$r�t|d�r	J||f��|j|jk(s	J||f��|j|jk(s	J||f��|j
|j
k(s	J||f��|j|jk(s	J||f��YywxYw)Nr$r+)r$r0�hasattrr1rr2r)�zip�_assert_nodes_are_equalr4�repr)�node1�node2�	children1�	children2�n1�n2s      rrArAys>��
)��N�N�	�	)����I��i��+�(���B���B�'�(��y�>�S��^�+�\�T�D��O�-C�d�-J�T�R[�_�-\�\�+��	�	)�(�5�%�.�(�5�	)�����5�*�-�=��u�~�=�-��{�{�e�k�k�)�9�E�5�>�9�)��z�z�U�Z�Z�'�7�%���7�'��|�|�u�|�|�+�;�e�U�^�;�+����%�/�/�1�A�E�5�>�A�1��
�s�B�A5�5B�B&D4�3D4c��t|j�d��}tj||�}tj||�}ddl}d|j
�ddj
|��ddj
|���S)NT��keependsrz=There's an issue with the diff parser. Please report (parso vz
) - Old/New:
�z
Actual Diff (May be empty):
)r�get_code�difflib�unified_diff�parso�__version__�join)�module�	old_lines�	new_lines�
current_lines�current_diff�old_new_diffrPs       r�_get_debug_error_messagerY�sh������ 1�D�A�M��'�'�	�=�A�L��'�'�	�9�=�L�����b�g�g�l�3�R�W�W�\�5J�	L�rc���|j�}t|�r|jdS|j�}|jdk(r d|j
vr|jddzS|jdS)Nr�	endmarkerr+r")�
get_last_leaf�_ends_with_newliner)rrr2r3)�node_or_leaf�	last_leaf�ns   r�_get_last_linera�sw���*�*�,�I��)�$��"�"�1�%�%��#�#�%���6�6�[� �T�Q�X�X�%5��$�$�Q�'�!�+�+�� � ��#�#rc��|�O|jdk(r@|jdk(r1|j�}|�|jdk(r|jdk(r�1|S)Nrr)rrrrs r�_skip_dedent_error_leavesrc�sQ��
�
�t�y�y�L�8�T�_�_�PX�=X��%�%�'���
�t�y�y�L�8�T�_�_�PX�=X��Krc���t|�}|jdk(r|jj�}n|j}|dk(xs$|j	d�xs|j	d�S)Nr�newliner+r,)rcrr�lower�endswith)r�suffix�typs   rr]r]�sZ��$�T�*�D��y�y�L� ��o�o�#�#�%���i�i���)��M�v���t�4�M�����8M�Mrc�2�|D]}|jdvs�yy)zg
    if, while, for and try might not be finished, because another part might
    still be parsed.
    )�if_stmt�
while_stmt�for_stmt�try_stmtFT)�nonterminal��pgen_grammar�stack�
stack_nodes   r�_flows_finishedrt�s*��
��
��!�!�%V�V���rc���|jdk(r|jd}|jdvr|jd}|jdvxr|jdjdk(S)N�	decoratedr-��
async_funcdef�
async_stmt��classdef�funcdef�suite)rr$rs r�_func_or_class_has_suiter~�s`���y�y�K���}�}�R� ���y�y�3�3��}�}�R� ���9�9�/�/�U�D�M�M�"�4E�4J�4J�g�4U�Urc��t||�syt|�D]<}|jdk(ry|jdk(s�$t|j�dkDcSy)NF�	decoratorr}r"T)rt�reversedror4�nodesrps   r�_suite_or_file_input_is_validr��s\���<��/���u�o�-�
��!�!�[�0���!�!�W�,��z�'�'�(�1�,�,�-�rc��|jdk(r|jd}	|jdj}|dvS#t$rYywxYw)Nryr"rF)�if�for�while�try�with)rr$r1r0)rr1s  r�
_is_flow_noder��sW���y�y�L� ��}�}�Q�����
�
�a� �&�&���9�9�9������s�=�	A	�A	c��eZdZy)�_PositionUpdatingFinishedN)�__name__�
__module__�__qualname__�rrr�r��s��rr�c��|D]}	|j}t|||��y#t$r"|xj|z
c_||urt�Y�JwxYwr)r$�_update_positionsr0r<r�)r��line_offsetr_rr$s     rr�r��sb���	@��	@��}�}�H�
�h��Y�?�	@���	0��I�I��$�I��y� �/�/�!�	0�s�#�(A�
Ac�H�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zdd
�Zy)
�
DiffParserz�
    An advanced form of parsing a file faster. Unfortunately comes with huge
    side effects. It changes the given module.
    c�.�||_||_||_yr)�
_pgen_grammar�
_tokenizer�_module)�selfrq�	tokenizerrSs    r�__init__zDiffParser.__init__�s��)���#�����rc�T�d|_d|_t|j�|_y�Nr)�_copy_count�
_parser_count�
_NodesTreer��_nodes_tree�r�s r�_resetzDiffParser._resets#��������%�d�l�l�3��rc	��tjd�d|j_||_|j�t
|�}tjd||j�}|j�}tjdt
|��d|���|D]�\}}}}	}
tjd||dz||	dz|
�|
|k(r
|ddk(r|
dz}
|d	k(r|	|z
}|j||dz||
��]|d
k(r|j|
���u|dk(r|j|
����|d
k(r��J�|jj�tr�	dj|�}|jj!�|k(sJ�t#|j�t%|j&d��j)|j+|��}
t-|j|
�|jj4d}||k7r*t7d|�d|�d�t3|j||�z��tjd�|jS#t.$r"t1t3|j||���wxYw)a�
        The algorithm works as follows:

        Equal:
            - Assure that the start is a newline, otherwise parse until we get
              one.
            - Copy from parsed_until_line + 1 to max(i2 + 1)
            - Make sure that the indentation is correct (e.g. add DEDENT)
            - Add old and change positions
        Insert:
            - Parse from parsed_until_line + 1 to min(j2 + 1), hopefully not
              much more.

        Returns the new module node.
        zdiff parser startNzline_lengths old: z; new: z!-> code[%s] old[%s:%s] new[%s:%s]r"r-rL�equal�replace)�
until_line�insert�deleteT��error_recoveryr�(z != z) zdiff parser end)�LOG�debugr��_used_names�_parser_lines_newr�r4rN�SequenceMatcher�get_opcodes�_copy_from_old_parser�_parser��close�DEBUG_DIFF_PARSERrRrMr/rr��parser�rA�AssertionError�printrYr3�	Exception)r�rTrU�line_length�sm�opcodes�	operation�i1�i2�j1�j2r��code�without_diff_parser_module�last_poss               r�updatezDiffParser.update
sK�� 	�	�	�%�&�#'���� �!*������
��)�n��
�
$�
$�T�9�d�6L�6L�
M���.�.�"���	�	�S��^�[�Q�R�)0�	-�%�I�r�2�r�2��I�I�9���a���R�!�V�R�
9��[� �Y�r�]�b�%8��a����G�#� �2�g���*�*�;��Q���B�G��i�'����r��*��h�&����r��*� �H�,�,�,�!	-�(	
����� ��
��w�w�y�)���|�|�,�,�.�$�6�6�6�#�D�L�L�1�-3��&�&�#'�.��%����	�2�3�+�(����6P�Q�
�<�<�'�'��*���{�"��"*�K�8�*�4�<�<��I�N�O��
�	�	�	�#�$��|�|���"�
��.�t�|�|�Y�	�R�S��
�s
�BI�+I;c���|jj�dj|�k7r6tj	ddj|�dj|��yy)NrLzparser issue:
%s
%s)r�rMrRr��warning)r�rT�	lines_news   r�_enabled_debuggingzDiffParser._enabled_debuggingVsH���<�<� � �"�b�g�g�i�&8�8��K�K�/�����1C�R�W�W�Y�EW�X�9rc���d}||jjkD�r�|jj|z
}|j|dz�}|�*|j|jjdz��n*|jj
}|j
|�}	|dk(r3|dj�jjt�rg}
n9|jjdz}|jj||	d||�}
|
rh|xjdz
c_|jj}tjd|
djd|
dj ddz
|�n(|j|jjdz�||jjk7sJ|��|jj}||jjkDr���yy)Nr-r"rzcopy old[%s:%s] new[%s:%s])r��parsed_until_line�_get_old_line_stmtr�r.r$�index�get_first_leafr2r5r�
copy_nodesr�r�r�r)r3)
r�r��start_line_old�until_line_old�until_line_new�last_until_line�parsed_until_line_old�	line_stmt�
p_childrenr��copied_nodes�from_�tos
             rr�z DiffParser._copy_from_old_parserZs������t�/�/�A�A�A�$(�$4�$4�$F�$F��$T�!��/�/�0E��0I�J�I�� ����D�,�,�>�>��B�C�&�-�-�6�6�
�"�(�(��3��!�Q�&�&�q�M�8�8�:�A�A�L�L�_�]�$&�L� �,�,�>�>��B�E�#'�#3�#3�#>�#>�"�5�6�*�&�#�$�L� ��$�$��)�$��)�)�;�;�B��I�I�:�*�1�o�7�7��:�*�2�.�6�6�q�9�A�=�u�b�J��K�K�� 0� 0� B� B�Q� F�G�#�d�&6�&6�&H�&H�H�Y�/�Y�H�"�.�.�@�@�O�Q�t�/�/�A�A�Arc�J�|jj|dfd��}t|�r|j�}|j	�d|k(rS|}|j
jdvr%|j
}|j
jdvr�%|jd|k\r|Sy)NrT)�include_prefixes)�
file_inputr})r��get_leaf_for_positionr]rr6r.rr))r��old_linerrs    rr�zDiffParser._get_old_line_stmt�s����|�|�1�1�8�Q�-�RV�1�W���d�#��%�%�'�D��'�'�)�!�,��8��D��+�+�"�"�*A�A��{�{���+�+�"�"�*A�A�
�~�~�a� �H�,���rc�d�d}||jjkD�r|j|�}|j}|jj	||j
�|j�#|j|jjd<tjd|dj�d|jj|jddz
�||jjk7sJ|��|jj}||jjkDr��yy)zy
        Parses at least until the given line, but might just parse more until a
        valid state is reached.
        rNr-z/parse_part from %s to %s (to %s in part parser)r")r�r��_try_parse_partr$�add_parsed_nodes�_keyword_token_indents�_replace_tos_indent�indentsr�r�r6r3)r�r�r�rr�s     rr�zDiffParser._parse�s��
���4�+�+�=�=�=��'�'�
�3�D��M�M�E����-�-�e�T�5P�5P�Q��'�'�3�/3�/G�/G�� � �(�(��,��I�I�A��a��0�0�2�1�5�� � �2�2����Q��!�#�	
�#�d�&6�&6�&H�&H�H�Y�/�Y�H�"�.�.�@�@�O�%�4�+�+�=�=�=rc��|xjdz
c_|jj}|j|d}|j	|||��}t|jd��|_|jj|��S)z�
        Sets up a normal parser that uses a spezialized tokenizer to only parse
        until a certain position (or a bit longer if the statement hasn't
        ended.
        r"N)r�Tr�)�tokens)	r�r�r�r��_diff_tokenizerr��_active_parserr�)r�r�r��lines_afterr�s     rr�zDiffParser._try_parse_part�s���	
���a���!�,�,�>�>���,�,�->�-?�@���$�$���)�%�
��
%�����
����"�"�(�(��(�7�7rc#��K�d}|jj}t|�}|j||dzdf||dk(��}|jj
}d|_i|_|D�]q}	|	j}
|
tk(r�t|�|k�r
	t|�x\}
}}}
}	|
ttfvr|
tk(r|ddz|_nn�9d|
vsd|
vrtjdd	|
�}
n7|dt|
�k\sJt|
���|dt|
�z
dk(rd	}
tt d	||
���y|
t"k(r|	j$d|k\rd}nH|rFd}t|�|k(r6t'|j(|�r tt d	|	j$d	���y|
t*k(r0|	j,d
vr"t/|�|j|	j$<|	����ty�w)NFr"r)r)r��is_first_tokenTr+r,z
[^\n\r]+\ZrL)�class�def)r�r�r4r�r�rrr�r�rr�nextr�re�subrBr�	ENDMARKER�NEWLINEr)r�r��NAME�string�list)r��linesr�r��was_newliner��initial_indentation_countr�rr�tokenrir�r)r2s              rr�zDiffParser._diff_tokenize�s��������"�"�*�*��$'��L�!�����"�Q���*��&�!�+�	!�
���#�#�)�)��#'�� �&(��#��,	�E��*�*�C��f�}��w�<�";�;��AE�f��M�6��V�Y����6�<�"8�8�"�l�2�<E�Q�<�!�;K�� 8� $�!���v�~����!#���
�r�6�!B��(��|�s�6�{�:�H�D��L�H�:�$�Q�<�#�f�+�5��:�%'�F�%�!�2�!����
����E�O�O�A�$6�*�$D�"���#���w�<�#<�<�4�T�5G�5G��O�)�)�R����"�M�M���d�{�u�|�|�/?�?�?C�G�}��+�+�E�O�O�<��K�Y,	�s�GGN)r)
r�r�r��__doc__r�r�r�r�r�r�r�r�r�r�rrr�r��s:����
4�J�XY�*A�X�"A�48�,;rr�c�J�eZdZedd�Zd
d�Zd�Zd�Z		dd�Zd�Z	d	�Z
y)�_NodesTreeNode�_ChildrenGroupz1prefix children line_offset last_line_offset_leafNc�J�||_g|_||_g|_||_yr)r&�_children_groupsr.�_node_children�indentation)r�r&r.rs    rr�z_NodesTreeNode.__init__
s(��"��� "������ ���&��rc�v�g}|jD]O\}}}}t|dj��}||jz|_|dk7r	t	|||�||z
}�Q||j_|D]}|j|_�|jD]}|j��y#t
$rY�]wxYwr�)rrr�r2r�r�r&r$r.r�finish)	r�r$r2�
children_partr��last_line_offset_leaf�
first_leafr�
node_childs	         rrz_NodesTreeNode.finishs�����IM�I^�I^�	&�E�F�M�;�0E�6��a� �/�/�1��J�!'��):�):� :�J���a���%�%�{�4I�K�
�
�%�H�	&�#+������	)�D��.�.�D�K�	)��-�-�	 �J�����	 ��1����s�

B,�,	B8�7B8c�:�|jj|�yr)r�append)r��
child_nodes  r�add_child_nodez_NodesTreeNode.add_child_node(s�����"�"�:�.rc��|�|dj�}|j||||�}|jj|�y�Nr-)r\r�rr)r�r2r$r�r�groups      r�add_tree_nodesz_NodesTreeNode.add_tree_nodes+sK�� �(�$,�R�L�$>�$>�$@�!��#�#��H�k�+@�
��	
���$�$�U�+rc��d}|jrQ|jd}t|j�}|jd|jz}t||�r|dz}|t
t|��dz
z
}|r'|jd�s|jd�s|dz
}|jr(t||jdj|��S|S)Nrr-r"r+r,)rrrr3r�r]r4rrgr�max�
get_last_line)r�rhr<�children_groupr_s     rrz_NodesTreeNode.get_last_line4s������ � �!�2�2�2�6�N�9��4�4��I��$�$�Q�'�.�*D�*D�D�D�"�)�V�4���	����K��'�(�1�,�,���&�/�/�$�/�����8M��A�I�D�����t�T�0�0��4�B�B�6�J�K�K��rc�P�d|jj�d|j�d�S)N�<z: �>)�	__class__r�r&r�s r�__repr__z_NodesTreeNode.__repr__Ls��!�^�^�4�4�d�n�n�E�Err�)rN)r�r�r�rr�r�rr
rrrr�rrr�r�s9����;�=�N�'� �./�<=�-1�,��0Frr�c�V�eZdZd�Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�Z	dd	�Zd
�Z
y)
r�c��t|�|_|jg|_||_d|_d|_dg|_y)NrLr)r��
_base_node�_working_stackr��_prefix_remainderr2r�)r�rSs  rr�z_NodesTree.__init__Qs<��(��0���#���/������!#�������s��rc�R�|jdj|j�Sr)rrr2r�s rr�z_NodesTree.parsed_until_lineYs"���"�"�2�&�4�4�T�[�[�A�Arc���tt|j��D]@}|j|ks||jdur|cS|jj	��Byr�)r�r�rr�pop)r�rrs   r�_update_insertion_nodez!_NodesTree._update_insertion_node]sX���T�$�"5�"5�6�7�	&�D����+�-���9L�9L�Q�9O�1O������#�#�%�	&rc�X�|j}|j|�}|s||jz|_y|djdk7sJ�|j|djd�}|j
jdvsJ�|j
||�|j|d|�y)Nrrer")r}r�r-)r2�_remove_endmarkerrr#r)r&r�_update_parsed_node_tos)r��
tree_nodes�keyword_token_indents�
old_prefixrs     rr�z_NodesTree.add_parsed_nodescs����[�[�
��+�+�J�7�
��$�t�{�{�2�D�K���!�}�!�!�Y�.�.�.��*�*�:�a�=�+B�+B�1�+E�F���~�~�"�"�&=�=�=�=����J�
�3��$�$�Z��^�5J�Krc���|jdk(r�|jjd}t|||jd��}|jdt
|j��|jdj|�|jj|�|j|jd|�yt|�r |j|jd|�yy)Nr}rr-�rrL)rr.r$r�r)rr�rr
rr&r~)r�r&r(�def_leaf�new_toss     rr&z"_NodesTree._update_parsed_node_tosrs����>�>�W�$� �'�'�0�0��3�H�$��1�(�2D�2D�E�b�I��G�
�"�"�2�t�I�,>�,>�'?�@�����#�2�2�7�;����&�&�w�/��(�(��);�);�B�)?�AV�W�
%�i�
0��(�(��);�);�B�)?�AV�W�1rc�n�|dj�}|jdk(}d|_|rj|j}t	|jd�|jd��}|dkDr/|jd|dz|j|dzdc|_|_d|_|r|j|_|dd}|S)zE
        Helps cleaning up the tree nodes that get inserted.
        r-r[rLr+r,Nr")r\rrr2r�rfind)r�r'r_�is_endmarkerr2�
separations      rr%z_NodesTree._remove_endmarker�s����r�N�0�0�2�	� �~�~��4��!#�����%�%�F��V�\�\�$�/����d�1C�D�J��B��
�$�$�_�j�1�n�5�y�7G�7G�
�UV���7X�9�	� �$�"8�����#�*�*�D�K�#�C�R��J��rc#��K�t|�}|r
t|���t|�}t|�}|s||jvry|��|D]}t|�|k7ry|���y�wr)�iterr�r#r�)r�r'�is_new_suite�
node_iterator�
first_node�indentr`s       r�_get_matching_indent_nodesz%_NodesTree._get_matching_indent_nodes�so����
�Z�(�
���}�%�%��-�(�
�!�*�-����d�l�l� :�����	�A���"�f�,���G�	�s�A"A$c��|djdvrgSt|d�}t|j�}|j}|j
}|j
D�cgc]
}||ks�	|��c}|_|j
|�|jt|j�||||j�\}	|_|_}
|	r|xj
|
z
c_|	S||_||_||_|	Scc}w)zy
        Copies tree nodes from the old parser tree.

        Returns the number of tree nodes that were copied.
        r�r�
error_node)rr#r�rr2r�r#�_copy_nodes)r�r'r�r�r�old_working_stackr)�old_indents�i�	new_nodes�
added_indentss           rr�z_NodesTree.copy_nodes�s����a�=���!=�=��I�&�z�!�}�5�� ��!4�!4�5���[�[�
��l�l��#'�<�<�D�a�1��3C��D����#�#�K�0�EI�EU�EU���$�$�%�����K�K�F
�B�	�4�&���]���L�L�M�)�L�
��#4�D��$�D�K�&�D�L����#Es�
C6�(C6c�\�g}g}t|j||���}d}	|D�]}
|
jd|kDrn�|
jdk(rn�|
jdk(r|
jdvrn�t|
�|kDrt
|
�r|j|
�n�	|
j}|
}|jdk(r|jd}|jd	vr|jd}|jd
vr|jd}
n|d}
|
jdvrn|j|
���|r�|r�|d}|jdvst|d�rKd}	|j�|r6|d}|j�jdk(rn|j�|r�6�nt|�d
kDr#|djdk(r|j���	|sg|||fS|d}|d}d}t
|�r�|}|jdk7r|jd}|jdk7r�t|�}|j|�t|t!|���}|j#||gz|j||d��\}}}	}||z
}t|�dkr|j�d}	n|sJ�|j%|�|}d}|r�t'|dj��s/|s-|dj)�j*}t-|d��d}	|rd|d}|jdk(r|jd}|jd	vr|jd}|jdj�}|dk(sJ�|dj�}|j/||||�|	}d|_||||fS#t$rY���wxYw)N)r4rLrr[r)rrrvr-rwrzr:rer"���r;Fr}r+T)�	is_nested�rJ�:)r�r8r)rrrar~rr$r0r�r"r\r4r'r�r#r<r
r]rr2rrr)r��
working_stackr�r�r�r2rDr@rA�
new_prefixr�cr`�
suite_node�	last_node�tos�had_valid_suite_lastr}r7�	suite_tos�suite_nodes�new_working_stack�ai�p�lastrs                          rr<z_NodesTree._copy_nodes�s����	��
��T�4�4��"�5�
���
�
��'	#�D��~�~�a� �:�-���y�y�K�'���y�y�L�(�T�_�_�@Z�-Z���d�#�j�0�+�D�1��$�$�T�*��
��M�M�����6�6�[�(��
�
�2��A��6�6�<�<��
�
�2��A��6�6�4�4�!"���B��J�!"�2��J��?�?�&B�B�����T�"�O'	#�T��%�b�M�	��N�N�&B�B�(��2��7�"$�J��M�M�O�#�$-�b�M�	�$�2�2�4�9�9�Y�F�!�!�
�
��	$�
��y�>�A�%�)�B�-�*<�*<��*L�
�M�M�O�����}�f�m�;�;��B����b�M�	�$��#�I�.��E��*�*��'����r�*���*�*��'�,�E�2�F�� � ��(�&�u�:J�9�:U�V�I�>B�=M�=M����+�U�^�^�Z���>N�>�:�K�*�J��
�R��M��;��!�#��
�
���
� � �y��"�"�9�-� 1�
�'+�$��%�i��m�&A�&A�&C�D�Ma��b�M�/�/�1�8�8��
)��T�:�1�=�
�#� ��}���9�9��+��=�=��,�D��9�9� ?�?��=�=��,�D�(,�
�
�b�(9�(G�(G�(I�%�,��3�3�3�(1�"�
�(C�(C�(E�%�����	�;�0E�
� �F�%'�D�"��-���>�>��]"�
��
�s�N�	N+�*N+c���|jj�	|jj�}t	|�}t|j�}t|j�}t|�dkDsJ�t|�dk(rF|djt�r|ddgk(r
|dxxdzcc<|dxxt|d�z
cc<n*|dxxt|�dz
z
cc<t|d�|d<tdt|�|j|jz�}|j|_|jj"j%|�y#t$rddg}Y��wxYw)Nr"rr-rL)rrr�r\rcr�r3�
IndexErrorrr2r4r5rr�tuplerr.r$r)r�r_r3r�r[s     rr�z_NodesTree.close_s4������� �	.����2�2�4�I�2�)�<�I��9�,�,�-�G��D�K�K�(���5�z�A�~��~��u�:��?��Q�x�"�"�?�3��A�q�6�8I���
�a��
��A�J�#�e�A�h�-�'�J��A�J�#�e�*�q�.�(�J��U�2�Y��G�A�J��b�%��.�$�+�+��@V�@V�2V�W�	��<�<�	�������$�$�Y�/��#�	��!�f�G�	�s�E�
E.�-E.N)rLF)r�r�r�r��propertyr�r#r�r&r%r8r�r<r�r�rrr�r�PsO����B��B�&�
L�X� �2�( �F*/�L?�\0rr�)rL)0r�r�rN�collectionsr�logging�parso.utilsr�parso.python.parserr�parso.python.treer�parso.python.tokenizerr�parso.python.tokenr	�	getLoggerr�r�r�rr�rr�rr�rrrr'r#r/rArYrarcr]rtr~r�r�r�r�r�r�r�r�r�rr�<module>r`s���6
��"��#�&�'�>�/��g����!����8��
�
"�
"��	�	 �	 �������,�,���&�&�	�P���3�"�+'�\]�(	�$�"�N��V��":�	�	�	�
@�H�H�VHF�HF�Vf0�f0r

Youez - 2016 - github.com/yon3zu
LinuXploit