Commit 69f6e9d2 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

New function [Error.with_new_category].

parent c3068d4d
......@@ -113,6 +113,12 @@ let exit_if category =
if !category then
exit 1
let with_new_category f =
let c = new_category() in
let y = f c in
exit_if c;
y
(* ---------------------------------------------------------------------------- *)
(* Certain warnings about the grammar can optionally be treated as errors. *)
......
......@@ -71,6 +71,11 @@ val signal: category -> Positions.positions -> ('a, out_channel, unit, unit) for
val exit_if: category -> unit
(* [with_new_category f] creates a new category [c], executes [f c], then
invokes [exit_if c], and transmits the result returned by [f]. *)
val with_new_category: (category -> 'b) -> 'b
(* ---------------------------------------------------------------------------- *)
(* Certain warnings about the grammar can optionally be treated as errors. *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment