403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/parso/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/parso/__pycache__/tree.cpython-311.pyc
�

̑�a?���ddlmZmZddlmZmZmZmZddlm	Z	ddde
ddfd	�ZGd
�d��ZGd�de��Z
Gd
�de
��ZGd�de��ZGd�de��ZGd�de��ZGd�de
��ZdS)�)�abstractmethod�abstractproperty)�List�Optional�Tuple�Union)�split_lines�node�
NodeOrLeaf�
node_types�return�Optional[BaseNode]c�@�|j}|�|j|vr|S|j}|�dS)an
    Recursively looks at the parents of a node and returns the first found node
    that matches ``node_types``. Returns ``None`` if no matching node is found.

    This function is deprecated, use :meth:`NodeOrLeaf.search_ancestor` instead.

    :param node: The ancestors of this node will be checked.
    :param node_types: type names that are searched for.
    N��parent�type)r
r�ns   �,/usr/lib/python3/dist-packages/parso/tree.py�search_ancestorrs7��	
��A�
�-��6�Z����H�
�H���-��4�c�B�eZdZUdZdZeed<	ded<	d�Zd�Zd�Z	d	�Z
d
�Zede
eeffd���Zede
eeffd
���Zed���Zed���Zed���Zedd���Zdeddfd�Zdd�deeeefdefd�ZdS)rz.
    The base class for nodes and leaves.
    �rrrrc�4�|}|j�|j}|j�|S)z�
        Returns the root node of a parser tree. The returned node doesn't have
        a parent node like all the other nodes/leaves.
        r)�self�scopes  r�
get_root_nodezNodeOrLeaf.get_root_node(s'��
���l�&��L�E��l�&��rc��|j}|�dSt|j��D]3\}}||ur*	|jj|dzcS#t$rYdSwxYw�4dS)z�
        Returns the node immediately following this node in this parent's
        children list. If this node does not have a next sibling, it is None
        N�)r�	enumerate�children�
IndexError�rr�i�childs    r�get_next_siblingzNodeOrLeaf.get_next_sibling2s���
����>��4�"�&�/�2�2�	 �	 �H�A�u���}�}� ��;�/��A��6�6�6�6��!� � � ��4�4�4� �����	 �	 s�A�
A�Ac��|j}|�dSt|j��D])\}}||ur |dkrdS|jj|dz
cS�*dS)z�
        Returns the node immediately preceding this node in this parent's
        children list. If this node does not have a previous sibling, it is
        None.
        Nrr)rrr r"s    r�get_previous_siblingzNodeOrLeaf.get_previous_siblingCsv������>��4�"�&�/�2�2�	3�	3�H�A�u���}�}���6�6��4�4��{�+�A��E�2�2�2�2��	3�	3rc���|j�dS|}	|jj}|�|��}|dkr|j}|j�dSn||dz
}n�E		|jd}n#t$r|cYSwxYw�")z�
        Returns the previous leaf in the parser tree.
        Returns `None` if this is the first element in the parser tree.
        NTrr���)rr �index�AttributeError�rr
�cr#s    r�get_previous_leafzNodeOrLeaf.get_previous_leafTs���
�;���4���		���$�A�����
�
�A��A�v�v��{���;�&��4�'���Q��x���		�	�
��}�R�(����!�
�
�
�����
����	s�
A"�"A1�0A1c�
�|j�dS|}	|jj}|�|��}|t|��dz
kr|j}|j�dSn||dz}n�U		|jd}n#t$r|cYSwxYw�")z�
        Returns the next leaf in the parser tree.
        Returns None if this is the last element in the parser tree.
        NTrr)rr r*�lenr+r,s    r�
get_next_leafzNodeOrLeaf.get_next_leafns���
�;���4���		���$�A�����
�
�A��C��F�F�Q�J����{���;�&��4�'���Q��x���		�	�
��}�Q�'����!�
�
�
�����
����	s�$
A2�2B�Br
c��dS)z�
        Returns the starting position of the prefix as a tuple, e.g. `(3, 4)`.

        :return tuple of int: (line, column)
        N��rs r�	start_poszNodeOrLeaf.start_pos�����rc��dS)z�
        Returns the end position of the prefix as a tuple, e.g. `(3, 4)`.

        :return tuple of int: (line, column)
        Nr3r4s r�end_poszNodeOrLeaf.end_pos�r6rc��dS)a-
        Returns the start_pos of the prefix. This means basically it returns
        the end_pos of the last prefix. The `get_start_pos_of_prefix()` of the
        prefix `+` in `2 + 1` would be `(1, 1)`, while the start_pos is
        `(1, 2)`.

        :return tuple of int: (line, column)
        Nr3r4s r�get_start_pos_of_prefixz"NodeOrLeaf.get_start_pos_of_prefix�r6rc��dS)zO
        Returns the first leaf of a node or itself if this is a leaf.
        Nr3r4s r�get_first_leafzNodeOrLeaf.get_first_leaf�r6rc��dS)zN
        Returns the last leaf of a node or itself if this is a leaf.
        Nr3r4s r�
get_last_leafzNodeOrLeaf.get_last_leaf�r6rTc��dS)z�
        Returns the code that was the input for the parser for this node.

        :param include_prefix: Removes the prefix (whitespace and comments) of
            e.g. a statement.
        Nr3�r�include_prefixs  r�get_codezNodeOrLeaf.get_code�r6rrc�@�|j}|�|j|vr|S|j}|�dS)a
        Recursively looks at the parents of this node or leaf and returns the
        first found node that matches ``node_types``. Returns ``None`` if no
        matching node is found.

        :param node_types: type names that are searched for.
        Nr)rrr
s   rrzNodeOrLeaf.search_ancestor�s9���{�����y�J�&�&����;�D����tr�)�indentrEc	�����|�d�d�nIt|t��rd�d|z�n,t|t��rd�|�ntd|�����ddtdtd	t
d
tf���fd�
��|��S)
a
        Returns a formatted dump of the parser tree rooted at this node or leaf. This is
        mainly useful for debugging purposes.

        The ``indent`` parameter is interpreted in a similar way as :py:func:`ast.dump`.
        If ``indent`` is a non-negative integer or string, then the tree will be
        pretty-printed with that indent level. An indent level of 0, negative, or ``""``
        will only insert newlines. ``None`` selects the single line representation.
        Using a positive integer indent indents that many spaces per level. If
        ``indent`` is a string (such as ``"\t"``), that string is used to indent each
        level.

        :param indent: Indentation style as described above. The default indentation is
            4 spaces, which yields a pretty-printed dump.

        >>> import parso
        >>> print(parso.parse("lambda x, y: x + y").dump())
        Module([
            Lambda([
                Keyword('lambda', (1, 0)),
                Param([
                    Name('x', (1, 7), prefix=' '),
                    Operator(',', (1, 8)),
                ]),
                Param([
                    Name('y', (1, 10), prefix=' '),
                ]),
                Operator(':', (1, 11)),
                PythonNode('arith_expr', [
                    Name('x', (1, 13), prefix=' '),
                    Operator('+', (1, 15), prefix=' '),
                    Name('y', (1, 17), prefix=' '),
                ]),
            ]),
            EndMarker('', (1, 18)),
        ])
        NF�T� z,expect 'indent' to be int, str or None, got r
rE�	top_levelr
c���d}t|��j}t|t��r}||�|�d�z
}t|t��r||j�d�z
}n"t|t��r
||j�d�z
}||j�d|j��z
}|j	r
|d|j	��z
}|dz
}n�t|t��r_||�|�d�z
}t|t��r
||j�d�z
}|dz
}�r|dz
}|jD]}|�||�zd�	��z
}�||�d
�z
}ntd|�����|s
�r|dz
}n|dz
}|S)
NrG�(�, z	, prefix=�)�[�
F)rErIz])zunsupported node encountered: z,
)r�__name__�
isinstance�Leaf�	ErrorLeaf�
token_type�	TypedLeaf�valuer5�prefix�BaseNode�Noder �	TypeError)	r
rErI�result�	node_typer$�_format_dump�
indent_string�newlines	      ���rr]z%NodeOrLeaf.dump.<locals>._format_dump�s�����F��T�
�
�+�I��$��%�%�
K��V�1�Y�1�1�1�1���d�I�.�.�1����6�6�6�6�F�F���i�0�0�1����0�0�0�0�F��T�Z�?�?�T�^�?�?�?���;�:��9�$�+�9�9�9�F��#�
����D�(�+�+�
K��V�1�Y�1�1�1�1���d�D�)�)�1����0�0�0�0�F��#�
���#��d�N�F�!�]�b�b�E��l�l�5��-�9O�[`�a�a�a�a�F�F��V�-�-�-�'��� � I�� I� I�J�J�J��
#��#��e�O�F�F��d�N�F��Mr)rGT)rQ�int�strrZr�bool)rrEr]r^r_s  @@@r�dumpzNodeOrLeaf.dump�s������L�>��G��M�M�
���
$�
$�	W��G��&�L�M�M�
���
$�
$�	W��G�"�M�M��U�6�U�U�V�V�V�"	�"	�z�"	�3�"	��"	�X[�"	�"	�"	�"	�"	�"	�"	�"	�H�|�D�!�!�!rN�T)rP�
__module__�__qualname__�__doc__�	__slots__ra�__annotations__rr%r'r.r1rrr`r5r8rr:r<r>rBrrrrcr3rrrrs�����������I�

�I�I�I��
!� � � ��
��� � � �"3�3�3�"���4���4��5��c��?����������s�C�x������������^������^��
����^��
�����^��
�3�
�3G�
�
�
�
�;<�V"�V"�V"�h�u�S�#�X��7�V"��V"�V"�V"�V"�V"�V"rc	��eZdZUdZdZeed<ddedeeefdeddfd	�Z	e
deeeffd
���Zejdeeefddfd���Zd�Z
d
�Zd�Zdd�Ze
deeeffd���Zd�ZdS)rRz�
    Leafs are basically tokens with a better API. Leafs exactly know where they
    were defined and what text preceeds them.
    )rV�line�columnrWrWrGrVr5r
Nc�B�||_	||_||_	d|_dS�N)rVr5rWr)rrVr5rWs    r�__init__z
Leaf.__init__(s6����
�	�#������	�+/���	�	rc��|j|jfSrn�rkrlr4s rr5zLeaf.start_pos8s���y�$�+�%�%rc�:�|d|_|d|_dS)Nrrrq�rrVs  rr5zLeaf.start_pos<s���!�H��	��A�h����rc��|���}|�0t|j��}|jt	|��z
dzdfS|jS)Nrr)r.r	rWrkr0r8)r�
previous_leaf�liness   rr:zLeaf.get_start_pos_of_prefixAsN���.�.�0�0�
�� ����,�,�E��9�s�5�z�z�)�A�-�q�0�0��$�$rc��|Srnr3r4s rr<zLeaf.get_first_leafI����rc��|Srnr3r4s rr>zLeaf.get_last_leafLrxrTc�2�|r|j|jzS|jSrn)rWrVr@s  rrBz
Leaf.get_codeOs!���	��;���+�+��:�rc���t|j��}|jt|��zdz
}|j|kr|jt|d��z}nt|d��}||fS)Nrr))r	rVrkr0rl)rrv�end_pos_line�end_pos_columns    rr8zLeaf.end_posUsg���D�J�'�'���y�3�u�:�:�-��1���9��$�$�!�[�3�u�R�y�>�>�9�N�N� ��r��^�^�N��^�+�+rc�X�|j}|s|j}dt|��j�d|�d�S)N�<�: �>)rVrrPrss  r�__repr__z
Leaf.__repr__`s7���
���	��I�E��!�$�Z�Z�0�0�0�%�%�%�8�8r�rGrd)rPrerfrgrhrarirr`ro�propertyr5�setterr:r<r>rBr8r�r3rrrRrR sV���������6�I��K�K�K���c��e�C��H�o��s��TX����� �&�5��c��?�&�&�&��X�&����u�S�#�X���4�������%�%�%������������,��s�C�x��,�,�,��X�,�9�9�9�9�9rrRc�$��eZdZdZd�fd�	Z�xZS)rU�rrGc�\��t���|||��||_dSrn��superror)rrrVr5rW�	__class__s     �rrozTypedLeaf.__init__js*���
������	�6�2�2�2���	�	�	rr�)rPrerfrhro�
__classcell__�r�s@rrUrUgsB��������I����������rrUc��eZdZdZdZdeeddfd�Zede	e
e
ffd���Zd�Zede	e
e
ffd	���Z
d
�Zdd�Zdd�Zd�Zd�Zd�ZdS)rXzd
    The super class for all nodes.
    A node has children, a type and possibly a parent node.
    )r r r
Nc�>�||_	d|_	|D]	}||_�
dSrn)r r)rr r$s   rrozBaseNode.__init__vs@�� ��
�	�+/���	��	 �	 �E��E�L�L�	 �	 rc�&�|jdjS�Nr)r r5r4s rr5zBaseNode.start_pos�s���}�Q��)�)rc�@�|jd���Sr�)r r:r4s rr:z BaseNode.get_start_pos_of_prefix�s���}�Q��7�7�9�9�9rc�&�|jdjS�Nr))r r8r4s rr8zBaseNode.end_pos�s���}�R� �(�(rc���|rd�d�|D����S|d�d���}|d�d�|dd�D����zS)NrGc3�>K�|]}|���V��dSrn�rB��.0r-s  r�	<genexpr>z2BaseNode._get_code_for_children.<locals>.<genexpr>�s*����:�:�A�1�:�:�<�<�:�:�:�:�:�:rrF)rAc3�>K�|]}|���V��dSrnr�r�s  rr�z2BaseNode._get_code_for_children.<locals>.<genexpr>�s*����"F�"F�A�1�:�:�<�<�"F�"F�"F�"F�"F�"Frr)�joinrB)rr rA�firsts    r�_get_code_for_childrenzBaseNode._get_code_for_children�st���	G��7�7�:�:��:�:�:�:�:�:��Q�K�(�(��(�>�>�E��2�7�7�"F�"F��!�"�"��"F�"F�"F�F�F�F�FrTc�8�|�|j|��Srn)r�r r@s  rrBzBaseNode.get_code�s���*�*�4�=�.�I�I�IrFc����������fd��d�cxkr�jdjksntd����dt�j��dz
��S)ax
        Get the :py:class:`parso.tree.Leaf` at ``position``

        :param tuple position: A position tuple, row, column. Rows start from 1
        :param bool include_prefixes: If ``False``, ``None`` will be returned if ``position`` falls
            on whitespace or comments before a leaf
        :return: :py:class:`parso.tree.Leaf` at ``position``, or ``None``
        c�*��||krE�j|}�s
�|jkrdS	|�����S#t$r|cYSwxYwt	||zdz��}�j|}�|jkr�||��S�|dz|��S)N�r)r r5�get_leaf_for_positionr+r`r8)�lower�upper�elementr*�
binary_search�include_prefixes�positionrs    ����rr�z5BaseNode.get_leaf_for_position.<locals>.binary_search�s������~�~��-��.��'� �H�w�7H�,H�,H��4�#�"�8�8��CS�T�T�T��%�#�#�#�"�N�N�N�#��������!�+�,�,�E��m�E�*�G��7�?�*�*�$�}�U�E�2�2�2�$�}�U�Q�Y��6�6�6s�;�A
�	A
)rrr)z7Please provide a position that exists within this node.rr)r r8�
ValueErrorr0)rr�r�r�s```@rr�zBaseNode.get_leaf_for_position�s�������	7�	7�	7�	7�	7�	7�	7�	7�&�(�?�?�?�?�d�m�B�&7�&?�?�?�?�?��V�W�W�W��}�Q��D�M� 2� 2�Q� 6�7�7�7rc�@�|jd���Sr�)r r<r4s rr<zBaseNode.get_first_leaf�s���}�Q��.�.�0�0�0rc�@�|jd���Sr�)r r>r4s rr>zBaseNode.get_last_leaf�s���}�R� �.�.�0�0�0rc	��|����dd���dd�����}dt|��j�d|�d|jd�d|jd	�d
�	S)NrOrH�
rr��@r�,rr�)rB�replace�striprrPr5)r�codes  rr�zBaseNode.__repr__�s���}�}���&�&�t�S�1�1�9�9�$��D�D�J�J�L�L���
�$�Z�Z�
 �
 �
 �$�$�$���q�(9�(9�(9�4�>�!�;L�;L�;L�N�	Nrrd)F)rPrerfrgrhrrror�rr`r5r:r8r�rBr�r<r>r�r3rrrXrXos*���������I� ��j�!1� �d� � � � ��*�5��c��?�*�*�*��X�*�:�:�:��)��s�C�x��)�)�)��X�)�G�G�G�J�J�J�J�8�8�8�8�@1�1�1�1�1�1�N�N�N�N�NrrXc�,��eZdZdZdZ�fd�Zd�Z�xZS)rYz+Concrete implementation for interior nodes.r�c�X��t���|��||_dSrnr�)rrr r�s   �rroz
Node.__init__�s&���
������"�"�"���	�	�	rc�@�|jj�d|j�d|j�d�S)NrKrLrM)r�rPrr r4s rr�z
Node.__repr__�s&��#�~�6�6�6��	�	�	�4�=�=�=�Q�Qr)rPrerfrgrhror�r�r�s@rrYrY�sY�������5�5��I������R�R�R�R�R�R�RrrYc��eZdZdZdZdZdS)�	ErrorNodez�
    A node that contains valid nodes/leaves that we're follow by a token that
    was invalid. This basically means that the leaf after this node is where
    Python would mark a syntax error.
    r3�
error_nodeN)rPrerfrgrhrr3rrr�r��s$��������
�I��D�D�Drr�c�2��eZdZdZdZdZd�fd�	Zd�Z�xZS)rSz�
    A leaf that is either completely invalid in a language (like `$` in Python)
    or is invalid at that position. Like the star in `1 +* 1`.
    )rT�
error_leafrGc�\��t���|||��||_dSrn)r�rorT)rrTrVr5rWr�s     �rrozErrorLeaf.__init__�s*���
������	�6�2�2�2�$����rc	�|�dt|��j�d|j�dt|j���d|j�d�	S)Nrr��:rLr�)rrPrT�reprrVr5r4s rr�zErrorLeaf.__repr__�sD���
�$�Z�Z�
 �
 �
 �$�/�/�/�4��
�3C�3C�3C�3C�T�^�^�^�U�	Urr�)	rPrerfrgrhrror�r�r�s@rrSrS�si��������� �I��D�%�%�%�%�%�%�U�U�U�U�U�U�UrrSN)�abcrr�typingrrrr�parso.utilsr	rarrrRrUrXrYr�rSr3rr�<module>r�s���0�0�0�0�0�0�0�0�/�/�/�/�/�/�/�/�/�/�/�/�#�#�#�#�#�#��,��S��=Q�����$D"�D"�D"�D"�D"�D"�D"�D"�ND9�D9�D9�D9�D9�:�D9�D9�D9�N���������RN�RN�RN�RN�RN�z�RN�RN�RN�j	R�	R�	R�	R�	R�8�	R�	R�	R����������U�U�U�U�U��U�U�U�U�Ur

Youez - 2016 - github.com/yon3zu
LinuXploit