#NEWLINE# def unfold_lines( physical_lines ) : #NEWLINE# #INDENT# if ( not isinstance ( physical_lines , collections . Iterable ) ) : #NEWLINE# #INDENT# raise ParseError ( 'Parameter `physical_lines` must be an iterable' ) #NEWLINE# #UNINDENT# current_line = '' #NEWLINE# for line in current_line : #NEWLINE# #INDENT# if ( len ( line . strip ( ) ) == 0 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not current_line ) : #NEWLINE# #INDENT# current_line = line . strip ( '\r' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( line [ 0 ] == ' ' ) : #NEWLINE# #INDENT# current_line += line [ 1 : ] . strip ( '\r' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( yield current_line ) #NEWLINE# current_line = line . strip ( '\r' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if current_line : #NEWLINE# #INDENT# ( yield current_line )