diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-06-03 13:21:20 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-06-03 14:45:48 -0400 |
commit | a6c25c7c74f762cb40639da0b9b98bfcf3f4c590 (patch) | |
tree | 0ab35020876133cb03c43ff5b193dc893972e0b4 /parse.c | |
parent | cc71aecdfbb00a35d9094038c3ef559968d11c19 (diff) | |
download | bfs-a6c25c7c74f762cb40639da0b9b98bfcf3f4c590.tar.xz |
parse: Make some error messages red
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2416,13 +2416,15 @@ static struct expr *new_not_expr(const struct parser_state *state, struct expr * * | LITERAL */ static struct expr *parse_factor(struct parser_state *state) { + CFILE *cerr = state->cmdline->cerr; + if (skip_paths(state) != 0) { return NULL; } const char *arg = state->argv[0]; if (!arg) { - fputs("Expression terminated prematurely.\n", stderr); + cfprintf(cerr, "%{er}error: Expression terminated prematurely after '%s'.%{rs}\n", state->argv[-1]); return NULL; } @@ -2441,7 +2443,7 @@ static struct expr *parse_factor(struct parser_state *state) { arg = state->argv[0]; if (!arg || strcmp(arg, ")") != 0) { - fputs("Expected a ')'.\n", stderr); + cfprintf(cerr, "%{er}error: Expected a ')' after '%s'.%{rs}\n", state->argv[-1]); free_expr(expr); return NULL; } |