diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-29 06:58:56 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-29 06:58:56 -0800 |
commit | f74d59318a3af5af6a7902fd9501098da400719e (patch) | |
tree | 90844724f13d040dc4ab59470fe0c5d786e3abff /eval.c | |
parent | 270a2c302cd6aaed472d00e04f4a34443104fdc4 (diff) | |
download | txr-f74d59318a3af5af6a7902fd9501098da400719e.tar.gz txr-f74d59318a3af5af6a7902fd9501098da400719e.tar.bz2 txr-f74d59318a3af5af6a7902fd9501098da400719e.zip |
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.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |