summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon Ho2021-12-08 16:00:06 +0100
committerSon Ho2021-12-08 16:00:06 +0100
commit83ed1022f9fb4e2042d048d6576898d5d4bef26b (patch)
tree733f0b67f337adfb10648e9ed05584f306686a0a
parentceb9001935e96e269daa5ce10264cc686eda9671 (diff)
Generate iterators for Contexts.env
Diffstat (limited to '')
-rw-r--r--src/Contexts.ml43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/Contexts.ml b/src/Contexts.ml
index 2d09cb25..cc28dd27 100644
--- a/src/Contexts.ml
+++ b/src/Contexts.ml
@@ -13,10 +13,45 @@ type binder = {
(** Environment value: mapping from variable to value, abstraction (only
used in symbolic mode) or stack frame delimiter.
*)
-type env_elem = Var of binder * typed_value | Abs of abs | Frame
-[@@deriving show]
-
-type env = env_elem list [@@deriving show]
+type env_elem = Var of (binder[@opaque]) * typed_value | Abs of abs | Frame
+[@@deriving
+ show,
+ visitors
+ {
+ name = "iter_env_elem";
+ variety = "iter";
+ ancestors = [ "iter_abs" ];
+ nude = true (* Don't inherit [VisitorsRuntime.iter] *);
+ concrete = true;
+ },
+ visitors
+ {
+ name = "map_env_elem";
+ variety = "map";
+ ancestors = [ "map_abs" ];
+ nude = true (* Don't inherit [VisitorsRuntime.iter] *);
+ concrete = true;
+ }]
+
+type env = env_elem list
+[@@deriving
+ show,
+ visitors
+ {
+ name = "iter_env";
+ variety = "iter";
+ ancestors = [ "iter_env_elem" ];
+ nude = true (* Don't inherit [VisitorsRuntime.iter] *);
+ concrete = true;
+ },
+ visitors
+ {
+ name = "map_env";
+ variety = "map";
+ ancestors = [ "map_env_elem" ];
+ nude = true (* Don't inherit [VisitorsRuntime.iter] *);
+ concrete = true;
+ }]
type interpreter_mode = ConcreteMode | SymbolicMode [@@deriving show]