Skip to content

Commit

Permalink
slightly improve inferrability of TOML parser (#37813)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Oct 1, 2020
1 parent 0d52973 commit 2f6508d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/toml_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,15 @@ end

function recurse_dict!(l::Parser, d::Dict, dotted_keys::AbstractVector{String}, check=true)::Err{TOMLDict}
for i in 1:length(dotted_keys)
d::TOMLDict
key = dotted_keys[i]
d = get!(TOMLDict, d, key)
if d isa Vector
d = d[end]
end
check && @try check_allowed_add_key(l, d, i == length(dotted_keys))
end
return d
return d::TOMLDict
end

function check_allowed_add_key(l::Parser, d, check_defined=true)::Err{Nothing}
Expand Down

0 comments on commit 2f6508d

Please sign in to comment.