aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHugo Herbelin2018-12-27 08:56:23 +0100
committerHugo Herbelin2019-02-19 15:06:00 +0100
commit21bcc5f6fc8db1ccad16dea89f1705a799c1d090 (patch)
tree3ebd35fdaf2cbee91c374ea2c400e35f603df6c3 /lib
parent7c62153610f54a96cdded0455af0fff7ff91a53a (diff)
Notations: Enforce strong evaluation of cases_pattern_of_glob_constr.
This is because it can raise Not_found in depth and we need to catch it at the right time.
Diffstat (limited to 'lib')
-rw-r--r--lib/dAst.ml2
-rw-r--r--lib/dAst.mli1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/dAst.ml b/lib/dAst.ml
index f34ab956a3..803b2a0cff 100644
--- a/lib/dAst.ml
+++ b/lib/dAst.ml
@@ -30,6 +30,8 @@ let make ?loc v = CAst.make ?loc (Value v)
let delay ?loc v = CAst.make ?loc (Thunk (Lazy.from_fun v))
+let force x = CAst.make ?loc:x.CAst.loc (Value (get_thunk x.v))
+
let map f n = CAst.map (fun x -> map_thunk f x) n
let map_with_loc f n =
diff --git a/lib/dAst.mli b/lib/dAst.mli
index 28c78784e6..2f58cfc41f 100644
--- a/lib/dAst.mli
+++ b/lib/dAst.mli
@@ -21,6 +21,7 @@ val get_thunk : ('a, 'b) thunk -> 'a
val make : ?loc:Loc.t -> 'a -> ('a, 'b) t
val delay : ?loc:Loc.t -> (unit -> 'a) -> ('a, [ `thunk ]) t
+val force : ('a, 'b) t -> ('a, 'b) t
val map : ('a -> 'b) -> ('a, 'c) t -> ('b, 'c) t
val map_with_loc : (?loc:Loc.t -> 'a -> 'b) -> ('a, 'c) t -> ('b, 'c) t