summaryrefslogtreecommitdiff
path: root/src/Values.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/Values.ml')
-rw-r--r--src/Values.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Values.ml b/src/Values.ml
index 992b43ea..ba5c7628 100644
--- a/src/Values.ml
+++ b/src/Values.ml
@@ -10,7 +10,7 @@ type var = {
(** The variable type - erased type, because variables are not used
** in function signatures *)
}
-[@@deriving of_yojson]
+[@@deriving yojson]
(** A variable *)
type big_int = Z.t
@@ -21,6 +21,8 @@ let big_int_of_yojson (json : Yojson.Safe.t) : (big_int, string) result =
| `Intlit is -> Ok (Z.of_string is)
| _ -> Error "not an integer or an integer literal"
+let big_int_to_yojson (i : big_int) = `Intlit (Z.to_string i)
+
(** A scalar value
Note that we use unbounded integers everywhere.
@@ -39,11 +41,11 @@ type scalar_value =
| U32 of big_int
| U64 of big_int
| U128 of big_int
-[@@deriving of_yojson]
+[@@deriving yojson]
type constant_value =
| Scalar of scalar_value
| Bool of bool
| Char of char
| String of string
-[@@deriving of_yojson]
+[@@deriving yojson]