package catala
Module Catala_utils.MessageSource
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
Common error raising
val raise_spanned_error :
?span_msg:Content.message ->
?suggestion:string list ->
Pos.t ->
('a, Format.formatter, unit, 'b) format4 ->
'aval raise_multispanned_error_full :
?suggestion:string list ->
(Content.message option * Pos.t) list ->
('a, Format.formatter, unit, 'b) format4 ->
'aval raise_multispanned_error :
?suggestion:string list ->
(string option * Pos.t) list ->
('a, Format.formatter, unit, 'b) format4 ->
'aval assert_internal_error :
bool ->
('a, Format.formatter, unit, unit, unit, unit) format6 ->
'aCommon warning emission
val emit_multispanned_warning :
(Content.message option * Pos.t) list ->
('a, Format.formatter, unit) format ->
'aval emit_spanned_warning :
?span_msg:Content.message ->
Pos.t ->
('a, Format.formatter, unit) format ->
'aCommon log emission
Common debug emission
Common result emission
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.