diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-03-25 22:47:46 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-03-25 22:47:46 +0200 |
| commit | cc3cf3353f23dd2f87412d42f8c3d52f873711dd (patch) | |
| tree | 94336a9ccee6451baeca51abff53da7e7e9c6230 /src/debug.c | |
| parent | bb261ad231c3683a36d516c4caf9b2a06ce0145f (diff) | |
| download | ek-cc3cf3353f23dd2f87412d42f8c3d52f873711dd.tar.gz ek-cc3cf3353f23dd2f87412d42f8c3d52f873711dd.zip | |
add formatter
Diffstat (limited to 'src/debug.c')
| -rw-r--r-- | src/debug.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/debug.c b/src/debug.c index e18ae70..2bb4af4 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + #include <stdio.h> #include <stdlib.h> #include <assert.h> @@ -40,7 +42,8 @@ static const char *find_lineno(const char *buf, size_t no) static void _issue(struct src_issue issue, const char *fmt, va_list args) { /* get start and end of current line in buffer */ - const char *line_start = find_lineno(issue.fctx.fbuf, issue.loc.first_line); + const char *line_start = find_lineno(issue.fctx.fbuf, + issue.loc.first_line); const char *line_end = strchr(line_start, '\n'); if (!line_end) line_end = strchr(line_start, 0); @@ -48,9 +51,9 @@ static void _issue(struct src_issue issue, const char *fmt, va_list args) const int line_len = line_end - line_start; fprintf(stderr, "%s:%i:%i: %s: ", issue.fctx.fname, - issue.loc.first_line, - issue.loc.first_col, - issue_level_str(issue.level)); + issue.loc.first_line, + issue.loc.first_col, + issue_level_str(issue.level)); vfprintf(stderr, fmt, args); fputc('\n', stderr); @@ -89,7 +92,8 @@ void src_issue(struct src_issue issue, const char *err_msg, ...) /* TODO: should really implement these better, the bad error messages are * starting to play a role in debugging */ -void semantic_error(struct file_ctx fctx, struct ast_node *node, const char *fmt, ...) +void semantic_error(struct file_ctx fctx, struct ast_node *node, + const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -101,7 +105,8 @@ void semantic_error(struct file_ctx fctx, struct ast_node *node, const char *fmt va_end(args); } -void semantic_warn(struct file_ctx fctx, struct ast_node *node, const char *fmt, ...) +void semantic_warn(struct file_ctx fctx, struct ast_node *node, const char *fmt, + ...) { va_list args; va_start(args, fmt); @@ -113,7 +118,8 @@ void semantic_warn(struct file_ctx fctx, struct ast_node *node, const char *fmt, va_end(args); } -void semantic_info(struct file_ctx fctx, struct ast_node *node, const char *fmt, ...) +void semantic_info(struct file_ctx fctx, struct ast_node *node, const char *fmt, + ...) { va_list args; va_start(args, fmt); |
