def visitWith_stmt(self, ctx: MPParser.With_stmtContext): return [ With([ vardecl for varlist in ctx.variable() for vardecl in self.visit(varlist) ], self.visit(ctx.statement())) ]
def visitWith_stmt(self, ctx: MPParser.With_stmtContext): varDeclList = [] for x in ctx.ids_list_with_type(): varDeclList.extend(self.visitIds_list_with_type(x)) stmt = self.visit(ctx.stmt()) if not isinstance(stmt, list): stmt = [stmt] return With([VarDecl(id, dataType) for (id, dataType) in varDeclList], stmt)
def visitWith_stmt(self, ctx: MPParser.With_stmtContext): return With(self.visit(ctx.var_dec_list()), self.visit(ctx.stmt()))
def visitWith_stmt(self, ctx: MPParser.With_stmtContext): if ctx.stmt().compound_stmt() is None: with_body = [self.visit(ctx.stmt())] else: with_body = self.visit(ctx.stmt()) return With([self.visit(ctx.var_decl_list())], with_body)