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.
This commit is contained in:
Sam Tobin-Hochstadt 2018-11-20 11:43:28 -05:00 committed by GitHub
parent 1ea9ec399f
commit 1258d9d28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]