Feature #12960 » 0005-feat-psych-add-hook-points-for-merge.patch
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
|
||