aboutsummaryrefslogtreecommitdiffstats
path: root/lib/attribute.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/attribute.ml21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/attribute.ml b/lib/attribute.ml
new file mode 100644
index 0000000..05d33f4
--- /dev/null
+++ b/lib/attribute.ml
@@ -0,0 +1,21 @@
+type t = {
+ hash : Conventions.Hash.t;
+ name : Conventions.Name.t;
+ name_hash : Conventions.Hash.t;
+ value : Conventions.AbstractValue.t;
+ value_hash : Conventions.Hash.t;
+}
+
+type materialized = {
+ name: Conventions.Name.t;
+ value: Conventions.AbstractValue.t
+}
+
+let make ~name ~value =
+ let name_hash = Conventions.Hash.hash_text name in
+ let value_hash = Conventions.AbstractValue.hash_text value in
+ let hash = Conventions.Hash.hash_text (name_hash ^ value_hash) in
+ { hash; name; name_hash; value; value_hash }
+
+let make_with_hashes ~hash ~name ~name_hash ~value ~value_hash =
+ { hash; name; name_hash; value; value_hash }