#NEWLINE# def visit_If( self , node ) : #NEWLINE# #INDENT# out = [ ] #NEWLINE# out . append ( ( 'if %s then' % self . visit ( node . test ) ) ) #NEWLINE# self . push ( ) #NEWLINE# for line in list ( map ( self . visit , node . body ) ) : #NEWLINE# #INDENT# out . append ( ( self . indent ( ) + line ) ) #NEWLINE# #UNINDENT# orelse = [ ] #NEWLINE# for line in list ( map ( self . visit , node . orelse ) ) : #NEWLINE# #INDENT# orelse . append ( ( self . indent ( ) + line ) ) #NEWLINE# #UNINDENT# self . pull ( ) #NEWLINE# if orelse : #NEWLINE# #INDENT# out . append ( ( self . indent ( ) + 'else' ) ) #NEWLINE# out . extend ( orelse ) #NEWLINE# #UNINDENT# out . append ( ( self . indent ( ) + 'end' ) ) #NEWLINE# return '\n' . join ( out )