#NEWLINE# def transform_If( self , stmt ) : #NEWLINE# #INDENT# cond = stmt . cond #NEWLINE# stmt . merge = self . transform_merge ( stmt . merge ) #NEWLINE# stmt . true = self . transform_block ( stmt . true ) #NEWLINE# stmt . false = self . transform_block ( stmt . false ) #NEWLINE# if ( ( len ( stmt . merge ) == 0 ) and ( len ( stmt . true ) == 0 ) and ( len ( stmt . false ) == 0 ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if syntax . helpers . is_true ( cond ) : #NEWLINE# #INDENT# for ( name , ( v , _ ) ) in stmt . merge . iteritems ( ) : #NEWLINE# #INDENT# self . assign ( Var ( name , type = v . type ) , v ) #NEWLINE# #UNINDENT# self . blocks . extend_current ( reversed ( stmt . true ) ) #NEWLINE# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if syntax . helpers . is_false ( self ) : #NEWLINE# #INDENT# for ( name , ( _ , v ) ) in stmt . merge . items ( ) : #NEWLINE# #INDENT# self . assign ( Var ( name , type = v . type ) , v ) #NEWLINE# #UNINDENT# self . blocks . extend_current ( reversed ( stmt . false ) ) #NEWLINE# return None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return stmt