def ast2json()

in src/providers/helpers/ast2json.py [0:0]


def ast2json(node):
    assert isinstance(node, AST)
    to_return = {}
    to_return['_type'] = node.__class__.__name__
    for attr in dir(node):
        if attr.startswith("_"):
            continue
        to_return[attr] = get_value(getattr(node, attr))

    return to_return