def to_entry(name, rest): if isinstance(rest, list): return Entry(name=name.value, children=rest, lineno=name.lineno, src=ctx) return Entry(name=name.value, attrs=[rest], lineno=name.lineno, src=ctx)