403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
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 :  /lib/python3/dist-packages/parso/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

̑�a�(���UddlZddlZddlmZmZmZmZmZmZddl	m
Z
ddlmZddl
mZddlmZmZmZmZddlmZddlmZmZdd	lmZdd
lmZmZmZddlm Z ddl!m"Z#dd
l$m%Z%ddl&m'Z'ddl(m)Z)m*Z*ddl+m,Z,m-Z-ia.ee/dfe0d<ed��Z1Gd�dee1��Z2Gd�de2��Z3ddd�de/de/fd�Z4dS)�N)�Generic�TypeVar�Union�Dict�Optional�Any)�Path)�is_pypy)�generate_grammar)�split_lines�python_bytes_to_unicode�PythonVersionInfo�parse_version_string)�
DiffParser)�tokenize_lines�tokenize)�PythonTokenTypes)�parser_cache�load_module�try_to_save_module)�
BaseParser)�Parser)�ErrorFinderConfig)�pep8)�FileIO�KnownContentFileIO)�RefactoringNormalizer�NormalizerConfig�Grammar�_loaded_grammars�_NodeTc�*�eZdZUdZeed<dZeeed<dZ	e
ed<ej��Z
eed<edd�defd	�Z	dd
ddddddd�d
eeefdeejefdedeejefdedefd�Zd�Zd�Zd�Zd�Zdd�Zdd�Zd�ZdS)rz�
    :py:func:`parso.load_grammar` returns instances of this class.

    Creating custom none-python grammars by calling this is not supported, yet.

    :param text: A BNF representation of your grammar.
    �_start_nonterminalN�_error_normalizer_config�_token_namespace�_default_normalizer_config)�parser�diff_parser�textc��t||������|_||_||_||_t
j|�d�����	��|_
dS)N)�token_namespacezutf-8)r�_get_token_namespace�
_pgen_grammar�_parser�
_tokenizer�_diff_parser�hashlib�sha256�encode�	hexdigest�_hashed)�selfr)�	tokenizerr'r(s     �//usr/lib/python3/dist-packages/parso/grammar.py�__init__zGrammar.__init__'sp��-�� �5�5�7�7�
�
�
������#���'����~�d�k�k�'�&:�&:�;�;�E�E�G�G�����TF)�error_recovery�path�start_symbol�cache�
diff_cache�
cache_path�file_io�coder<r=r@rA�returnc�D�|�|�|�td���t|t��rt|��}t|t��rt|��}|�|j}|r|dkrtd���|�"|�t
|��}nt||��}|r"|j�t|j
||���}	|	�|	S|�|���}t|��}t|d���}
|r�|j�td���	t|j
|j}|j}	|j}||
kr|	S|�|j|j|	���||
�	��}
t+|j
||
|
|ot,|�
��|
S#t.$rYnwxYw|�|
��}|�|j||���}|�|���}|s|r"t+|j
|||
|ot,|�
��|S)
a�
        If you want to parse a Python file you want to start here, most likely.

        If you need finer grained control over the parsed instance, there will be
        other ways to access it.

        :param str code: A unicode or bytes string. When it's not possible to
            decode bytes to a string, returns a
            :py:class:`UnicodeDecodeError`.
        :param bool error_recovery: If enabled, any code will be returned. If
            it is invalid, it will be returned as an error node. If disabled,
            you will get a ParseError when encountering syntax errors in your
            code.
        :param str start_symbol: The grammar rule (nonterminal) that you want
            to parse. Only allowed to be used when error_recovery is False.
        :param str path: The path to the file you want to open. Only needed for caching.
        :param bool cache: Keeps a copy of the parser tree in RAM and on disk
            if a path is given. Returns the cached trees if the corresponding
            files on disk have not changed. Note that this stores pickle files
            on your file system (e.g. for Linux in ``~/.cache/parso/``).
        :param bool diff_cache: Diffs the cached python module against the new
            code and tries to parse only the parts that have changed. Returns
            the same (changed) module that is found in cache. Using this option
            requires you to not do anything anymore with the cached modules
            under that path, because the contents of it might change. This
            option is still somewhat experimental. If you want stability,
            please don't use it.
        :param bool cache_path: If given saves the parso cache in this
            directory. If not given, defaults to the default cache places on
            each platform.

        :return: A subclass of :py:class:`parso.tree.NodeOrLeaf`. Typically a
            :py:class:`parso.python.tree.Module`.
        Nz%Please provide either code or a path.�
file_inputz"This is currently not implemented.)r@T)�keependsz?You have to define a diff parser to be able to use this option.)�	old_lines�	new_lines)�picklingr@)r;�start_nonterminal)�tokens)�	TypeError�
isinstance�strr	r#�NotImplementedErrorrrr<rr5�readr
rr0r�node�linesr-r/�updaterr
�KeyErrorr.�parse)r6rBr;r<r=r>r?r@rA�module_noderR�module_cache_itemrG�new_noderK�p�	root_nodes                 r8rUz
Grammar.parse1s���X�<�D�L�W�_��C�D�D�D��d�C� � �	���:�:�D��j�#�&�&�	*��j�)�)�J����2�L��	L�l�l�:�:�%�&J�K�K�K��?��|� ��,�,���,�T�4�8�8���	#�W�\�-�%�d�l�G�
�S�S�S�K��&�"�"��<��<�<�>�>�D�&�t�,�,���D�4�0�0�0���	 �� �(��!6�7�7�7�
 �$0���$>�w�|�$L�!�0�4��-�3�	���%�%�&�&��,�,��&�������&�'�#�����#�4�<��(�E�,1�,A�'�k�.8�:�:�:�:� ���%�
�
�
���
����(����'�'���L�L���)�*�
�
�
��
�G�G�6�G�*�*�	��	6�J�	6��t�|�W�i��(-�(=�g�+�*4�
6�
6�
6�
6��s�F"�"
F/�.F/c�6�|j}|�td���|S)Nz"The token namespace should be set.)r%�
ValueError)r6�nss  r8r,zGrammar._get_token_namespace�s#��
�
"��
�:��A�B�B�B��	r:c�d�|j�td���|�||j��S)z�
        Given a :py:class:`parso.tree.NodeOrLeaf` returns a generator of
        :py:class:`parso.normalizer.Issue` objects. For Python this is
        a list of syntax/indentation errors.
        Nz/No error normalizer specified for this grammar.)r$r\�_get_normalizer_issues)r6rQs  r8�iter_errorszGrammar.iter_errors�s5���(�0��N�O�O�O��*�*�4��1N�O�O�Or:c�F�t|���|��S�N)r�walk)r6�	base_node�node_to_str_maps   r8�refactorzGrammar.refactor�s��$�_�5�5�:�:�9�E�E�Er:c�`�|�|j}|�td���|�|��S)NzVYou need to specify a normalizer, because there's no default normalizer for this tree.)r&r\�create_normalizer)r6�normalizer_configs  r8�_get_normalizerzGrammar._get_normalizer�sF���$� $� ?�� �(� �"P�Q�Q�Q� �2�2�4�8�8�8r:c�V�|�|��}|�|��S)zs
        TODO this is not public, yet.
        The returned code will be normalized, e.g. PEP8 for Python.
        )rjrc�r6rQri�
normalizers    r8�
_normalizezGrammar._normalize�s*��
�)�)�*;�<�<�
����t�$�$�$r:c�d�|�|��}|�|��|jSrb)rjrc�issuesrls    r8r_zGrammar._get_normalizer_issues�s1���)�)�*;�<�<�
��������� � r:c��|jj���}d�t	|��dd���dz}d|jj�d|�d�S)N� �z ...�<�:�>)r-�nonterminal_to_dfas�keys�join�list�	__class__�__name__)r6�nonterminals�txts   r8�__repr__zGrammar.__repr__�s\���)�=�B�B�D�D���h�h�t�L�)�)�"�1�"�-�.�.��7��� �N�3�3�3�S�S�S�9�9r:rb)r|�
__module__�__qualname__�__doc__rN�__annotations__r$rrr%rr�PEP8NormalizerConfigr&rrr9r�bytes�os�PathLikerr!rUr,r`rfrjrnr_r�r:r8rrs��������������<@��h�'8�9�@�@�@� ��c� � � �3L�4�3L�3N�3N�� 0�N�N�N�7A�t�H�H�H�S�H�H�H�H�)-�r�"�.2�"&���48� $�r�r�r��#�u�*�%�r��"�+�s�*�+�	r�
 �r� ���S� 0�1�r��r�*0�r�r�r�r�h���	P�	P�	P�F�F�F�9�9�9�%�%�%�%�!�!�!�!�
:�:�:�:�:r:c�P��eZdZe��ZeZdZdede	f�fd�Z
d�Zd�Z�xZ
S)�
PythonGrammarrE�version_info�bnf_textc�~��t���||jtt���||_dS)N)r7r'r()�superr9�_tokenize_lines�PythonParserrr�)r6r�r�r{s   �r8r9zPythonGrammar.__init__�sC���
�������*��"�		�	
�	
�	
�)����r:c�*�t|fd|ji|��S)Nr�)rr�)r6rR�kwargss   r8r�zPythonGrammar._tokenize_lines�s ���e�N�N�$�2C�N�v�N�N�Nr:c�.�t||j���S)N)r�)rr�)r6rBs  r8�	_tokenizezPythonGrammar._tokenize�s����4�+<�=�=�=�=r:)r|r�r�rr$rr%r#rrNr9r�r��
__classcell__)r{s@r8r�r��s��������0�0�2�2��'��%��)�%6�)�#�)�)�)�)�)�)�O�O�O�>�>�>�>�>�>�>r:r�)�versionr<r�r<c�r�t|��}|p/tj�dd|j�|j�d���}tj�tj�t��|��}	t|S#t$r�	t|��5}|���}ddd��n#1swxYwYt||��}t�
||��cYS#t$r#d|j�d|j�d�}t|���wxYwwxYw)z�
    Loads a :py:class:`parso.Grammar`. The default version is the current Python
    version.

    :param str version: A python version string, e.g. ``version='3.8'``.
    :param str path: A path to a grammar file
    �python�grammarz.txtNzPython version �.z is currently not supported.)rr�r<ry�major�minor�dirname�__file__r rT�openrPr��
setdefault�FileNotFoundErrorrO)r�r<r��file�fr�r��messages        r8�load_grammarr��s���(��0�0�L���2�7�<�<���)�/�/��1C�1C�1C�D���D��7�<�<������1�1�4�8�8�D�
/���%�%���/�/�/�
	/��d���
$�q��6�6�8�8��
$�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$����
$�
$�
$�
$�$�L�(�;�;�G�#�.�.�t�W�=�=�=�=�=�� �	/�	/�	/�	/��"�"�"�L�$6�$6�$6��G�&�g�.�.�.�		/����/���sH�B�
D6�D�,C
�D�
C	�D�C	�-D�D6�-D2�2D6)5r1r��typingrrrrrr�pathlibr	�parso._compatibilityr
�parso.pgen2r�parso.utilsrr
rr�parso.python.diffr�parso.python.tokenizerr�parso.python.tokenr�parso.cacherrr�parso.parserr�parso.python.parserrr��parso.python.errorsr�parso.pythonr�
parso.file_iorr�parso.normalizerrrr rNr�r!rr�r�r�r:r8�<module>r�sT�������	�	�	�	�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�������(�(�(�(�(�(�(�(�(�(�(�(�,�,�,�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�:�:�:�:�:�:�:�:�/�/�/�/�/�/�E�E�E�E�E�E�E�E�E�E�#�#�#�#�#�#�6�6�6�6�6�6�1�1�1�1�1�1�������4�4�4�4�4�4�4�4�D�D�D�D�D�D�D�D�)+��$�s�I�~�&�+�+�+�	���	�	��w:�w:�w:�w:�w:�g�f�o�w:�w:�w:�t>�>�>�>�>�G�>�>�>�,$(�T�/�/�/�S�/�s�/�/�/�/�/�/r:

Youez - 2016 - github.com/yon3zu
LinuXploit