Ë
    pPêj²  ã                  ó’   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZ ddlmZ  G d„ d	«      Z G d
„ d«      Z G d„ de«      Zy)zGHelpers that store information about functions and the related classes.é    )Úannotations)ÚFuncItem)ÚClassIR)ÚINVALID_FUNC_DEF)Ú
BasicBlockÚValue)ÚAssignmentTargetc            
      óF  — e Zd ZdZedddddddddf
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd„Zedd„«       Zedd„«       Z	edd	„«       Z
e
j                  dd
„«       Z
edd„«       Zej                  dd„«       Zedd„«       Zej                  dd„«       Zedd„«       Zdd„Zy)ÚFuncInfoz;Contains information about functions as they are generated.Ú NFc                óÈ   — || _         || _        || _        || _        d | _        d | _        d | _        d | _        || _        || _	        || _
        || _        |	| _        |
| _        y ©N)ÚfitemÚnameÚ
class_nameÚnsÚ_callable_classÚ
_env_classÚ_generator_classÚ_curr_env_regÚ	is_nestedÚcontains_nestedÚis_decoratedÚ
in_non_extÚadd_nested_funcs_to_envÚis_comprehension_scope)Úselfr   r   r   Ú	namespacer   r   r   r   r   r   s              úZ/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypyc/irbuild/context.pyÚ__init__zFuncInfo.__init__   sy   € ð ˆŒ
ØˆŒ	Ø$ˆŒØˆŒð 6:ˆÔð +/ˆŒð 8<ˆÔð ,0ˆÔð #ˆŒØ.ˆÔØ(ˆÔØ$ˆŒØ'>ˆÔ$ð
 '=ˆÕ#ó    c                ót   — dj                  d„ | j                  | j                  | j                  fD «       «      S )NÚ_c              3  ó&   K  — | ]	  }|sŒ|–— Œ y ­wr   © )Ú.0Úxs     r   ú	<genexpr>z+FuncInfo.namespaced_name.<locals>.<genexpr>>   s   è ø€ ÒN˜aÊAœÑNùs   ‚Š)Újoinr   r   r   ©r   s    r   Únamespaced_namezFuncInfo.namespaced_name=   s*   € Ø�x‰xÑN D§I¡I¨t¯©ÀÇÁÐ#HÔNÓNÐNr!   c                ó^   — | j                   j                  xs | j                   j                  S r   )r   Úis_generatorÚis_coroutiner*   s    r   r-   zFuncInfo.is_generator@   s!   € à�z‰z×&Ñ&ÒA¨$¯*©*×*AÑ*AÐAr!   c                ó.   — | j                   j                  S r   )r   r.   r*   s    r   r.   zFuncInfo.is_coroutineD   s   € à�z‰z×&Ñ&Ð&r!   c                ó6   — | j                   €J ‚| j                   S r   ©r   r*   s    r   Úcallable_classzFuncInfo.callable_classH   ó    € à×#Ñ#Ð/Ð/Ð/Ø×#Ñ#Ð#r!   c                ó   — || _         y r   r1   ©r   Úclss     r   r2   zFuncInfo.callable_classM   ó
   € à"ˆÕr!   c                ó6   — | j                   €J ‚| j                   S r   ©r   r*   s    r   Ú	env_classzFuncInfo.env_classQ   s   € à�‰Ð*Ð*Ð*Ø�‰Ðr!   c                ó   — || _         y r   r9   ©r   Úirs     r   r:   zFuncInfo.env_classV   s	   € àˆ�r!   c                ó6   — | j                   €J ‚| j                   S r   ©r   r*   s    r   Úgenerator_classzFuncInfo.generator_classZ   s    € à×$Ñ$Ð0Ð0Ð0Ø×$Ñ$Ð$r!   c                ó   — || _         y r   r?   r5   s     r   r@   zFuncInfo.generator_class_   s
   € à #ˆÕr!   c                ó6   — | j                   €J ‚| j                   S r   ©r   r*   s    r   Úcurr_env_regzFuncInfo.curr_env_regc   ó    € à×!Ñ!Ð-Ð-Ð-Ø×!Ñ!Ð!r!   c                óº   — | j                   r$| j                   j                  j                  sd}|S | j                  xr | j                   xr | j
                   }|S )NF)r   r=   Úis_final_classr-   r   r   )r   Úresults     r   Ú#can_merge_generator_and_env_classesz,FuncInfo.can_merge_generator_and_env_classesh   sY   € ð × Ò ¨×)>Ñ)>×)AÑ)A×)PÒ)PØˆFð ˆð ×&Ñ&ÒZ¨t¯~©~Ð+=ÒZÀd×FZÑFZÐBZˆFØˆr!   )r   r   r   Ústrr   z
str | Noner   rJ   r   Úboolr   rK   r   rK   r   rK   r   rK   r   rK   ÚreturnÚNone)rL   rJ   )rL   rK   )rL   ÚImplicitClass)r6   rN   rL   rM   )rL   r   ©r=   r   rL   rM   )rL   ÚGeneratorClass)r6   rP   rL   rM   ©rL   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r    r+   Úpropertyr-   r.   r2   Úsetterr:   r@   rD   rI   r%   r!   r   r   r      sj  „ ÙEð +ØØ!%ØØØ %Ø"Ø Ø(-Ø',ð*=àð*=ð ð*=ð ð	*=ð
 ð*=ð ð*=ð ð*=ð ð*=ð ð*=ð "&ð*=ð !%ð*=ð 
ó*=ó\Oð òBó ðBð ò'ó ð'ð ò$ó ð$ð ×Ñò#ó ð#ð òó ðð ×Ñòó ðð ò%ó ð%ð ×Ñò$ó ð$ð ò"ó ð"ôr!   r   c                  óÀ   — e Zd ZdZd
d„Zedd„«       Zej                  dd„«       Zedd„«       Zej                  dd„«       Zedd„«       Z	e	j                  dd„«       Z	y	)rN   a  Contains information regarding implicitly generated classes.

    Implicit classes are generated for nested functions and generator
    functions. They are not explicitly defined in the source code.

    NOTE: This is both a concrete class and used as a base class.
    c                ó<   — || _         d | _        d | _        d | _        y r   )r=   Ú	_self_regr   Ú_prev_env_regr<   s     r   r    zImplicitClass.__init__{   s"   € àˆŒà'+ˆŒð
 ,0ˆÔØ+/ˆÕr!   c                ó6   — | j                   €J ‚| j                   S r   ©rZ   r*   s    r   Úself_regzImplicitClass.self_reg‡   s   € à�~‰~Ð)Ð)Ð)Ø�~‰~Ðr!   c                ó   — || _         y r   r]   ©r   Úregs     r   r^   zImplicitClass.self_regŒ   s	   € àˆ�r!   c                ó6   — | j                   €J ‚| j                   S r   rC   r*   s    r   rD   zImplicitClass.curr_env_reg�   rE   r!   c                ó   — || _         y r   rC   r`   s     r   rD   zImplicitClass.curr_env_reg•   ó
   € à ˆÕr!   c                ó6   — | j                   €J ‚| j                   S r   ©r[   r*   s    r   Úprev_env_regzImplicitClass.prev_env_reg™   rE   r!   c                ó   — || _         y r   rf   r`   s     r   rg   zImplicitClass.prev_env_regž   rd   r!   NrO   rQ   ©ra   r   rL   rM   )
rR   rS   rT   rU   r    rV   r^   rW   rD   rg   r%   r!   r   rN   rN   r   s”   „ ñó
0ð òó ðð ‡_�_òó ðð ò"ó ð"ð ×Ñò!ó ð!ð ò"ó ð"ð ×Ñò!ó ñ!r!   rN   c                  ó”   ‡ — e Zd ZdZdˆ fd„Zedd„«       Zej                  d	d„«       Zed
d„«       Zej                  dd„«       Zˆ xZ	S )rP   z?Contains information about implicit generator function classes.c                ó–   •— t         ‰| �  |«       d | _        d | _        d | _        d | _        d | _        t        «       | _        g | _	        y r   )
Úsuperr    Ú_next_label_regÚ_next_label_targetÚexc_regsÚsend_arg_regÚstop_iter_value_regr   Úswitch_blockÚcontinuation_blocks)r   r=   Ú	__class__s     €r   r    zGeneratorClass.__init__¦   sT   ø€ Ü‰Ñ˜Ôð .2ˆÔØ;?ˆÔð <@ˆŒð +/ˆÔð
 26ˆÔ ô '›LˆÔØ57ˆÕ r!   c                ó6   — | j                   €J ‚| j                   S r   ©rm   r*   s    r   Únext_label_regzGeneratorClass.next_label_reg¾   r3   r!   c                ó   — || _         y r   rv   r`   s     r   rw   zGeneratorClass.next_label_regÃ   r7   r!   c                ó6   — | j                   €J ‚| j                   S r   ©rn   r*   s    r   Únext_label_targetz GeneratorClass.next_label_targetÇ   s    € à×&Ñ&Ð2Ð2Ð2Ø×&Ñ&Ð&r!   c                ó   — || _         y r   rz   )r   Útargets     r   r{   z GeneratorClass.next_label_targetÌ   s
   € à"(ˆÕr!   rO   rQ   ri   )rL   r	   )r}   r	   rL   rM   )
rR   rS   rT   rU   r    rV   rw   rW   r{   Ú__classcell__)rt   s   @r   rP   rP   £   sg   ø„ ÙIõ8ð0 ò$ó ð$ð ×Ñò#ó ð#ð ò'ó ð'ð ×Ñò)ó ô)r!   rP   N)rU   Ú
__future__r   Ú
mypy.nodesr   Úmypyc.ir.class_irr   Úmypyc.ir.func_irr   Úmypyc.ir.opsr   r   Úmypyc.irbuild.targetsr	   r   rN   rP   r%   r!   r   ú<module>r…      s>   ðÙ Må "å Ý %Ý -ß *Ý 2÷cñ c÷L.!ñ .!ôb+)�]õ +)r!   