Exemple #1
0
 def VisitIfThenElse(self, o, **kwargs):
     new = ast.IfThenElse(
         predicate=o.predicate,
         if_true_ast=o.if_true_ast,
         if_false_ast=o.if_false_ast,
     )
     return copy_std(
         o,
         new,
     )
 def VisitIfThenElse(self, o, **kwargs):
     return ast.IfThenElse(
         predicate=self.visit(o.predicate, **kwargs),
         if_true_ast=self.visit(o.if_true_ast, **kwargs),
         if_false_ast=self.visit(o.if_false_ast, **kwargs),
     )
def p_rhs_term_conditional(p):
    """rhs_term : LSQUAREBRACKET rhs_generic RSQUAREBRACKET IF LSQUAREBRACKET bool_term RSQUAREBRACKET ELSE LSQUAREBRACKET rhs_generic RSQUAREBRACKET"""
    p[0] = ast.IfThenElse(  predicate=p[6],
                        if_true_ast=p[2],
                        if_false_ast=p[10])