Skip to content

Commit

Permalink
dicttype
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Aug 8, 2024
1 parent 67bd1e4 commit 36c2c78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scripts/diff.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import YAML
import OrderedCollections

if length(ARGS) != 3
println("Usage: madsjl.jl diff file1.mads file2.mads")
Expand Down Expand Up @@ -60,7 +61,7 @@ function printdiff(prefix, thing1, thing2, depth)
end
end

f1 = YAML.load_file(ARGS[2])
f2 = YAML.load_file(ARGS[3])
f1 = YAML.load_file(ARGS[2]; dicttype=OrderedCollections.OrderedDict{String,Any})
f2 = YAML.load_file(ARGS[3]; dicttype=OrderedCollections.OrderedDict{String,Any})

printdiff("", f1, f2, 6)
2 changes: 1 addition & 1 deletion src/MadsIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function loadbigyamlfile(filename::AbstractString)
end
if yamlflag
io = IOBuffer(join(lines[parseindeces], '\n'))
madsdata = YAML.load(io)
madsdata = YAML.load(io; dicttype=OrderedCollections.OrderedDict{String,Any})
else
madsdata = OrderedCollections.OrderedDict{String,Any}()
end
Expand Down
2 changes: 1 addition & 1 deletion src/MadsYAML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Returns:
- data in the yaml input file
"""
function loadyamlfile(filename::AbstractString)
yamldata = YAML.load_file(filename)
yamldata = YAML.load_file(filename; dicttype=OrderedCollections.OrderedDict{String,Any})
return yamldata
end

Expand Down

0 comments on commit 36c2c78

Please sign in to comment.