Project

General

Profile

Feature #12960 » 0005-feat-psych-add-hook-points-for-merge.patch

kwatch (makoto kuwata), 11/19/2016 03:21 AM

View differences:

ext/psych/lib/psych/visitors/to_ruby.rb
case v
when Nodes::Alias, Nodes::Mapping
begin
hash.merge! val
merge_mapping(hash, val)
rescue TypeError
hash[key] = val
end
when Nodes::Sequence
begin
h = {}
val.reverse_each do |value|
h.merge! value
end
hash.merge! h
merge_sequence(hash, val)
rescue TypeError
hash[key] = val
end
......
hash
end
def merge_mapping hash, val
hash.merge! val
end
def merge_sequence hash, val
h = {}
val.reverse_each do |value|
h.merge! value
end
hash.merge! h
end
def merge_key hash, key, val
end
(5-5/10)