def visitWith_statement(self,ctx:MPParser.With_statementContext): lstvar_decl = [] for x in ctx.var_decl(): lstvar_decl += self.visit(x) return [With(lstvar_decl,self.visit(ctx.statement()))]
def visitWith_statement(self, ctx: MPParser.With_statementContext): a = self.visit(ctx.list_var_declarations()) b = self.visit(ctx.statement()) return With(self.visit(ctx.list_var_declarations()), self.visit(ctx.statement()))
def visitWith_statement(self,ctx:MPParser.With_statementContext): return [With([seft.visit(x) for x in ctx.var_decl()],self.visit(ctx.statement()))]
def visitWith_statement(self, ctx: MPParser.With_statementContext): stmt = self.visit(ctx.statement()) withStmt = stmt if type(stmt) == list else [stmt] return With( reduce(lambda x, y: x + y, [self.visit(t) for t in ctx.parameter_declare()]), withStmt)