# File lib/ruby2ruby.rb, line 768
  def process_rescue(exp)
    # TODO: rewrite this
    #
    # a = b rescue c            =>                [lasgn a [rescue b c]]
    # begin; a = b; rescue c    => [begin [rescue [lasgn a b] c]]

    current = self.context[1]
    case current
    when :begin, :ensure, :block then
      body = (exp.first.first == :resbody) ? nil : process(exp.shift)
      resbody = exp.empty? ? '' : process(exp.shift)
      els = exp.empty? ? nil : process(exp.shift)

      code = []
      code << indent(body) if body
      code << resbody
      if els then
        code << "else"
        code << indent(els)
      else
        unless [:block].include? current then
          code << "end\n" unless current == :ensure
        else
          r = [body, resbody.gsub(/rescue\n\s+/, 'rescue ')].compact.join(' ')
          code = [r] if (@indent+r).size < LINE_LENGTH and r !~ /\n/
        end
      end

      code.join("\n").chomp
    else # a rescue b and others
      body = process exp.shift
      assert_type exp.first, :resbody
      resbody = exp.shift
      resbody.shift # resbody
      resbody.shift # nil (no types for expression form)
      resbody = resbody.shift # actual code

      resbody = process resbody
      code = "#{body} rescue #{resbody}"
      case current
      when :hash then # HACK move to process_hash
        "(#{code})"
      else
        code
      end
    end
  end