summaryrefslogtreecommitdiff
path: root/src/LlbcOfJson.ml
diff options
context:
space:
mode:
authorSidney Congard2022-06-23 15:43:49 +0200
committerSidney Congard2022-06-23 15:43:49 +0200
commitda118da3e590fbea4e880121837da2ee938837f6 (patch)
tree8a02fe42c66363a8761eced685504a42a357aa94 /src/LlbcOfJson.ml
parent7703c4ca86a390303d0a120f8811c8fd704c5168 (diff)
adapt to new LLBC (without OperandConstantValue)
Diffstat (limited to 'src/LlbcOfJson.ml')
-rw-r--r--src/LlbcOfJson.ml30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/LlbcOfJson.ml b/src/LlbcOfJson.ml
index a074ed1e..3ff45077 100644
--- a/src/LlbcOfJson.ml
+++ b/src/LlbcOfJson.ml
@@ -381,24 +381,18 @@ let binop_of_json (js : json) : (E.binop, string) result =
let constant_value_of_json (js : json) : (V.constant_value, string) result =
combine_error_msgs js "constant_value_of_json"
(match js with
- (* This indirection is because Charon still export the type OperandConstantValue,
- * which had other variants than ConstantValue before.
- *)
- | `Assoc [ ("ConstantValue", `List [ cv ]) ] ->
- (match cv with
- | `Assoc [ ("Scalar", scalar_value) ] ->
- let* scalar_value = scalar_value_of_json scalar_value in
- Ok (V.Scalar scalar_value)
- | `Assoc [ ("Bool", v) ] ->
- let* v = bool_of_json v in
- Ok (V.Bool v)
- | `Assoc [ ("Char", v) ] ->
- let* v = char_of_json v in
- Ok (V.Char v)
- | `Assoc [ ("String", v) ] ->
- let* v = string_of_json v in
- Ok (V.String v)
- | _ -> Error "")
+ | `Assoc [ ("Scalar", scalar_value) ] ->
+ let* scalar_value = scalar_value_of_json scalar_value in
+ Ok (V.Scalar scalar_value)
+ | `Assoc [ ("Bool", v) ] ->
+ let* v = bool_of_json v in
+ Ok (V.Bool v)
+ | `Assoc [ ("Char", v) ] ->
+ let* v = char_of_json v in
+ Ok (V.Char v)
+ | `Assoc [ ("String", v) ] ->
+ let* v = string_of_json v in
+ Ok (V.String v)
| _ -> Error "")
let operand_of_json (js : json) : (E.operand, string) result =