def process_masgn(exp)
lhs = exp.shift
rhs = exp.empty? ? nil : exp.shift
unless exp.empty? then
rhs[-1] = splat(rhs[-1]) unless rhs == s(:splat)
lhs << rhs
rhs = exp.shift
end
case lhs.first
when :array then
lhs.shift
lhs = lhs.map do |l|
case l.first
when :masgn then
"(#{process(l)})"
else
process(l)
end
end
when :dasgn_curr then
lhs = [ splat(lhs.last) ]
when :splat then
lhs = [ "*""*" ]
else
raise "no clue: #{lhs.inspect}"
end
if context[1] == :iter and rhs then
lhs << splat(rhs.last)
rhs = nil
end
unless rhs.nil? then
t = rhs.first
rhs = if t == :argscat then
rhs.shift
process_argscat(rhs)
else
r = process(rhs)
r = r[1..-2] if t != :to_ary
r
end
return "#{lhs.join(", ")} = #{rhs}"
else
return lhs.join(", ")
end
end