stable/hyper_parser.py
crypto_rahino df3c607e57 first
2021-03-20 18:46:56 +02:00

15 lines
375 B
Python

import ast
class HyperParser(ast.NodeTransformer):
def __init__(self, obj, *args, **kwargs):
super().__init__(*args, **kwargs)
self.obj = obj
@property
def class_def(self):
return [cl.body for cl in self.obj.body if isinstance(cl, ast.ClassDef)][0]
@property
def indicators(self):
return [ind for ind in self.class_def]