summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-27 16:55:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-03-27 16:55:59 -0700
commit893431eca5abc7df6f788912b9e7179bc47faf34 (patch)
tree16ae29fd01b678eab2ec4a5f1302664481191b67 /parser.c
parentfcd5374bc0a3cc878cfacea092ce074326ac5940 (diff)
downloadtxr-893431eca5abc7df6f788912b9e7179bc47faf34.tar.gz
txr-893431eca5abc7df6f788912b9e7179bc47faf34.tar.bz2
txr-893431eca5abc7df6f788912b9e7179bc47faf34.zip
compile/eval: more standard formatting for diags.
This patch eliminates parentheses from the error messages, as well as a leading ./ being added to relative paths. The word "warning: " is moved into the error message, so that it does not appear before the location. Example, when doing (compile-file "path/to/foo.tl"). Before patch: warning: (./path/to/foo.tl:37): unbound function foo After: path/to/foo.tl:37: warning: unbound function foo Now when I compile out of Vim, it nicely jumps to errors in Lisp code. * eval.c (eval_exception): Drop parentheses from error location, add colon. (eval_warn): Prepend "warning: " to format string. (eval_defr_warn): Drop parentheses from location, and prepend "warning: " to format string. * parser.c (repl-warning): Drop "warning:" prefix. * share/txr/stdlib/compiler.tl (open-compile-streams): Do not do parent substitution for relative paths if the parent path is the empty string "", to avoid inserting ./ onto relative paths in that case. * share/txr/stdlib/error.tl (sys:loc): Drop parentheses and space from location. (compile-error) Separate location with colon and space. (compile-warning, compile-defr-warning): Likewise and add "warning: " prefix. * unwind.c (uw_rthrow): Drop "warning: " prefix. (uw_warningf): Add "warning: " prefix. (uw_dump_deferred_warnings): Drop "warning: " prefix.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 77797b19..0b88ec7b 100644
--- a/parser.c
+++ b/parser.c
@@ -1188,7 +1188,7 @@ static val repl_warning(val out_stream, val exc, struct args *rest)
if (cdr(args))
uw_defer_warning(args);
else
- format(out_stream, lit("** warning: ~!~a\n"), car(args), nao);
+ format(out_stream, lit("** ~!~a\n"), car(args), nao);
return uw_rthrow(continue_s, nil);
}