parameters: (build_directory, stdout)
return_statement: return edits
docstring: Extracts generated list of edits from the tool's stdout.
  
    The expected format is documented at the top of this file.
  
    Args:
      build_directory: Directory that contains the compile database. Used to
        normalize the filenames.
      stdout: The stdout from running the clang tool.
  
    Returns:
      A dictionary mapping filenames to the associated edits.
docstring_summary: Extracts generated list of edits from the tool's stdout.
docstring_tokens: Extracts generated list of edits from the tool s stdout .
function: def _ExtractEditsFromStdout(build_directory, stdout):
    """Extracts generated list of edits from the tool's stdout.
  
    The expected format is documented at the top of this file.
  
    Args:
      build_directory: Directory that contains the compile database. Used to
        normalize the filenames.
      stdout: The stdout from running the clang tool.
  
    Returns:
      A dictionary mapping filenames to the associated edits.
    """
    lines = stdout.splitlines()
    start_index = lines.index('==== BEGIN EDITS ====')
    end_index = lines.index('==== END EDITS ====')
    edits = collections.defaultdict(list)
    for line in lines[start_index + 1:end_index]:
      try:
        edit_type, path, offset, length, replacement = line.split(':::', 4)
        replacement = replacement.replace('\0', '\n')
        # Normalize the file path emitted by the clang tool.
        path = os.path.realpath(os.path.join(build_directory, path))
        edits[path].append(Edit(edit_type, int(offset), int(length), replacement))
      except ValueError:
        print 'Unable to parse edit: %s' % line
    return edits
function_tokens: def _ExtractEditsFromStdout ( build_directory , stdout ) : lines = stdout . splitlines ( ) start_index = lines . index ( '==== BEGIN EDITS ====' ) end_index = lines . index ( '==== END EDITS ====' ) edits = collections . defaultdict ( list ) for line in lines [ start_index + 1 : end_index ] : try : edit_type , path , offset , length , replacement = line . split ( ':::' , 4 ) replacement = replacement . replace ( '\0' , '\n' ) # Normalize the file path emitted by the clang tool. path = os . path . realpath ( os . path . join ( build_directory , path ) ) edits [ path ] . append ( Edit ( edit_type , int ( offset ) , int ( length ) , replacement ) ) except ValueError : print 'Unable to parse edit: %s' % line return edits