summaryrefslogtreecommitdiffstats
path: root/stdlib/compiler.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-05-09 21:30:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-05-09 21:30:34 -0700
commite1952b2d9c4dc9165d05161e170b272a1d726be9 (patch)
treec01d60c3597199605d66db025fc21d312eaf1683 /stdlib/compiler.tl
parente7d52c9b22f569c4c02d59c4c958f7750af2e264 (diff)
downloadtxr-e1952b2d9c4dc9165d05161e170b272a1d726be9.tar.gz
txr-e1952b2d9c4dc9165d05161e170b272a1d726be9.tar.bz2
txr-e1952b2d9c4dc9165d05161e170b272a1d726be9.zip
compiler: improvements in reporting form in diagnostics.
* eval.c (ctx_name): Do not report just the car of the form. If the form starts with three symbols, list those; if two, list those. * stdlib/compiler.tl (expand-defun): Set the defun form as the macro ancestor of the lambda, rather than propagating source location info. Then diagnostics that previously refer to a lambda will correctly refer to the defun and thank to the above change in eval.c, include its name. * stdlib/pmac.t (define-param-expander): A similar change here. We make the define-param-expander form the macro ancestor of the lambda, so that diagnostics agains tthe lambda will show that form.
Diffstat (limited to 'stdlib/compiler.tl')
-rw-r--r--stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index b516d91a..349fd9ab 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -2145,7 +2145,7 @@
(defun expand-defun (form)
(mac-param-bind form (t name args . body) form
(flet ((mklambda (block-name block-sym)
- (rlcp ^(lambda ,args (,block-sym ,block-name ,*body)) form)))
+ (set-macro-ancestor ^(lambda ,args (,block-sym ,block-name ,*body)) form)))
(cond
((bindable name)
^(sys:rt-defun ',name ,(mklambda name 'sys:blk)))