Skip to content

Commit 511baff

Browse files
committed
Use TOML.Parser for TOML parsing w/ Dates support
This behavior had actually subtly changed with JuliaLang/julia#54755 so that this no longer returned Dates objects, but sticking to the public `TOML.Parser` interface should prevent that from being an issue after JuliaLang/julia#55020 lands.
1 parent 8c99679 commit 511baff

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Registry/registry_instance.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ function to_tar_path_format(file::AbstractString)
1515
end
1616

1717
# See loading.jl
18-
const TOML_CACHE = let parser = Base.TOML.Parser()
19-
parser.Dates = Dates
18+
const TOML_CACHE = let parser = TOML.Parser()
2019
Base.TOMLCache(parser, Dict{String, Dict{String, Any}}())
2120
end
2221
const TOML_LOCK = ReentrantLock()
@@ -26,9 +25,8 @@ function parsefile(in_memory_registry::Union{Dict, Nothing}, folder::AbstractStr
2625
return _parsefile(joinpath(folder, file))
2726
else
2827
content = in_memory_registry[to_tar_path_format(file)]
29-
parser = Base.TOML.Parser(content; filepath=file)
30-
parser.Dates = Dates
31-
return Base.TOML.parse(parser)
28+
parser = TOML.Parser(content; filepath=file)
29+
return TOML.Internals.parse(parser)
3230
end
3331
end
3432

src/Types.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ function deepcopy_toml(x::Dict{String, Any})
5353
end
5454

5555
# See loading.jl
56-
const TOML_CACHE = let parser = Base.TOML.Parser()
57-
parser.Dates = Dates
56+
const TOML_CACHE = let parser = TOML.Parser()
5857
Base.TOMLCache(parser, Dict{String, Dict{String, Any}}())
5958
end
6059
const TOML_LOCK = ReentrantLock()

0 commit comments

Comments
 (0)