def compile(self) -> CompiledSegment: cs = CompiledSegment() cs.indent() for c in self: cs.append(c.compile()) cs.dedent() return cs
def compile(self): cs = CompiledSegment() cs.append("class {}({}):".format(self.value, self.parent.compile())) cs.indent() # TODO: Move as appropriate to __init__ cs.append(self.body.compile()) return cs