package catala
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=42196e9a9c5e12839b38cb3da935f10c
sha512=ede2d8c17dcb936c1c8c596f1453bf89370a2f824a190efe74e438d7d7f7f83875c1ecbc18219c6a8a3e98b3ab4da1c3a6cc4e534687dbc90f3dca8230f43f7b
doc/catala.catala_utils/Catala_utils/Message/index.html
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 exceptions
type lsp_error = {kind : lsp_error_kind;message : Content.message;pos : Pos.t option;suggestion : string list option;
}The raised error is absorbed if the hook returns false
Some formatting helpers
Converts f to a string, discarding formatting and skipping newlines and indents
Prints the given character the given number of times (assuming it is of width 1)
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 ->
'aMultiple errors
with_delayed_errors ?stop_on_error f calls f and registers each error triggered using delayed_error. stop_on_error defaults to Global.options.stop_on_error.