aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/loc.ml
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-01-14 01:27:40 +0100
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-04-24 23:58:22 +0200
commit6d9e008ffd81bbe927e3442fb0c37269ed25b21f (patch)
tree059ceb889a68c3098d7eeb1b9549999ca8127135 /lib/loc.ml
parent846b74275511bd89c2f3abe19245133050d2199c (diff)
[location] Use Loc.located for constr_expr.
This is the second patch, which is a bit more invasive. We reasoning is similar to the previous patch. Code is not as clean as it could as we would need to convert `glob_constr` to located too, then a few parts could just map the location.
Diffstat (limited to 'lib/loc.ml')
-rw-r--r--lib/loc.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/loc.ml b/lib/loc.ml
index 39f2d7dfb..8ae8fe25d 100644
--- a/lib/loc.ml
+++ b/lib/loc.ml
@@ -63,6 +63,11 @@ type 'a located = t * 'a
let to_pair x = x
let tag ?loc x = Option.default ghost loc, x
+let with_loc f (loc, x) = f ~loc x
+
+let map f (l,x) = (l, f x)
+let map_with_loc f (loc, x) = (loc, f ~loc x)
+
let located_fold_left f x (_,a) = f x a
let located_iter2 f (_,a) (_,b) = f a b
let down_located f (_,a) = f a