Functions for raising errors.
Constants used to discriminate kinds of error messages.
Represents a diagnostic message generated during compilation, such as errors, warnings, or other messages.
class
ErrorSinkCompiler:
dmd.errorsink.ErrorSink;
Error message sink for D compiler.
enum
Classification: Color;
Color highlighting to classify messages
for errors
for gagged errors
for warnings
for deprecations
for tip messages
nothrow void
error(Loc
loc, const(char)*
format, ...);
Print an error message, increasing the global error count.
Parameters:Locloc | location of error |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
error(const(char)*
filename, uint
linnum, uint
charnum, const(char)*
format, ...);
Same as above, but takes a filename and line information arguments as separate parameters.
Parameters:const(char)*filename | source file of error |
uintlinnum | line in the source file |
uintcharnum | column number on the line |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
errorBackend(const(char)*
filename, uint
linnum, uint
charnum, const(char)*
format, ...);
Callback for when the backend wants to report an error
nothrow void
errorSupplemental(Loc
loc, const(char)*
format, ...);
Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.
Parameters:Locloc | location of error |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
warning(Loc
loc, const(char)*
format, ...);
Print a warning message, increasing the global warning count.
Parameters:Locloc | location of warning |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
warningSupplemental(Loc
loc, const(char)*
format, ...);
Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.
Parameters:Locloc | location of warning |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
deprecation(Loc
loc, const(char)*
format, ...);
Print a deprecation message, may increase the global warning or error count depending on whether deprecations are ignored.
Parameters:Locloc | location of deprecation |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
deprecationSupplemental(Loc
loc, const(char)*
format, ...);
Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.
Parameters:Locloc | location of deprecation |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
message(Loc
loc, const(char)*
format, ...);
Print a verbose message. Doesn't prefix or highlight messages.
Parameters:Locloc | location of message |
const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
nothrow void
message(const(char)*
format, ...);
Same as above, but doesn't take a location argument.
Parameters:const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
alias
DiagnosticHandler = bool delegate(ref const(SourceLoc) location, Color headerColor, const(char)* header, const(char)* messageFormat, __va_list_tag* args, const(char)* prefix1, const(char)* prefix2) nothrow;
The type of the diagnostic handler see vreportDiagnostic for arguments
Returns:true if error handling is done, false to continue printing to stderr
DiagnosticHandler
diagnosticHandler;
The diagnostic handler. If non-null it will be called for every diagnostic message issued by the compiler. If it returns false, the message will be printed to stderr as usual.
nothrow void
tip(const(char)*
format, ...);
Print a tip message with the prefix and highlighting.
Parameters:const(char)*format | printf-style format specification |
| ... | printf-style variadic arguments |
alias
FatalErrorHandler = bool delegate() nothrow;
The type of the fatal error handler
Returns:true if error handling is done, false to do exit(EXIT_FAILURE)
FatalErrorHandler
fatalErrorHandler;
The fatal error handler. If non-null it will be called for every fatal() call issued by the compiler.
Call this after printing out fatal error messages to clean up and exit the compiler. You can also set a fatalErrorHandler to override this behaviour.
nothrow @safe void
halt();
Try to stop forgetting to remove the breakpoints from release builds.
nothrow void
unescapeBackticks(ref OutBuffer
buf);
Replace double backticks inbuf with a single backtick
Embed these highlighting commands in the text stream. HIGHLIGHT.Escape indicates a Color follows.