commit e4d1bbc473ff4417fd1a3c7cd4248fa5d3671909
parent bf47b2209111438e0d541a2ef3c5ad74115c360a
Author: Alexis King <lexi.lambda@gmail.com>
Date: Wed, 13 Dec 2017 11:05:15 -0800
syntax/parse: Arrange for built-in macro’s names to be preserved
The dance that syntax/parse performs to lazily load its implementation
rewrites uses of syntax/parse macros in such a way that their original
names were discarded, which shows up in error messages. By simply
invoking the underlying transformer directly in the proxy macro instead
of expanding to a rewritten use, users’ names can be preserved.
fixes #1909
Diffstat:
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/parse/private/sc.rkt b/parse/private/sc.rkt
@@ -6,10 +6,7 @@
;; keep and keep as abs. path -- lazy-loaded macros produce references to this
;; must be required via *absolute module path* from any disappearing module
;; (so for consistency etc, require absolutely from all modules)
-(require stxparse-info/parse/private/residual
- racket/syntax
- racket/stxparam
- syntax/stx)
+(require stxparse-info/parse/private/residual)
(begin-for-syntax
(lazy-require
@@ -60,9 +57,7 @@
define-eh-alternative-set)
(let ([tx (lambda (get-id)
(lambda (stx)
- (syntax-case stx ()
- [(_ . args)
- (datum->syntax stx (cons (get-id) #'args) stx)])))])
+ ((syntax-local-value (get-id)) stx)))])
(values
(tx id:define-syntax-class)
(tx id:define-splicing-syntax-class)