summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych/visitors')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index b5bec54af5..7f0ddff96c 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -187,8 +187,17 @@ module Psych
o.children.each_slice(2) { |k,v|
key = accept(k)
- if key == '<<' && Nodes::Alias === v
- hash.merge! accept(v)
+ if key == '<<'
+ case v
+ when Nodes::Alias
+ hash.merge! accept(v)
+ when Nodes::Sequence
+ accept(v).reverse_each do |value|
+ hash.merge! value
+ end
+ else
+ hash[key] = accept(v)
+ end
else
hash[key] = accept(v)
end