summaryrefslogtreecommitdiff
path: root/src/Expressions.ml
diff options
context:
space:
mode:
authorSon Ho2021-11-17 14:26:43 +0100
committerSon Ho2021-11-17 14:26:43 +0100
commit7c62043ab195ee9844d29ade76efdf839a2e98d0 (patch)
treeaa0aa45d5d11da055604fe7ec503a907bc47af82 /src/Expressions.ml
parent25fe1a81758bcf25171beee849467b2fff673b20 (diff)
Use [@@ëerive of_json] on all the types
Diffstat (limited to 'src/Expressions.ml')
-rw-r--r--src/Expressions.ml14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Expressions.ml b/src/Expressions.ml
index 6eb5531b..d8fe8d78 100644
--- a/src/Expressions.ml
+++ b/src/Expressions.ml
@@ -4,20 +4,23 @@ open Values
type field_proj_kind =
| Adt of TypeDefId.id * VariantId.id option
| Tuple of int
+[@@deriving of_yojson]
type projection_elem =
| Deref
| DerefBox
| Field of field_proj_kind * FieldId.id
| Downcast of VariantId.id
+[@@deriving of_yojson]
-type projection = projection_elem list
+type projection = projection_elem list [@@deriving of_yojson]
type place = { var_id : VarId.id; projection : projection }
+[@@deriving of_yojson]
-type borrow_kind = Shared | Mut | TwoPhaseMut
+type borrow_kind = Shared | Mut | TwoPhaseMut [@@deriving of_yojson]
-type unop = Not | Neg
+type unop = Not | Neg [@@deriving of_yojson]
(** A binary operation
@@ -43,6 +46,7 @@ type binop =
| Mul
| Shl
| Shr
+[@@deriving of_yojson]
(** Constant value for an operand
@@ -61,13 +65,16 @@ type operand_constant_value =
| ConstantValue of constant_value
| Adt of TypeDefId.id
| Unit
+[@@deriving of_yojson]
type operand =
| Copy of place
| Move of place
| Constant of ety * operand_constant_value
+[@@deriving of_yojson]
type aggregate_kind = Tuple | Adt of TypeDefId.id * VariantId.id list
+[@@deriving of_yojson]
type rvalue =
| Use of operand
@@ -76,3 +83,4 @@ type rvalue =
| BinaryOp of binop * operand * operand
| Discriminant of place
| Aggregate of aggregate_kind * operand list
+[@@deriving of_yojson]