def balance(scanner, start, finish, count = 0)
      str = ''
      scanner = Sass::Util::MultibyteStringScanner.new(scanner) unless scanner.is_a? StringScanner
      regexp = Regexp.new("(.*?)[\\#{start.chr}\\#{finish.chr}]", Regexp::MULTILINE)
      while scanner.scan(regexp)
        str << scanner.matched
        count += 1 if scanner.matched[-1] == start
        count -= 1 if scanner.matched[-1] == finish
        return [str, scanner.rest] if count == 0
      end
    end
def balance(scanner, start, finish, count = 0)
      str = ''
      scanner = Sass::Util::MultibyteStringScanner.new(scanner) unless scanner.is_a? StringScanner
      regexp = Regexp.new("(.*?)[\\#{start.chr}\\#{finish.chr}]", Regexp::MULTILINE)
      while scanner.scan(regexp)
        str << scanner.matched
        count += 1 if scanner.matched[-1] == start
        count -= 1 if scanner.matched[-1] == finish
        return [str, scanner.rest] if count == 0
      end
    end
Moves a scanner through a balanced pair of characters.
 For example:

     Foo (Bar (Baz bang) bop) (Bang (bop bip))
     ^                       ^
     from                    to

 @param scanner [StringScanner] The string scanner to move
 @param start [Character] The character opening the balanced pair.
   A `Fixnum` in 1.8, a `String` in 1.9
 @param finish [Character] The character closing the balanced pair.
   A `Fixnum` in 1.8, a `String` in 1.9
 @param count [Integer] The number of opening characters matched
   before calling this method
 @return [(String, String)] The string matched within the balanced pair
   and the rest of the string.
   `["Foo (Bar (Baz bang) bop)", " (Bang (bop bip))"]` in the example above.