Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
647eace0
Commit
647eace0
authored
1 year ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[libs] fixes Yojson 2.1 support
parent
cc2897c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libraries/utils/json.mll
+4
-6
4 additions, 6 deletions
src/libraries/utils/json.mll
with
4 additions
and
6 deletions
src/libraries/utils/json.mll
+
4
−
6
View file @
647eace0
...
...
@@ -334,7 +334,6 @@ let rec merge_assoc_lists la lb =
List
.
rev
r
let
merge_object
path
json_root_obj
=
let
open
Yojson
.
Basic
.
Util
in
let
existing_root_obj
=
try
match
Hashtbl
.
find
json_tbl
path
with
...
...
@@ -343,14 +342,13 @@ let merge_object path json_root_obj =
with
Not_found
->
`Assoc
[]
in
let
existing_assoc
=
existing_root_obj
|>
to_assoc
in
let
new_assoc
=
json_root_obj
|>
to_assoc
in
let
existing_assoc
=
existing_root_obj
|>
Yojson
.
Basic
.
Util
.
to_assoc
in
let
new_assoc
=
json_root_obj
|>
Yojson
.
Basic
.
Util
.
to_assoc
in
let
merged
=
merge_assoc_lists
existing_assoc
new_assoc
in
let
merged_obj
=
`Assoc
merged
in
Hashtbl
.
replace
json_tbl
path
merged_obj
let
merge_array
path
json_root_array
=
let
open
Yojson
.
Basic
.
Util
in
let
existing_root_array
=
try
match
Hashtbl
.
find
json_tbl
path
with
...
...
@@ -359,8 +357,8 @@ let merge_array path json_root_array =
with
Not_found
->
`List
[]
in
let
existing_list
=
existing_root_array
|>
to_list
in
let
new_list
=
json_root_array
|>
to_list
in
let
existing_list
=
existing_root_array
|>
Yojson
.
Basic
.
Util
.
to_list
in
let
new_list
=
json_root_array
|>
Yojson
.
Basic
.
Util
.
to_list
in
let
merged_list
=
`List
(
existing_list
@
new_list
)
in
Hashtbl
.
replace
json_tbl
path
merged_list
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment