summaryrefslogtreecommitdiffstats
path: root/eval.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-25 21:56:55 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-25 21:56:55 -0800
commit45b10ef2b031102899ca189badeb7ec9355f1d2c (patch)
tree1460832d0c315bd6a9f4869dc336cec92282e37f /eval.h
parentfc68528cf5a7714848d1f4c6ba855b763c49a85e (diff)
downloadtxr-45b10ef2b031102899ca189badeb7ec9355f1d2c.tar.gz
txr-45b10ef2b031102899ca189badeb7ec9355f1d2c.tar.bz2
txr-45b10ef2b031102899ca189badeb7ec9355f1d2c.zip
Report chain of macro-expansions in errors.
* eval.c (origin_hash): New global variable. (lookup_origin): New function. (expand_macro): Enter original form into origin hash, keyed by new form. (eval_init): gc-protect and initialize origin_hash. * eval.h (lookup_origin): Declared. * parser.c (repl): Report chain of expansions from last_form_evaled. * unwind.c (uw_throw): Likewise.
Diffstat (limited to 'eval.h')
-rw-r--r--eval.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/eval.h b/eval.h
index 05f9061f..78a0f8b0 100644
--- a/eval.h
+++ b/eval.h
@@ -31,6 +31,7 @@ extern val eq_s, eql_s, equal_s;
extern val last_form_evaled, last_form_expanded;
noreturn val eval_error(val form, val fmt, ...);
+val lookup_origin(val form);
val make_env(val fbindings, val vbindings, val up_env);
val copy_env(val oenv);
val env_fbind(val env, val sym, val fun);