Hacked By AnonymousFox
��Yf�. � @ s� d Z d d l Td d d d � Z d d � Z d d
d d � Z d
d � Z d d � Z d d d � Z d d � Z d d � Z d d d � Z
d d � Z Gd d � d e � Z
Gd d � d e
� Z d S)!aH
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.
� )�*z <unknown>�execc C s t | | | t � S)zn
Parse the source into an AST node.
Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
)�compileZ
PyCF_ONLY_AST)�source�filename�mode� r �(/opt/alt/python35/lib64/python3.5/ast.py�parse s r
c sU t | t � r! t | d d �} t | t � r9 | j } � f d 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.
r �evalc s t | t t f � r | j St | t � r2 | j St | t � rW t t � | j � � St | t
� r| t t � | j � � St | t � r� t
t � | j � � St | t � r� t � f d d � t | j | j � D� � St | t � r� | j St | t � rbt | j t t f � rbt | j t t t f � rb� | j � } t | j t � rZ|
S| Sn� t | t � r�t | j t t f � r�t | j t t t f � r�t | j t t t f � r�� | j � } � | j � } t | j t � r�| | S| | St d t | � � � d S)Nc 3 s- | ]# \ } } � | � � | � f Vq d S)Nr )�.0�k�v)�_convertr r � <genexpr>= s z1literal_eval.<locals>._convert.<locals>.<genexpr>zmalformed node or string: )!�
isinstance�StrZBytes�sZNum�nZTuple�tuple�mapZeltsZList�list�Set�setZDict�dict�zip�keys�valuesZNameConstant�valueZUnaryOp�opZUAddZUSub�operandZBinOpZAddZSub�right�left�
ValueError�repr)�noder r"