403Webshell
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/transformations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pythran/transformations/__pycache__/normalize_ifelse.cpython-311.pyc
�

cR�a���F�dZddlmZddlmZddlZGd�de��ZdS)z: NormalizeIfElse transform early exit in if into if-else. �)�	Ancestors)�TransformationNc�.��eZdZdZ�fd�Zd�Zd�Z�xZS)�NormalizeIfElsea�

    >>> import gast as ast
    >>> from pythran import passmanager, backend
    >>> node = ast.parse("""
    ... def foo(y):
    ...  if y: return 1
    ...  return 2""")
    >>> pm = passmanager.PassManager("test")
    >>> _, node = pm.apply(NormalizeIfElse, node)
    >>> print(pm.dump(backend.Python, node))
    def foo(y):
        if y:
            return 1
        else:
            return 2

    >>> node = ast.parse("""
    ... def foo(y):
    ...  if y:
    ...    z = y + 1
    ...    if z:
    ...      return 1
    ...    else:
    ...      return 3
    ...  return 2""")
    >>> pm = passmanager.PassManager("test")
    >>> _, node = pm.apply(NormalizeIfElse, node)
    >>> print(pm.dump(backend.Python, node))
    def foo(y):
        if y:
            z = (y + 1)
            if z:
                return 1
            else:
                return 3
        else:
            return 2
    c�b��tt|���t��dS)N)�superr�__init__r)�self�	__class__s ��J/usr/lib/python3/dist-packages/pythran/transformations/normalize_ifelse.pyr	zNormalizeIfElse.__init__2s'���
�o�t�$�$�-�-�i�8�8�8�8�8�c�2�t|tjtjtjf��rdSt|tj��rI|�|jd��sdS|jo|�|jd��SdS)NT���F)�
isinstance�ast�Return�Break�If�check_lasts�body�orelse)r
�nodes  rrzNormalizeIfElse.check_lasts5s����d�S�Z���C�J�?�@�@�	��4��d�C�F�#�#�	E��#�#�D�I�b�M�2�2�
��u��;�D�4�#3�#3�D�K��O�#D�#D�D�	E�	Er
c���|�|��|�|jd��s|S|j|d}dD]�}	t	||��}|�|��}|t
|��dz
kr|cS|jsg|_|j�||dzd���g||dzd�<d|_	|cS#t$rY��t$rY��wxYw|S)Nr)rr�	finalbody�T)�
generic_visitrr�	ancestors�getattr�index�lenr�extend�update�
ValueError�AttributeError)r
r�parent�attrrrs      r�visit_IfzNormalizeIfElse.visit_If=s,�����4� � � �����	�"�
�.�.�	��K����%�b�)��3�	�	�D�
��v�t�,�,���
�
�4�(�(���C��I�I��M�)�)��K�K�K��{�%�"$�D�K���"�"�4���	�
�
�#3�4�4�4�#%��U�Q�Y�Z�Z� �"���������
�
�
���!�
�
�
���
�����s�<C�AC�
C/�#	C/�.C/)�__name__�
__module__�__qualname__�__doc__r	rr'�
__classcell__)rs@rrr	sd�������&�&�P9�9�9�9�9�E�E�E�������r
r)r+�pythran.analysesr�pythran.passmanagerr�gastrr�r
r�<module>r1sy��@�@�&�&�&�&�&�&�.�.�.�.�.�.�����I�I�I�I�I�n�I�I�I�I�Ir

Youez - 2016 - github.com/yon3zu
LinuXploit