§
    �ŸjX  ã                   óh   — d Z ddlmZ ddlmZ ddlmZ ddlZ edg d¢¦  «        Zd„ Z	dd	„Z
dd
„ZdS )zToken-related utilitiesé    )Ú
namedtuple)ÚStringIO)Ú	iskeywordNÚToken)ÚtokenÚtextÚstartÚendÚlinec              #   ón   K  — 	 t          j        | ¦  «        D ]}|V — ŒdS # t           j        $ r Y dS w xY w)z(wrap generate_tokens to catch EOF errorsN)ÚtokenizeÚgenerate_tokensÚ
TokenError)Úreadliner   s     úd/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/IPython/utils/tokenutil.pyr   r      s_   è è € ðÝÔ-¨hÑ7Ô7ð 	ð 	ˆEØˆKˆKˆKˆKð	ð 	øåÔð ð ð àˆˆðøøøs   „! ¡4³4c                 ó²   — d}|                       d¦  «        }|D ]8}|t          |¦  «        z   }|                     d¦  «        s|dz  }||k    r n|}Œ9d}||fS )a¨  Return the line in a cell at a given cursor position

    Used for calling line-based APIs that don't support multi-line input, yet.

    Parameters
    ----------
    cell : str
        multiline block of text
    cursor_pos : integer
        the cursor position

    Returns
    -------
    (line, offset): (string, integer)
        The line with the current cursor, and the character offset of the start of the line.
    r   Tú
é   Ú )Ú
splitlinesÚlenÚendswith)ÚcellÚ
cursor_posÚoffsetÚlinesr   Únext_offsets         r   Úline_at_cursorr      s   € ð" €FØ�OŠO˜DÑ!Ô!€EØð ð ˆØ�s 4™yœyÑ(ˆØ�}Š}˜TÑ"Ô"ð 	ð ˜1ÑˆKØ˜Ò#Ð#ØˆEØˆˆàˆØ�&ˆ>Ðó    c                 ó&  — g }g }g }ddi}t          t          | ¦  «        j        ¦  «        D �]Ï}t          |Ž }|j        \  }}	|j        \  }
}|
dz   |vrU|j                             d¦  «        }t          ||dz   ¦  «        D ]'\  }}||vr||dz
           t          |¦  «        z   ||<   Œ(||         }|	dk    r|dz   n|}||	z   |k    r �n4|j
        t          j        k    rut          |j        ¦  «        sa|rD|rB|d         j
        t          j        k    r'|d         j        dk    r|d         ›d|j        ›�|d<   n�|                     |j        ¦  «         n‚|j
        t          j        k    rm|j        dk    r|r|                     d¦  «         |j        dk    r|r|                     |d         ¦  «         n"|j        dk    r|r|                     d¦  «         |                     |¦  «         ||
         |z   |k    r n�ŒÑ|r|d         S |r|d         S d	S )
az  Get the token at a given cursor

    Used for introspection.

    Function calls are prioritized, so the token for the callable will be returned
    if the cursor is anywhere inside the call.

    Parameters
    ----------
    cell : unicode
        A block of Python code
    cursor_pos : int
        The location of the cursor in the block where the token should be found
    r   r   Téÿÿÿÿú.ú=ú(ú)r   )r   r   r   r   r	   r
   r   r   Ú	enumerater   r   r   ÚNAMEr   r   ÚOPÚappendÚpop)r   r   ÚnamesÚtokensÚ
call_namesÚoffsetsÚtupÚtokÚ
start_lineÚ	start_colÚend_lineÚend_colr   Úlinenor   r   Úboundarys                    r   Útoken_at_cursorr7   9   s]  € ð €EØ€FØ€Jà�!ˆf€GÝ�x¨™~œ~Ô6Ñ7Ô7ð )ñ )ˆå�Sˆkˆð !$¤	Ñˆ
�IØœGÑˆ�'Ø�a‰<˜wÐ&Ð&à”H×'Ò'¨Ñ-Ô-ˆEÝ )¨%°¸a±Ñ @Ô @ð Dð D‘�˜Ø Ð(Ð(Ø&-¨f°Q©hÔ&7½#¸d¹)¼)Ñ&C�G˜F‘Oøà˜Ô$ˆà%.°!¢^ ^�: ‘>�>¸ˆØ�IÑ Ò)Ð)ð ‰EàŒ9�œÒ%Ð%­i¸¼Ñ.AÔ.AÐ%Øð '˜ð ' F¨2¤JÔ$4½¼Ò$CÐ$CÈÈrÌ
ÌÐ[^ÒH^ÐH^Ø',¨R¤y y y°#´(°(Ð;��b‘	�	à—’˜SœXÑ&Ô&Ð&Ð&ØŒY�(œ+Ò%Ð%ØŒx˜3Šˆ 5ˆà—	’	˜"‘”�ØŒx˜3Šˆ 5ˆà×!Ò! %¨¤)Ñ,Ô,Ð,Ð,Ø”˜S’� Z�Ø—’˜rÑ"Ô"Ð"à�Š�cÑÔÐà�8Ô˜wÑ&¨Ò3Ð3àˆEñ 4ð ð Ø˜"Œ~ÐØ	ð Ø�RŒyÐàˆrr   )r   )Ú__doc__Úcollectionsr   Úior   Úkeywordr   r   r   r   r   r7   © r   r   ú<module>r=      s®   ðØ Ð ð
 #Ð "Ð "Ð "Ð "Ð "Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à €€€ð 	ˆ
�7ÐEÐEÐEÑFÔF€ðð ð ðð ð ð ðBDð Dð Dð Dð Dð Dr   