#NEWLINE# def FIfElse( self , node , if_ , cond , expr_or_assign1 , else_ , expr_or_assign2 ) : #NEWLINE# #INDENT# def ArmHasType( expr_or_assign , types ) : #NEWLINE# #INDENT# return ( ( expr_or_assign . expr1 is None ) and expr_or_assign . expr2 . HasTypeIn ( types ) ) #NEWLINE# #UNINDENT# line_block = LB ( ( self . prefix_as_list + [ if_ , TBSP , cond ] ) ) #NEWLINE# b1 = ArmHasType ( node . expr_or_assign1 , ( 'Brace' , ) ) #NEWLINE# b2 = ArmHasType ( node . expr_or_assign2 , ( 'Brace' , ) ) #NEWLINE# if2 = ArmHasType ( node . expr_or_assign2 , ( 'If' , 'IfElse' ) ) #NEWLINE# if b1 : #NEWLINE# #INDENT# ( lbrace_if , exprlist_if , rbrace_if ) = self . FormatFields ( node . expr_or_assign1 . expr2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if _options . force_brace : #NEWLINE# #INDENT# b1 = True #NEWLINE# ( lbrace_if , exprlist_if , rbrace_if ) = ( TB ( '{' ) , [ expr_or_assign1 ] , TB ( '}' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if b2 : #NEWLINE# #INDENT# ( lbrace_else , exprlist_else , rbrace_else ) = self . FormatFields ( node . expr_or_assign2 . expr2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if _options . force_brace : #NEWLINE# #INDENT# b2 = True #NEWLINE# ( lbrace_else , exprlist_else , rbrace_else ) = ( TB ( '{' ) , [ expr_or_assign2 ] , TB ( '}' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if b1 : #NEWLINE# #INDENT# if b2 : #NEWLINE# #INDENT# return SB ( [ LB ( [ line_block , TBSP , lbrace_if ] ) , IB ( SB ( exprlist_if ) ) , LB ( [ rbrace_if , TBSP , else_ , TBSP , lbrace_else ] ) , IB ( SB ( exprlist_else ) ) , rbrace_else ] , break_mult = _options . adj_flow ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if if2 : #NEWLINE# #INDENT# return SB ( [ LB ( [ line_block , TBSP , lbrace_if ] ) , IB ( SB ( exprlist_if ) ) , self . ReformatWithPrefix ( node . expr_or_assign2 . expr2 , LB ( [ rbrace_if , TBSP , else_ , TBSP ] ) ) ] , break_mult = _options . adj_flow ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return SB ( [ LB ( [ line_block , TBSP , lbrace_if ] ) , IB ( SB ( exprlist_if ) ) , LB ( [ rbrace_if , TBSP , else_ ] ) , IB ( expr_or_assign2 ) ] , break_mult = _options . adj_flow ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if b2 : #NEWLINE# #INDENT# return SB ( [ line_block , IB ( expr_or_assign1 ) , LB ( [ else_ , TBSP , lbrace_else ] ) , IB ( SB ( exprlist_else ) ) , rbrace_else ] , break_mult = _options . adj_flow ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if if2 : #NEWLINE# #INDENT# return SB ( [ line_block , IB ( expr_or_assign1 ) , self . ReformatWithPrefix ( node . expr_or_assign2 . expr2 , LB ( [ else_ , TBSP ] ) ) ] , break_mult = _options . adj_flow ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return CB ( [ LB ( [ line_block , TBSP , expr_or_assign1 , TBSP , else_ , TBSP , expr_or_assign2 ] ) , SB ( [ line_block , IB ( expr_or_assign1 ) , else_ , IB ( expr_or_assign2 ) ] ) ] )