def process_masgn(exp)
lhs = exp.shift
rhs = exp.empty? ? nil : exp.shift
unless exp.empty? then
rhs[-1] = splat(rhs[-1])
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) ]
else
raise "no clue: #{lhs.inspect}"
end
unless rhs.nil? then
rhs = if rhs.shift == :argscat then
[process_argscat(rhs)]
else
rhs.map { |r| process(r) }
end
return "#{lhs.join(", ")} = #{rhs.join(", ")}"
else
return lhs.join(", ")
end
end