AlkantarClanX12
Current Path : /lib64/python3.8/__pycache__/ |
Current File : //lib64/python3.8/__pycache__/ast.cpython-38.pyc |
U e5d"K � @ s� d Z ddlT d=ddd�dd �Zd d� Zd>d d�Zdd� Zdd� Zd?dd�Zdd� Zdd� Z d@dd�Z dd� Zdd� Zdd �d!d"�Z d#d$� ZG d%d&� d&e�ZG d'd(� d(e�Zd)d*� Zd+d,� Zeee�e_eee�e_G d-d.� d.e�Zd/d0� ZG d1d2� d2eed3�ZG d4d5� d5eed3�ZG d6d7� d7eed3�ZG d8d9� d9eed3�ZG d:d;� d;eed3�Zee e!e"fee#fee$feed�e%feed<�fiZ&ee%fiZ'e%d9ed�d9e d2e!d2e"d2e#d5e$d7ed<�d;iZ(dS )AaH ast ~~~ The `ast` module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like and allows modifications of it. An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as a flag to the `compile()` builtin function or by using the `parse()` function from this module. The result will be a tree of objects whose classes all inherit from `ast.AST`. A modified abstract syntax tree can be compiled into a Python code object using the built-in `compile()` function. Additionally various helper functions are provided that make working with the trees simpler. The main intention of the helper functions and this module in general is to provide an easy to use interface for libraries that work tightly with the python syntax (template engines for example). :copyright: Copyright 2008 by Armin Ronacher. :license: Python License. � )�*� <unknown>�execFN)� type_comments�feature_versionc C sR t }|r|tO }t|t�r4|\}}|dks.t�|}n|dkr@d}t| ||||d�S )z� Parse the source into an AST node. Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). Pass type_comments=True to get back type comments where the syntax allows. � N���)�_feature_version)Z PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS� isinstance�tuple�AssertionError�compile)�source�filename�moder r �flags�major�minor� r �/usr/lib64/python3.8/ast.py�parse s �r c s` t | t�rt| dd�} t | t�r&| j} dd� ��fdd���fdd��� ���fd d �� � | �S )a Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None. �eval)r c S s t d| ����d S )Nzmalformed node or string: )� ValueError��noder r r �_raise_malformed_node>