    # File lib/yard/docstring.rb, line 157
        def summary
          return @summary if @summary
          open_parens = ['{', '(', '[']
          close_parens = ['}', ')', ']']
          num_parens = 0
          idx = length.times do |index|
            case self[index, 1]
            when ".", "\r", "\n"
              next_char = self[index + 1, 1].to_s
              if num_parens == 0 && next_char =~ /^\s*$/
                break index - 1
              end
            when "{", "(", "["
              num_parens += 1
            when "}", ")", "]"
              num_parens -= 1
            end
          end
          @summary = self[0..idx]
          @summary += '.' unless @summary.empty?
          @summary
        end