Reporting
rascal-0.40.16
typepal-0.14.8
Synopsis
How to format and report errors, warnings and info messages.
Description
Reporting may be done both in the Collector and the Solver. It uses values of the datatype FailMessage
that can be created as follows:
FailMessage error(value src, str msg, value args...);
FailMessage warning(value src, str msg, value args...);
FailMessage info(value src, str msg, value args...);
Here,
src
is aTree
orloc
that is the subject of the report.msg
is an informative string to be printed. It may contain insertion directives.args
are zero or more values to be inserted in the insertion directives inmsg
.
The following insertion directives are supported:
%t
: insert the type of the next element ofargs
.%v
: insert the value of the next element ofargs
.%q
: quote and insert the type or value of the next element ofargs
.%%
: insert the character%
.