class RDoc::Markup::Parser

def build_verbatim margin

def build_verbatim margin
  p :verbatim_begin => margin if @debug
  verbatim = RDoc::Markup::Verbatim.new
  until @tokens.empty? do
    type, data, column, = get
    case type
    when :INDENT then
      if margin >= data then
        unget
        break
      end
      indent = data - margin
      verbatim << ' ' * indent
    when :HEADER then
      verbatim << '=' * data
      _, _, peek_column, = peek_token
      peek_column ||= column + data
      verbatim << ' ' * (peek_column - column - data)
    when :RULE then
      width = 2 + data
      verbatim << '-' * width
      _, _, peek_column, = peek_token
      peek_column ||= column + data + 2
      verbatim << ' ' * (peek_column - column - width)
    when :TEXT then
      verbatim << data
    when *LIST_TOKENS then
      if column <= margin then
        unget
        break
      end
      list_marker = case type
                    when :BULLET                   then '*'
                    when :LABEL                    then "[#{data}]"
                    when :LALPHA, :NUMBER, :UALPHA then "#{data}."
                    when :NOTE                     then "#{data}::"
                    end
      verbatim << list_marker
      _, data, = get
      verbatim << ' ' * (data - list_marker.length)
    when :NEWLINE then
      verbatim << data
      break unless [:INDENT, :NEWLINE].include? peek_token[0]
    else
      unget
      break
    end
  end
  verbatim.normalize
  p :verbatim_end => margin if @debug
  verbatim
end