def modifyWhileStmt(self, node): statements = ASTModifier.modifyWhileStmt(self, node) if len(statements) == 1: node = statements[0] try: value = evaluate_expression(node.condition) if value is False: return [] except ParseException: pass return [node] else: return flatten([self.modify(stmt) for stmt in statements])
def modifyWhileStmt(self, node): statements = ASTModifier.modifyWhileStmt(self, node) if len(statements) == 1: node = statements[0] try: value = evaluate_expression(node.condition) if value is False: return [] except ParseException: pass return [node] else: return flatten([self.modify(stmt) for stmt in statements])
def modifyWhileStmt(self, node): if self.pass_num == 2: node = ASTModifier.modifyWhileStmt(self, node)[0] node.statements = self.fixStatementList(node.statements) return [node]
def modifyWhileStmt(self, node): if self.pass_num == 2: node = ASTModifier.modifyWhileStmt(self, node)[0] node.statements = self.fixStatementList(node.statements) return [node]