diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/util.ml | 3 | ||||
| -rw-r--r-- | lib/util.mli | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index 6dd0a792b2..32ede2fb24 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -34,6 +34,9 @@ let anomaly_loc (loc,s,strm) = Stdpp.raise_with_loc loc (Anomaly (s,strm)) let user_err_loc (loc,s,strm) = Stdpp.raise_with_loc loc (UserError (s,strm)) let invalid_arg_loc (loc,s) = Stdpp.raise_with_loc loc (Invalid_argument s) +let located_fold_left f x (_,a) = f x a +let located_iter2 f (_,a) (_,b) = f a b + (* Like Exc_located, but specifies the outermost file read, the filename associated to the location of the error, and the error itself. *) diff --git a/lib/util.mli b/lib/util.mli index d52db650ac..8e3ec2cb40 100644 --- a/lib/util.mli +++ b/lib/util.mli @@ -43,6 +43,8 @@ val anomaly_loc : loc * string * std_ppcmds -> 'a val user_err_loc : loc * string * std_ppcmds -> 'a val invalid_arg_loc : loc * string -> 'a val join_loc : loc -> loc -> loc +val located_fold_left : ('a -> 'b -> 'a) -> 'a -> 'b located -> 'a +val located_iter2 : ('a -> 'b -> unit) -> 'a located -> 'b located -> unit (* Like [Exc_located], but specifies the outermost file read, the input buffer associated to the location of the error (or the module name |
