package catala
Install
Dune Dependency
Authors
Maintainers
Sources
md5=5abd76e8c51a47670645e91b21b57fc5
sha512=9c6fbe50c0b5a60566e877eeddadca0a339e2ce35deb5c1beceb03bc40eb6af2d519313e71859d88645b53fad591d4fa5288c633b185c9d765603da0f5b7dd7b
doc/catala.catala_utils/Catala_utils/Message/index.html
Module Catala_utils.Message
Source
Interface for emitting compiler messages.
All messages are expected to use the Format
module. Flush, "@?"
, "@."
, "%!"
etc. are not supposed to be used outside of this module.
WARNING: this module performs side-effects at load time, adding support for ocolor tags (e.g. "@{<blue>text@}"
) to the standard string formatter used by e.g. Format.sprintf
. (In this case, the tags are ignored, for color output you should use the functions of this module that toggle support depending on cli flags and terminal support).
Message content
This functions emits the message according to the emission type defined by Cli.message_format_flag
.
Error exception
Some formatting helpers
Converts f
to a string, discarding formatting and skipping newlines and indents
Creates a new formatter from the given out channel, with correct handling of the ocolor tags. Actual use of escape codes in the output depends on Cli.style_flag
-- and wether the channel is a tty if that is set to auto.
Simple interface for various message emission
type ('a, 'b) emitter =
?header:Content.message ->
?internal:bool ->
?pos:Pos.t ->
?pos_msg:Content.message ->
?extra_pos:(string * Pos.t) list ->
?fmt_pos:(Content.message * Pos.t) list ->
?outcome:Content.message list ->
?suggestion:string list ->
('a, Format.formatter, unit, 'b) format4 ->
'a