summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index 258c77b8..c3c581e4 100644
--- a/parser.c
+++ b/parser.c
@@ -753,6 +753,7 @@ val repl(val bindings, val in_stream, val 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);
+ val origin = last_form_evaled;
if (cdr(exvals))
format(out_stream, lit("** ~!~a ~!~s\n"),
@@ -760,13 +761,21 @@ val repl(val bindings, val in_stream, val out_stream)
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"),
+ if (info && exsym != eval_error_s) {
+ format(out_stream, lit("** possibly triggered at ~a by form ~!~s\n"),
info, last_form_evaled, nao);
+ while ((origin = lookup_origin(origin))) {
+ val oinfo = source_loc_str(origin, lit("(n/a)"));
+ format(out_stream, lit("** which is an expansion at ~a of ~!~s\n"),
+ oinfo, origin, nao);
+ }
+ }
+
if (ex_info)
- format(std_error, lit("** during expansion at ~a of form ~!~s\n"),
+ format(out_stream, 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);