Skip to content

Commit

Permalink
Use DTParser for TOML parsing w/ Dates support
Browse files Browse the repository at this point in the history
  • Loading branch information
topolarity committed Jul 2, 2024
1 parent 8c99679 commit 1f3a4c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Registry/registry_instance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function to_tar_path_format(file::AbstractString)
end

# See loading.jl
const TOML_CACHE = let parser = Base.TOML.Parser()
parser.Dates = Dates
const TOML_CACHE = let parser = TOML.DTParser()
Base.TOMLCache(parser, Dict{String, Dict{String, Any}}())
end
const TOML_LOCK = ReentrantLock()
Expand All @@ -26,8 +25,7 @@ function parsefile(in_memory_registry::Union{Dict, Nothing}, folder::AbstractStr
return _parsefile(joinpath(folder, file))
else
content = in_memory_registry[to_tar_path_format(file)]
parser = Base.TOML.Parser(content; filepath=file)
parser.Dates = Dates
parser = TOML.DTParser(content; filepath=file)
return Base.TOML.parse(parser)
end
end
Expand Down

0 comments on commit 1f3a4c9

Please sign in to comment.