#NEWLINE# def action_semi( self , expanded , depth ) : #NEWLINE# #INDENT# semi = [ ] #NEWLINE# for exp in expanded : #NEWLINE# #INDENT# q = exp . rstrip ( ) #NEWLINE# if ( q and ( exp [ ( - 1 ) ] == ';' ) ) : #NEWLINE# #INDENT# semi . append ( exp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( q and ( q [ ( - 1 ) ] == '}' ) ) : #NEWLINE# #INDENT# ( last_line , _ , _ ) = q . rpartition ( '\n' ) #NEWLINE# if last_line . strip ( ) : #NEWLINE# #INDENT# semi . append ( exp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# semi . append ( ( q + ';' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# semi . append ( ( q + ';' ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return '\n' . join ( semi )