dmd.errors

Functions for raising errors.

Members

Aliases

DiagnosticHandler
alias DiagnosticHandler = bool delegate(const ref Loc location, Color headerColor, const(char)* header, const(char)* messageFormat, va_list args, const(char)* prefix1, const(char)* prefix2)

The type of the diagnostic handler see verrorPrint for arguments

Enums

Classification
enum Classification

Color highlighting to classify messages

HIGHLIGHT
enum HIGHLIGHT

Embed these highlighting commands in the text stream. HIGHLIGHT.Escape indicates a Color follows.

Functions

deprecation
void deprecation(const ref Loc loc, const(char)* format, ...)

Print a deprecation message, may increase the global warning or error count depending on whether deprecations are ignored.

deprecationSupplemental
void deprecationSupplemental(const ref Loc loc, const(char)* format, ...)

Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.

error
void error(const ref Loc loc, const(char)* format, ...)

Print an error message, increasing the global error count.

error
void error(Loc loc, const(char)* format, ...)

Same as above, but allows Loc() literals to be passed.

error
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.

errorSupplemental
void errorSupplemental(const ref Loc loc, const(char)* format, ...)

Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.

fatal
void fatal()

Call this after printing out fatal error messages to clean up and exit the compiler.

halt
void halt()

Try to stop forgetting to remove the breakpoints from release builds.

message
void message(const ref Loc loc, const(char)* format, ...)

Print a verbose message. Doesn't prefix or highlight messages.

message
void message(const(char)* format, ...)

Same as above, but doesn't take a location argument.

tip
void tip(const(char)* format, ...)

Print a tip message with the prefix and highlighting.

vdeprecation
void vdeprecation(const ref Loc loc, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null)

Same as deprecation, but takes a va_list parameter, and optionally additional message prefixes.

vdeprecationSupplemental
void vdeprecationSupplemental(const ref Loc loc, const(char)* format, va_list ap)

Same as deprecationSupplemental, but takes a va_list parameter.

verror
void verror(const ref Loc loc, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null, const(char)* header = "Error: ")

Same as error, but takes a va_list parameter, and optionally additional message prefixes.

verrorSupplemental
void verrorSupplemental(const ref Loc loc, const(char)* format, va_list ap)

Same as errorSupplemental, but takes a va_list parameter.

vmessage
void vmessage(const ref Loc loc, const(char)* format, va_list ap)

Same as message, but takes a va_list parameter.

vtip
void vtip(const(char)* format, va_list ap)

Same as tip, but takes a va_list parameter.

vwarning
void vwarning(const ref Loc loc, const(char)* format, va_list ap)

Same as warning, but takes a va_list parameter.

vwarningSupplemental
void vwarningSupplemental(const ref Loc loc, const(char)* format, va_list ap)

Same as warningSupplemental, but takes a va_list parameter.

warning
void warning(const ref Loc loc, const(char)* format, ...)

Print a warning message, increasing the global warning count.

warningSupplemental
void warningSupplemental(const ref Loc loc, const(char)* format, ...)

Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.

Static variables

diagnosticHandler
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.

Meta