← Back
Editing: node_count.cpython-311.pyc
� 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
Save File
Cancel