Lines Matching defs:ast
137 import ast
1024 class _ClassFinder(ast.NodeVisitor):
1089 tree = ast.parse(source)
2186 module = ast.parse(program)
2190 if not isinstance(module, ast.Module):
2208 assert isinstance(node, ast.arg)
2223 return ast.Constant(value)
2226 class RewriteSymbolics(ast.NodeTransformer):
2230 while isinstance(n, ast.Attribute):
2233 if not isinstance(n, ast.Name):
2240 if not isinstance(node.ctx, ast.Load):
2249 if not isinstance(left, ast.Constant) or not isinstance(right, ast.Constant):
2251 if isinstance(node.op, ast.Add):
2252 return ast.Constant(left.value + right.value)
2253 elif isinstance(node.op, ast.Sub):
2254 return ast.Constant(left.value - right.value)
2255 elif isinstance(node.op, ast.BitOr):
2256 return ast.Constant(left.value | right.value)
2264 default = ast.literal_eval(default_node)