diff options
Diffstat (limited to 'tokenizer.c')
-rw-r--r-- | tokenizer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tokenizer.c b/tokenizer.c index 5dbd9f4..d905bc8 100644 --- a/tokenizer.c +++ b/tokenizer.c @@ -193,8 +193,9 @@ static void tokenization_err(Tokenizer *t, const char *fmt, ...) { } /* to be used after tokenization */ -static void tokr_err(Tokenizer *t, const char *fmt, ...) { +static void tokr_err_(const char *src_file, int src_line, Tokenizer *t, const char *fmt, ...) { LineNo line = t->token->where.line; + err_fprint("At line %d of %s:\n", src_line, src_file); /* RELEASE: Remove this */ va_list args; va_start(args, fmt); err_vprint(line, t->token->where.code, fmt, args); @@ -205,6 +206,7 @@ static void tokr_err(Tokenizer *t, const char *fmt, ...) { t->token++; } } +#define tokr_err(...) tokr_err_(__FILE__, __LINE__, __VA_ARGS__) static void tokr_put_location(Tokenizer *tokr, Token *t) { t->where.line = tokr->line; |