def process_resbody(exp)
code = []
sexp = exp
until exp.empty? and (sexp.nil? or sexp.empty?)
list = sexp.shift
body = sexp.shift
var = if list and
list.size > 1 and
[:lasgn, :dasgn, :dasgn_curr].include? list.last.first then
list.pop[1]
else
nil
end
var = body.delete_at(1)[1] if
[:dasgn_curr, :dasgn].include? body[1][0] unless
var or body.nil? rescue nil
if list and list.size > 1 then
list[0] = :arglist
code << "rescue #{process(list)}"
else
code << "rescue"
end
code.last << " => #{var}" if var
if body then
code << indent(process(body)).chomp
else
code << indent("# do nothing")
end
unless exp.empty? then
sexp = exp.shift
assert_type sexp, :resbody
sexp.shift
end
end
code.join("\n")
end