From 1258d9d28aa995e04b12e0aba179811320c7ee05 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Tue, 20 Nov 2018 11:43:28 -0500 Subject: [PATCH] Point to body forms in missing-expression error. (#2356) Improves the error message for: ``` (define-syntax (like-lambda stx) (syntax-case stx () [(_ e) #'(lambda () e)])) (like-lambda (define x 1)) ``` Based on a report from @pkoronkevich. --- racket/src/expander/expand/body.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/racket/src/expander/expand/body.rkt b/racket/src/expander/expand/body.rkt index 864548e2b8..ca2a42c036 100644 --- a/racket/src/expander/expand/body.rkt +++ b/racket/src/expander/expand/body.rkt @@ -246,7 +246,9 @@ (when (null? done-bodys) (raise-syntax-error (string->symbol "begin (possibly implicit)") "no expression after a sequence of internal definitions" - (datum->syntax #f (cons 'begin init-bodys) s))) + (datum->syntax #f (cons 'begin init-bodys) s) + #f + init-bodys)) ;; As we finish expanding, we're no longer in a definition context (define finish-ctx (struct*-copy expand-context (accumulate-def-ctx-scopes body-ctx def-ctx-scopes) [context 'expression]