コード例 #1
0
 def modifySelectStmt(self, node):
     if self.pass_num == 2:
         node = ASTModifier.modifySelectStmt(self, node)[0]
         node.range_stmts_tuples = [
             (range, self.fixStatementList(statements))
             for (range, statements) in node.range_stmts_tuples
         ]
     return [node]
コード例 #2
0
 def modifySelectStmt(self, node):
     statements = ASTModifier.modifySelectStmt(self, node)
     if len(statements) == 1:
         node = statements[0]
         try:
             value = evaluate_expression(node.expression)
             if value is None:
                 return [node]
             for ((start, stop), stmts) in node.range_stmts_tuples:
                 start = evaluate_expression(start)
                 stop = evaluate_expression(stop)
                 if (stop is not None and start <= value <= stop) or (start == value):
                     return stmts
         except ParseException:
             pass
         return [node]
     else:
         return flatten([self.modify(stmt) for stmt in statements])
コード例 #3
0
 def modifySelectStmt(self, node):
     statements = ASTModifier.modifySelectStmt(self, node)
     if len(statements) == 1:
         node = statements[0]
         try:
             value = evaluate_expression(node.expression)
             if value is None:
                 return [node]
             for ((start, stop), stmts) in node.range_stmts_tuples:
                 start = evaluate_expression(start)
                 stop = evaluate_expression(stop)
                 if (stop is not None
                         and start <= value <= stop) or (start == value):
                     return stmts
         except ParseException:
             pass
         return [node]
     else:
         return flatten([self.modify(stmt) for stmt in statements])
コード例 #4
0
 def modifySelectStmt(self, node):
     if self.pass_num == 2:
         node = ASTModifier.modifySelectStmt(self, node)[0]
         node.range_stmts_tuples = [(range, self.fixStatementList(statements)) for (range, statements) in node.range_stmts_tuples]
     return [node]