Syslib.Reporter
module Message : Asai.MinimumSigs.Message
The module for messages.
val run :
?init_loc:Asai.Range.t ->
?init_backtrace:Asai.Diagnostic.backtrace ->
emit:(Message.t Asai.Diagnostic.t -> unit) ->
fatal:(Message.t Asai.Diagnostic.t -> 'a) ->
(unit -> 'a) ->
'a
run ~emit ~fatal f
runs the thunk f
, using emit
to handle non-fatal diagnostics before continuing the computation, and fatal
to handle fatal diagnostics that have aborted the computation. The recommended way to handle messages from a library that uses asai is to use adopt
:
Reporter.adopt (Diagnostic.map message_mapper) The_library.Reporter.run @@ fun () -> ...