From 072003f2f41e2159d2406e3d6860a59c7de9bc03 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 15 Jul 2011 19:41:31 -0600 Subject: [PATCH] fix `#lang errortrace' Since `#lang errortrace' annotates the result of `local-expand', it needs to handle `letrec-syntaxes+values', as well as allowing `#%expression' in more places. This change relies on a change to `kernel-syntax-case'. This isn't a new bug, and it's ok to not include it in 5.1.2 (especially since the `kernel-syntax-case' change should not be merged). --- collects/errortrace/stacktrace.rkt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/collects/errortrace/stacktrace.rkt b/collects/errortrace/stacktrace.rkt index 3501cb952c..da52e37087 100644 --- a/collects/errortrace/stacktrace.rkt +++ b/collects/errortrace/stacktrace.rkt @@ -168,6 +168,8 @@ (insert-at-tail* se sexpr phase)] [(letrec-values bindings . body) (insert-at-tail* se sexpr phase)] + [(letrec-syntaxes+values sbindings bindings . body) + (insert-at-tail* se sexpr phase)] [(begin . _) (insert-at-tail* se sexpr phase)] @@ -406,7 +408,6 @@ (rebuild mb (map cons bodys bodyl)))))))))])] [(#%expression e) - top? (rearm expr #`(#%expression #,(annotate (syntax e) phase)))] ;; No way to wrap @@ -468,6 +469,16 @@ fm] [_ (with-mark expr fm)]))] + ;; This case is needed for `#lang errortrace ...', which uses + ;; `local-expand' on the module body. + [(letrec-syntaxes+values sbindings ([vars rhs] ...) . body) + (let ([fm (rearm + expr + (annotate-let disarmed-expr phase + (syntax (vars ...)) + (syntax (rhs ...)) + (syntax body)))]) + (with-mark expr fm))] ;; Wrap RHS [(set! var rhs)