#include "errloc.h" #include "lex.h" #include #include void errcloc(const struct lex *l, const char *fmt, ...) { const struct loc *loc = &l->loc; va_list ap; va_start(ap, fmt); fprintf(stderr, "%s:%d:%d: error: ", l->loc.f, loc->line, loc->col); vfprintf(stderr, fmt, ap); fputc('\n', stderr); va_end(ap); } void errloc(const struct tk *tk, const char *fmt, ...) { const struct loc *loc = &tk->loc; va_list ap; va_start(ap, fmt); fprintf(stderr, "%s:%d:%d: error: ", loc->f, loc->line, loc->col); vfprintf(stderr, fmt, ap); fputc('\n', stderr); va_end(ap); }