diff options
author | Son Ho | 2021-11-18 14:33:45 +0100 |
---|---|---|
committer | Son Ho | 2021-11-18 14:33:45 +0100 |
commit | 8bd41664db7fbbe2d4df47ee20f21de712fa01d0 (patch) | |
tree | 110c1a08275ae07b199941b6c26456d8c8dd545b | |
parent | 00a588adb1b7f38d6670a96a1f44de09c440e09c (diff) |
Make various modifications to the deserializer
Diffstat (limited to '')
-rw-r--r-- | src/CfimOfJson.ml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/CfimOfJson.ml b/src/CfimOfJson.ml index 9ee202ba..b60c2247 100644 --- a/src/CfimOfJson.ml +++ b/src/CfimOfJson.ml @@ -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 - | `Assoc [ ("Char", `List []) ] -> Ok Char - | `Assoc [ ("`Never", `List []) ] -> Ok Never + | `String "Bool" -> Ok Bool + | `String "Char" -> Ok Char + | `String "`Never" -> 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 + | `String "Str" -> Ok Str | `Assoc [ ("Array", `List [ ty ]) ] -> let* ty = ty_of_json r_of_json ty in Ok (Array ty) @@ -400,7 +400,7 @@ let operand_constant_value_of_json (js : json) : | `Assoc [ ("ConstantAdt", id) ] -> let* id = TypeDefId.id_of_json id in Ok (ConstantAdt id) - | `Assoc [ ("Unit", `List []) ] -> Ok Unit + | `String "Unit" -> Ok Unit | _ -> Error "") let operand_of_json (js : json) : (operand, string) result = @@ -421,7 +421,7 @@ let operand_of_json (js : json) : (operand, string) result = let aggregate_kind_of_json (js : json) : (aggregate_kind, string) result = combine_error_msgs js "operand_kind_of_json" (match js with - | `Assoc [ ("AggregatedTuple", `List []) ] -> Ok AggregatedTuple + | `String "AggregatedTuple" -> Ok AggregatedTuple | `Assoc [ ("AggregatedAdt", `List [ id; opt_variant_id ]) ] -> let* id = TypeDefId.id_of_json id in let* opt_variant_id = |