def join_lines(lines_enum):
 primary_line_number = None
 new_line = []
 for (line_number, line) in lines_enum:
  if ((not line.endswith('\\')) or COMMENT_RE.match(line)):
   if COMMENT_RE.match(line):
    line = (' ' + line)
   if new_line:
    new_line.append(line)
    (yield (primary_line_number, ''.join(new_line)))
    new_line = []
   else:
    (yield (line_number, line))
  else:
   if (not new_line):
    primary_line_number = line_number
   new_line.append(line.strip('\\'))
 if new_line:
  (yield (primary_line_number, ''.join(new_line)))

def join_lines ( lines_enum ) : primary_line_number = None new_line = [ ] for ( line_number , line ) in lines_enum : if ( ( not line . endswith ( '\\' ) ) or COMMENT_RE . match ( line ) ) : if COMMENT_RE . match ( line ) : line = ( ' ' + line ) if new_line : new_line . append ( line ) ( yield ( primary_line_number , '' . join ( new_line ) ) ) new_line = [ ] else : ( yield ( line_number , line ) ) else : if ( not new_line ) : primary_line_number = line_number new_line . append ( line . strip ( '\\' ) ) if new_line : ( yield ( primary_line_number , '' . join ( new_line ) ) )
joins a line ending in with the previous line .