summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index 221b3562..b56a3d6d 100644
--- a/parser.c
+++ b/parser.c
@@ -720,12 +720,22 @@ val repl(val bindings, val in_stream, val out_stream)
if (uw_exception_subtype_p(exsym, syntax_error_s)) {
put_line(lit("** syntax error"), out_stream);
} else if (uw_exception_subtype_p(exsym, error_s)) {
+ val info = source_loc_str(last_form_evaled, nil);
+ val ex_info = source_loc_str(last_form_expanded, nil);
+
if (cdr(exvals))
format(out_stream, lit("** ~!~a ~!~s\n"),
car(exvals), cdr(exvals), nao);
else
format(out_stream, lit("** ~!~a\n"), car(exvals), nao);
+ if (info && exsym != eval_error_s)
+ format(std_error, lit("** possibly triggered at ~a by form ~!~s\n"),
+ info, last_form_evaled, nao);
+
+ if (ex_info)
+ format(std_error, lit("** during expansion at ~a of form ~!~s\n"),
+ ex_info, last_form_expanded, nao);
} else {
format(out_stream, lit("** ~!~s exception, args: ~!~s\n"),
exsym, exvals, nao);