12static void printMessage(
13 t_fileLocation loc,
const char *category,
const char *fmt, va_list arg)
16 fprintf(stderr,
"%s:%d: %s: ", loc.
file, loc.
row + 1, category);
18 fprintf(stderr,
"%s: ", category);
19 vfprintf(stderr, fmt, arg);
27 printMessage(loc,
"error", fmt, args);
35 va_start(args, format);
36 printMessage(nullFileLocation,
"fatal error", format, args);
char * file
The name of the file.
int row
The zero-based index of a line in the file.
void emitError(t_fileLocation loc, const char *fmt,...)
int numErrors
The number of errors logged by emitError up to now.
void fatalError(const char *format,...)
Structure that represents a location in a file.