From 00a588adb1b7f38d6670a96a1f44de09c440e09c Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 18 Nov 2021 14:24:39 +0100 Subject: Make a minor fix to the deserializer --- src/CfimOfJson.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CfimOfJson.ml b/src/CfimOfJson.ml index 75d5de06..9ee202ba 100644 --- a/src/CfimOfJson.ml +++ b/src/CfimOfJson.ml @@ -103,7 +103,7 @@ let region_var_of_json (js : json) : (region_var, string) result = let region_of_json (js : json) : (RegionVarId.id region, string) result = combine_error_msgs js "region_of_json" (match js with - | `Assoc [ ("Static", `List []) ] -> Ok Static (* TODO *) + | `String "Static" -> Ok Static (* TODO *) | `Assoc [ ("Var", rid) ] -> let* rid = RegionVarId.id_of_json rid in Ok (Var rid) @@ -151,13 +151,13 @@ let rec ty_of_json (r_of_json : json -> ('r, string) result) (js : json) : | `Assoc [ ("TypeVar", `List [ id ]) ] -> let* id = TypeVarId.id_of_json id in Ok (TypeVar id) - | `Assoc [ ("Bool", `List []) ] -> Ok Bool (* TODO *) - | `Assoc [ ("Char", `List []) ] -> Ok Char (* TODO *) - | `Assoc [ ("`Never", `List []) ] -> Ok Never (* TODO *) + | `Assoc [ ("Bool", `List []) ] -> Ok Bool + | `Assoc [ ("Char", `List []) ] -> Ok Char + | `Assoc [ ("`Never", `List []) ] -> Ok Never | `Assoc [ ("Integer", `List [ int_ty ]) ] -> let* int_ty = integer_type_of_json int_ty in Ok (Integer int_ty) - | `Assoc [ ("Str", `List []) ] -> Ok Str (* TODO *) + | `Assoc [ ("Str", `List []) ] -> Ok Str | `Assoc [ ("Array", `List [ ty ]) ] -> let* ty = ty_of_json r_of_json ty in Ok (Array ty) @@ -560,7 +560,7 @@ let statement_of_json (js : json) : (statement, string) result = | `Assoc [ ("Call", call) ] -> let* call = call_of_json call in Ok (Call call) - | `String "Panic" -> Ok Panic (* TODO *) + | `String "Panic" -> Ok Panic | `String "Return" -> Ok Return | `Assoc [ ("Break", i) ] -> let* i = int_of_json i in -- cgit v1.2.3