summaryrefslogtreecommitdiff
path: root/src/CfimOfJson.ml
diff options
context:
space:
mode:
authorJonathan Protzenko2022-01-06 10:12:44 -0800
committerJonathan Protzenko2022-01-06 10:12:44 -0800
commitc3c1d91a976fdac52830239adb6429f09ea888a8 (patch)
tree15205f3a6356ad80effdc8b48641fff23a89466c /src/CfimOfJson.ml
parent9872966d3c7a97ce8cd9ef16ab934ffa09c23e13 (diff)
parenta310c6036568d8f62e09804c67064686d106afd4 (diff)
Merge remote-tracking branch 'refs/remotes/origin/main'
Diffstat (limited to '')
-rw-r--r--src/CfimOfJson.ml18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/CfimOfJson.ml b/src/CfimOfJson.ml
index 3494f004..a1dd0ad1 100644
--- a/src/CfimOfJson.ml
+++ b/src/CfimOfJson.ml
@@ -436,6 +436,21 @@ let assertion_of_json (js : json) : (A.assertion, string) result =
Ok { A.cond; expected }
| _ -> Error "")
+let region_var_group_of_json (js : json) : (A.region_var_group, string) result =
+ combine_error_msgs js "region_var_group_of_json"
+ (match js with
+ | `Assoc [ ("id", id); ("regions", regions); ("parents", parents) ] ->
+ let* id = A.RegionGroupId.id_of_json id in
+ let* regions = list_of_json T.RegionVarId.id_of_json regions in
+ let* parents = list_of_json A.RegionGroupId.id_of_json parents in
+ Ok { A.id; regions; parents }
+ | _ -> Error "")
+
+let region_var_groups_of_json (js : json) : (A.region_var_groups, string) result
+ =
+ combine_error_msgs js "region_var_group_of_json"
+ (list_of_json region_var_group_of_json js)
+
let fun_sig_of_json (js : json) : (A.fun_sig, string) result =
combine_error_msgs js "fun_sig_of_json"
(match js with
@@ -443,12 +458,14 @@ let fun_sig_of_json (js : json) : (A.fun_sig, string) result =
[
("region_params", region_params);
("num_early_bound_regions", num_early_bound_regions);
+ ("regions_hierarchy", regions_hierarchy);
("type_params", type_params);
("inputs", inputs);
("output", output);
] ->
let* region_params = list_of_json region_var_of_json region_params in
let* num_early_bound_regions = int_of_json num_early_bound_regions in
+ let* regions_hierarchy = region_var_groups_of_json regions_hierarchy in
let* type_params = list_of_json type_var_of_json type_params in
let* inputs = list_of_json sty_of_json inputs in
let* output = sty_of_json output in
@@ -456,6 +473,7 @@ let fun_sig_of_json (js : json) : (A.fun_sig, string) result =
{
A.region_params;
num_early_bound_regions;
+ regions_hierarchy;
type_params;
inputs;
output;