def loop(self, ast): if isinstance(ast.c, pi.Cmd): return pi.Loop(ast.e, ast.c) else: cmd = ast.c[0] for i in range(1, len(ast.c)): cmd = pi.CSeq(cmd, ast.c[i]) return pi.Loop(ast.e, cmd)
def loop(self, ast): return pi.Loop(ast.t, ast.b)