From 7c62043ab195ee9844d29ade76efdf839a2e98d0 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Wed, 17 Nov 2021 14:26:43 +0100 Subject: Use [@@ëerive of_json] on all the types --- src/Expressions.ml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Expressions.ml') 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] -- cgit v1.2.3