parameters: (file_lines, line_range)
docstring: Deletes extraneous blank lines caused by line deletion.
  
    Here's a example file:
       class Foo { ... };
  
       class Bar;
  
       class Baz { ... }
  
    If we delete the "class Bar;" line, we also want to delete one of
    the blank lines around it, otherwise we leave two blank lines
    between Foo and Baz which looks bad.  The idea is that if we have
    whitespace on both sides of a deleted span of code, the whitespace
    on one of the sides is 'extraneous'.  In this case, we should delete
    not only 'class Bar;' but also the whitespace line below it.  That
    leaves one blank line between Foo and Bar, like people would expect.
  
    We're careful to only delete the minimum of the number of blank
    lines that show up on either side.  If 'class Bar' had one blank
    line before it, and one hundred after it, we'd only delete one blank
    line when we delete 'class Bar'.  This matches user's expecatations.
  
    The situation can get tricky when two deleted spans touch (we might
    think it's safe to delete the whitespace between them when it's
    not).  To be safe, we only do this check when an entire reorder-span
    has been deleted.  So we check the given line_range, and only do
    blank-line deletion if every line in the range is deleted.
  
    Arguments:
      file_lines: an array of LineInfo objects, with .type filled in.
      line_range: a range [start_line, end_line).  It should correspond
         to a reorder-span.
docstring_summary: Deletes extraneous blank lines caused by line deletion.
docstring_tokens: Deletes extraneous blank lines caused by line deletion .
function: def _DeleteExtraneousBlankLines(file_lines, line_range):
    """Deletes extraneous blank lines caused by line deletion.
  
    Here's a example file:
       class Foo { ... };
  
       class Bar;
  
       class Baz { ... }
  
    If we delete the "class Bar;" line, we also want to delete one of
    the blank lines around it, otherwise we leave two blank lines
    between Foo and Baz which looks bad.  The idea is that if we have
    whitespace on both sides of a deleted span of code, the whitespace
    on one of the sides is 'extraneous'.  In this case, we should delete
    not only 'class Bar;' but also the whitespace line below it.  That
    leaves one blank line between Foo and Bar, like people would expect.
  
    We're careful to only delete the minimum of the number of blank
    lines that show up on either side.  If 'class Bar' had one blank
    line before it, and one hundred after it, we'd only delete one blank
    line when we delete 'class Bar'.  This matches user's expecatations.
  
    The situation can get tricky when two deleted spans touch (we might
    think it's safe to delete the whitespace between them when it's
    not).  To be safe, we only do this check when an entire reorder-span
    has been deleted.  So we check the given line_range, and only do
    blank-line deletion if every line in the range is deleted.
  
    Arguments:
      file_lines: an array of LineInfo objects, with .type filled in.
      line_range: a range [start_line, end_line).  It should correspond
         to a reorder-span.
    """
    # First make sure the entire span is deleted.
    for line_number in range(*line_range):
      if not file_lines[line_number].deleted:
        return
  
    before_line = _PreviousNondeletedLine(file_lines, line_range[0])
    after_line = _NextNondeletedLine(file_lines, line_range[1] - 1)
    while (before_line and file_lines[before_line].type == _BLANK_LINE_RE and
           after_line and file_lines[after_line].type == _BLANK_LINE_RE):
      # OK, we've got whitespace on both sides of a deleted span.  We
      # only want to keep whitespace on one side, so delete on the other.
      file_lines[after_line].deleted = True
      before_line = _PreviousNondeletedLine(file_lines, before_line)
      after_line = _NextNondeletedLine(file_lines, after_line)
function_tokens: def _DeleteExtraneousBlankLines ( file_lines , line_range ) : # First make sure the entire span is deleted. for line_number in range ( * line_range ) : if not file_lines [ line_number ] . deleted : return before_line = _PreviousNondeletedLine ( file_lines , line_range [ 0 ] ) after_line = _NextNondeletedLine ( file_lines , line_range [ 1 ] - 1 ) while ( before_line and file_lines [ before_line ] . type == _BLANK_LINE_RE and after_line and file_lines [ after_line ] . type == _BLANK_LINE_RE ) : # OK, we've got whitespace on both sides of a deleted span.  We # only want to keep whitespace on one side, so delete on the other. file_lines [ after_line ] . deleted = True before_line = _PreviousNondeletedLine ( file_lines , before_line ) after_line = _NextNondeletedLine ( file_lines , after_line )