From f74d59318a3af5af6a7902fd9501098da400719e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 29 Dec 2015 06:58:56 -0800 Subject: Propagate macro ancestry info across macrolet. * eval.c (expand_macrolet): Install a macro ancestor for the expansion of the macrolet. If the original form has a macro ancestor, then use that grandparent ancestor. Otherwise use the original form itself. This way intermediate macrolets which are generated by macros are abbreviated out of ancestry traces. --- eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 3ab401e4..290ab085 100644 --- a/eval.c +++ b/eval.c @@ -1668,10 +1668,12 @@ static void builtin_reject_test(val op, val sym, val form) static val expand_macrolet(val form, val menv) { + uses_or2; val op = car(form); val body = cdr(form); val macs = pop(&body); val new_env = make_env(nil, nil, menv); + val form_origin = lookup_origin(form); for (; macs; macs = cdr(macs)) { val macro = car(macs); @@ -1690,7 +1692,8 @@ static val expand_macrolet(val form, val menv) cons(nil, cons(params, cons(block, nil)))), block); } - return rlcp_tree(maybe_progn(expand_forms(body, new_env)), body); + return set_origin(rlcp_tree(maybe_progn(expand_forms(body, new_env)), body), + or2(form_origin, form)); } static val expand_symacrolet(val form, val menv) -- cgit v1.2.3