← Back
Editing: extended_syntax_check.cpython-311.pyc
� cR�a� � �~ � d Z ddlmZ ddlmZmZ ddlmZ ddlm Z m Z ddlmZ ddl Zd� Zd � Z G d � de� � ZdS )zH ExtendedSyntaxCheck performs various syntax checks on the pythran AST. � )�ModuleAnalysis)� StrictAliases�ArgumentEffects)�PythranSyntaxError)�ConstantIntr�FunctionIntr)�metadataNc � � t | t � � rdS t | t j � � sdS t j | j d t j � � S )NTFr )� isinstancer �ast�FunctionDefr �get�body�StaticReturn��nodes �H/usr/lib/python3/dist-packages/pythran/analyses/extended_syntax_check.py�is_global_constantr sM � ��$��%�%� ��t��d�C�O�,�,� ��u��<�� �!��h�&;�<�<�<� c �b � t | t t j f� � pt | � � S �N)r r r r r r s r � is_globalr s+ � ��t�l�C�O�<�=�=� %��t�$�$�&r c �B � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd S )�ExtendedSyntaxChecka Perform advanced syntax checking, based on strict aliases analysis: - is there a function redefinition? - is there a function call that does not match the called expression arity? - is there an operation that updates a global variable? c � � d | _ d| _ d| _ t � � | _ t j | t t � � d S )NF) �result�update�inassert�set� functionsr �__init__r r )�selfs r r! zExtendedSyntaxCheck.__init__% s= � ��������� ���������m�_�E�E�E�E�Er c � � t |t j � � sd S | j |j }n# t $ r Y d S w xY w|D ]>}t |� � r-t d� |j � � |j � � ��?d S )Nz=Cannot modify '{}': global variables are constant in pythran.) r r �Call�strict_aliases�func�KeyErrorr r �format�name)r"