diff options
Diffstat (limited to 'rego-proofs/compiler-rewrite/lib/ast.ml')
| -rw-r--r-- | rego-proofs/compiler-rewrite/lib/ast.ml | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/rego-proofs/compiler-rewrite/lib/ast.ml b/rego-proofs/compiler-rewrite/lib/ast.ml index 3abf234..052496d 100644 --- a/rego-proofs/compiler-rewrite/lib/ast.ml +++ b/rego-proofs/compiler-rewrite/lib/ast.ml @@ -4,15 +4,15 @@ open Yojson.Basic.Util (* AST types. *) type expr = Term of term | Every of string option * string * term * query -[@@deriving show] +[@@deriving eq, show] and literal = | Exists of expr list * with_modifier option | Expr of expr * with_modifier option | Negate of expr * with_modifier option -[@@deriving show] +[@@deriving eq, show] -and query = literal list [@@deriving show] +and query = literal list [@@deriving eq, show] and term = | Scalar of scalar @@ -25,12 +25,12 @@ and term = | ObjectComprehension of (object_key * term) * query | SetComprehension of term * query | Call of reference * term list -[@@deriving show] +[@@deriving eq, show] and scalar = String of string | Number of float | Bool of bool | Null -[@@deriving show] +[@@deriving eq, show] -and reference = ref_target * term list [@@deriving show] +and reference = ref_target * term list [@@deriving eq, show] and ref_target = | Var of string @@ -41,23 +41,23 @@ and ref_target = | ObjectComprehension of (object_key * term) * query | SetComprehension of term * query | Call of reference * term list -[@@deriving show] +[@@deriving eq, show] and object_key = Scalar of scalar | Ref of reference | Var of string -[@@deriving show] +[@@deriving eq, show] -and with_modifier = (term * term) list [@@deriving show] +and with_modifier = (term * term) list [@@deriving eq, show] -type assign_operator = Assign | Unify [@@deriving show] -type rule_head_lhs = reference [@@deriving show] +type assign_operator = Assign | Unify [@@deriving eq, show] +type rule_head_lhs = reference [@@deriving eq, show] type rule_head_rhs = | Assignment of assign_operator * term | Function of assign_operator * string list * term | Set of term -[@@deriving show] +[@@deriving eq, show] -type rule_head = rule_head_lhs * rule_head_rhs [@@deriving show] +type rule_head = rule_head_lhs * rule_head_rhs [@@deriving eq, show] type rule = { default : bool; @@ -65,12 +65,12 @@ type rule = { body : query; otherwise : rule option; } -[@@deriving fields, show] +[@@deriving eq, show] -type import = { alias : string option; path : reference } [@@deriving show] +type import = { alias : string option; path : reference } [@@deriving eq, show] type package = { path : reference; imports : import list; policy : rule list } -[@@deriving fields, show] +[@@deriving eq, show] (* Additional JSON utility functions. *) |