Skip to content

Commit

Permalink
some progress?
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Feb 1, 2024
1 parent aff0a35 commit 7fe3265
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions src/Serialization/Upgrades/0.15.0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ push!(upgrade_scripts_set, UpgradeScript(
v"0.15.0",
function upgrade_0_15_0(s::UpgradeState, dict::Dict)

upgraded_dict = dict
upgraded_dict = dict #upgrade_data(upgrade_0_15_0, s, dict)

renamings = Dict{String,String}([
("FlintPadicField", "PadicField"),
Expand All @@ -31,18 +31,31 @@ push!(upgrade_scripts_set, UpgradeScript(
("EmbeddedElem", "EmbeddedNumFieldElem"),
])

if haskey(dict, :_type) && dict[:_type] isa String && haskey(renamings, dict[:_type])
upgraded_dict[:_type] = renamings[dict[:_type]]
function upgrade_type(d::String)
println(d)
return get(renamings, d, d)
end
if haskey(dict, :_type) &&
dict[:_type] isa Dict &&
haskey(dict[:_type], :name) &&
dict[:_type][:name] isa String &&
haskey(renamings, dict[:_type][:name])
upgraded_dict[:_type][:name] = renamings[dict[:_type][:name]]
function upgrade_type(d::Dict)
println(d)
upg_d = d
upg_d[:name] = get(renamings, d[:name], d[:name])
if d[:params] isa Dict && haskey(d[:params], :_type)
upg_d[:params][:_type] = upgrade_type(d[:params][:_type])
end
return upg_d
end

if haskey(dict, :_type)
upgraded_dict[:_type] = upgrade_type(dict[:_type])
end

# handle data upgrade (recurse on sub tree)

# # handle data upgrade (recurse on sub tree)
# for (k, v) in dict
# k == :_type && continue
# if v isa Dict
# upgraded_dict[k] = upgrade_0_15_0(s, v)
# elseif v isa

if haskey(dict, :data) && dict[:data] isa Dict
upgraded_dict[:data] = upgrade_0_15_0(s, dict[:data])
end
Expand Down

0 comments on commit 7fe3265

Please sign in to comment.