Ë
    pPêj‰  ã                  óˆ   — U d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z
 ddlmZmZ eeedz  edz  f   Zded	<    G d
„ d«      Zy)z—Track current scope to easily calculate the corresponding fine-grained target.

TODO: Use everywhere where we track targets, including in mypy.errors.
é    )Úannotations)ÚIterator)ÚcontextmanagerÚnullcontext)Ú	TypeAlias)ÚFuncBaseÚTypeInfoNÚ
_TypeAliasÚ
SavedScopec                  ó¨   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	e
dd„«       Ze
dd	„«       Zdd
„Zdd„Zdd„Ze
dd„«       Zdd„Ze
dd„«       Zy)ÚScopez7Track which target we are processing at any given time.c                óJ   — d | _         g | _        d | _        g | _        d| _        y ©Nr   )ÚmoduleÚclassesÚfunctionÚ	functionsÚignored©Úselfs    úO/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypy/scope.pyÚ__init__zScope.__init__   s%   € Ø"&ˆŒØ')ˆŒØ)-ˆŒØ)+ˆŒàˆ�ó    c                ó6   — | j                   sJ ‚| j                   S ©N)r   r   s    r   Úcurrent_module_idzScope.current_module_id   s   € Ø�{Š{Ðˆ{Ø�{‰{Ðr   c                ó†   — | j                   sJ ‚| j                  r| j                  j                  }|xs dS | j                   S )zKReturn the current target (non-class; for a class return enclosing module).Ú )r   r   Úfullname)r   r   s     r   Úcurrent_targetzScope.current_target    s8   € à�{Š{Ðˆ{Ø�=Š=Ø—}‘}×-Ñ-ˆHØ’>˜rÐ!Ø�{‰{Ðr   c                óÄ   — | j                   sJ ‚| j                  r| j                  j                  S | j                  r| j                  d   j                  S | j                   S )z+Return the current target (may be a class).éÿÿÿÿ)r   r   r   r   r   s    r   Úcurrent_full_targetzScope.current_full_target(   sK   € à�{Š{Ðˆ{Ø�=Š=Ø—=‘=×)Ñ)Ð)Ø�<Š<Ø—<‘< Ñ#×,Ñ,Ð,Ø�{‰{Ðr   c                óP   — | j                   r| j                   d   j                  S dS )z1Return the current type's short name if it existsr"   N)r   Únamer   s    r   Úcurrent_type_namezScope.current_type_name1   s"   € à(,¯ªˆt�|‰|˜BÑ×$Ñ$Ð>¸$Ð>r   c                óJ   — | j                   r| j                   j                  S dS )z5Return the current function's short name if it existsN)r   r%   r   s    r   Úcurrent_function_namezScope.current_function_name5   s   € à%)§]¢]ˆt�}‰}×!Ñ!Ð<¸Ð<r   c              #  óv   K  — || _         g | _        d | _        d| _        d –— | j                   sJ ‚d | _         y ­wr   )r   r   r   r   )r   Úprefixs     r   Úmodule_scopezScope.module_scope9   s8   è ø€ àˆŒØˆŒØˆŒØˆŒÛØ�{Š{Ðˆ{Øˆ�ùs   ‚79c              #  ó>  K  — | j                   j                  |«       | j                  s|| _        n| xj                  dz  c_        d –— | j                   j	                  «        | j                  r| xj                  dz  c_        y | j                  sJ ‚d | _        y ­w)Né   )r   Úappendr   r   Úpop)r   Úfdefs     r   Úfunction_scopezScope.function_scopeC   sq   è ø€ à�‰×Ñ˜dÔ#Ø�}Š}Ø ˆD�Mð �LŠL˜AÑ�LÛØ�‰×ÑÔØ�<Š<à�LŠL˜AÑŽLà—=’=Ð �=Ø ˆD�Mùs   ‚BBc                ó    — | j                   d d S )Nr"   )r   r   s    r   Úouter_functionszScope.outer_functionsT   s   € Ø�~‰~˜c˜rÐ"Ð"r   c                ó~   — | j                   s| j                  j                  |«       y| xj                  dz  c_        y)zEnter a class target scope.r-   N)r   r   r.   r   ©r   Úinfos     r   Úenter_classzScope.enter_classW   s+   € à�}Š}Ø�L‰L×Ñ Õ%ð �LŠL˜AÑŽLr   c                ó˜   — | j                   r| xj                   dz  c_         y| j                  sJ ‚| j                  j                  «        y)zLeave a class target scope.r-   N)r   r   r/   r   s    r   Úleave_classzScope.leave_class_   s3   € à�<Š<à�LŠL˜AÑŽLà—<’<Ð�<à�L‰L×ÑÕr   c              #  óV   K  — | j                  |«       d –— | j                  «        y ­wr   )r7   r9   r5   s     r   Úclass_scopezScope.class_scopei   s#   è ø€ à×Ñ˜ÔÛØ×ÑÕùs   ‚')c                óŠ   — | j                   sJ ‚| j                  r| j                  d   nd}| j                   || j                  fS )z<Produce a saved scope that can be entered with saved_scope()r"   N)r   r   r   )r   Úclss     r   Úsavez
Scope.saveo   s;   € à�{Š{Ðˆ{ð #'§,¢,ˆd�l‰l˜2Ò°DˆØ�{‰{˜C §¡Ð.Ð.r   c              #  ó4  K  — |\  }}}| j                  |«      5  |r| j                  |«      n	t        «       5  |r| j                  |«      n	t        «       5  d –— d d d «       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   ŒxY w# 1 sw Y   y xY w­wr   )r+   r;   r   r1   )r   Úsavedr   r6   r   s        r   Úsaved_scopezScope.saved_scopew   sŽ   è ø€ à!&Ñˆ��hØ×Ñ˜vÓ&ñ 	Ù+/�×!Ñ! $Ô'´[³]ñ Ù6>�T×(Ñ(¨Ô2ÄKÃMñ Û÷÷÷	ð 	÷ð ú÷ð ú÷	ð 	üsK   ‚BšB¸B ÁA4ÁB Á#BÁ+	BÁ4A=Á9B Â B		ÂBÂBÂBN)ÚreturnÚNone)rB   Ústr)rB   z
str | None)r*   rD   rB   úIterator[None])r0   r   rB   rE   )rB   zlist[FuncBase])r6   r	   rB   rC   )r6   r	   rB   rE   )rB   r   )r@   r   rB   rE   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r#   r&   r(   r   r+   r1   r3   r7   r9   r;   r>   rA   © r   r   r   r      s‡   „ ÙAóóóóó?ó=ð òó ðð ò!ó ð!ó #óóð òó ðó
/ð òó ñr   r   )rI   Ú
__future__r   Úcollections.abcr   Ú
contextlibr   r   Útypingr   r
   Ú
mypy.nodesr   r	   ÚtuplerD   r   Ú__annotations__r   rJ   r   r   ú<module>rR      sE   ðòõ
 #å $ß 2Ý *ç )à˜s H¨t¡O°XÀ±_ÐDÑE€
ˆJÓ E÷lò lr   