| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 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/pythran/analyses/__pycache__/ |
Upload File : |
�
cR�a� � �V � d Z ddlmZ ddlZ G d� de� � Z G d� de� � ZdS )z�
LocalNameDeclarations gathers name of declarations local to a node.
LocalNodeDeclarations gathers node of declarations local to a node.
� )�NodeAnalysisNc �( � � e Zd ZdZ� fd�Zd� Z� xZS )�LocalNodeDeclarationsa�
Gathers all local symbols from a function.
It should not be use from outside a function, but can be used on a function
(but in that case, parameters are not taken into account)
>>> import gast as ast
>>> from pythran import passmanager, backend
>>> node = ast.parse('''
... def foo(a):
... b = a + 1''')
>>> pm = passmanager.PassManager("test")
>>> [name.id for name in pm.gather(LocalNodeDeclarations, node)]
['b']
>>> node = ast.parse('''
... for c in range(n):
... b = a + 1''')
>>> pm = passmanager.PassManager("test")
>>> sorted([name.id for name in pm.gather(LocalNodeDeclarations, node)])
['b', 'c']
c �| �� t � � | _ t t | � � � � � dS �z% Initialize empty set as the result. N)�set�result�superr �__init__��self� __class__s ��E/usr/lib/python3/dist-packages/pythran/analyses/local_declarations.pyr zLocalNodeDeclarations.__init__# �1 �� ��e�e���
�#�T�*�*�3�3�5�5�5�5�5� c �| � t |j t j � � r| j � |� � dS dS )z3 Any node with Store context is a new declaration. N)�
isinstance�ctx�ast�Storer �add�r
�nodes r �
visit_Namez LocalNodeDeclarations.visit_Name( s<