summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-30 20:21:18 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-30 20:21:18 -0800
commit61f01a3021229b3674f0dafcab74282a9945f45e (patch)
tree8fd335ec3e1bf6d578f4e7df026ed73e5a8e5104 /eval.c
parent3b2d7857a4bc0451775c81a2f3999a3714427a00 (diff)
downloadtxr-61f01a3021229b3674f0dafcab74282a9945f45e.tar.gz
txr-61f01a3021229b3674f0dafcab74282a9945f45e.tar.bz2
txr-61f01a3021229b3674f0dafcab74282a9945f45e.zip
Suppress superfluous "located at" message.
* eval.c (error_trace): Restructure loop. Suppress "which is located at" message in first iteration.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/eval.c b/eval.c
index 9ff820ca..c3ceede9 100644
--- a/eval.c
+++ b/eval.c
@@ -233,11 +233,11 @@ void error_trace(val exsym, val exvals, val out_stream, val prefix)
format(out_stream, lit("~a ~!~a\n"), prefix, car(exvals), nao);
if (info && exsym != eval_error_s) {
- val first = t;
+ val first, origin, oinfo;
- while (last) {
- val origin = lookup_origin(last);
- val oinfo = source_loc_str(origin, nil);
+ for (first = t; last; last = origin, info = oinfo, first = nil) {
+ origin = lookup_origin(last);
+ oinfo = source_loc_str(origin, nil);
if (first) {
if (origin)
@@ -246,17 +246,13 @@ void error_trace(val exsym, val exvals, val out_stream, val prefix)
else
format(out_stream, lit("~a possibly triggered at ~a by form ~!~s\n"),
prefix, info, last, nao);
- first = nil;
}
if (origin)
format(out_stream, lit("~a ... an expansion at ~a of ~!~s\n"),
prefix, info, origin, nao);
- else
+ else if (!first)
format(out_stream, lit("~a which is located at ~a\n"), prefix, info, nao);
-
- last = origin;
- info = oinfo;
}
}