| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 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 : /usr/lib/python3/dist-packages/pythran/analyses/__pycache__/ |
Upload File : |
�
cR�a� � �2 � d Z ddlmZ G d� de� � ZdS )z0
NodeCount counts the number of nodes in a node
� )�NodeAnalysisc �, � � e Zd ZdZ� fd�Z� fd�Z� xZS )� NodeCounta�
Count the number of nodes included in a node
This has nothing to do with execution time or whatever,
its mainly use is to prevent the AST from growing too much when unrolling
>>> import gast as ast
>>> from pythran import passmanager, backend
>>> node = ast.parse("if 1: return 3")
>>> pm = passmanager.PassManager("test")
>>> print(pm.gather(NodeCount, node))
5
c �d �� d| _ t t | � � � � � d S )Nr )�result�superr �__init__)�self� __class__s ��=/usr/lib/python3/dist-packages/pythran/analyses/node_count.pyr zNodeCount.__init__ s, �� ����
�i����'�'�)�)�)�)�)� c �x �� | xj dz
c_ t t | � � � |� � d S )N� )r r r �
generic_visit)r
�noder s �r r zNodeCount.generic_visit s7 �� ����q����
�i����,�,�T�2�2�2�2�2r
)�__name__�
__module__�__qualname__�__doc__r r �
__classcell__)r s @r r r s[ �� � � � � �� �*� *� *� *� *�3� 3� 3� 3� 3� 3� 3� 3� 3r
r N)r �pythran.passmanagerr r � r
r �<module>r sW ��� � -� ,� ,� ,� ,� ,�3� 3� 3� 3� 3�� 3� 3� 3� 3� 3r