syntax-taint repairs

for problems exposed by more agressive arming of `lambda'
and `#%app'

original commit: 001cb75bac6166541c2fc6803b4e1061743cbce3
This commit is contained in:
Matthew Flatt 2011-08-08 20:40:50 -06:00
parent 4138a2dc50
commit 8e79dbf235
2 changed files with 14 additions and 2 deletions

View File

@ -9,6 +9,8 @@
(provide shared)
(define-for-syntax code-insp (current-code-inspector))
(define undefined (letrec ([x x]) x))
(require (only-in scheme/base [cons the-cons]))

View File

@ -102,6 +102,16 @@
orig
orig))
(define-for-syntax code-insp (current-code-inspector))
(define-for-syntax (disarm* stx)
(cond
[(and (syntax? stx)
(pair? (syntax-e stx)))
(let ([stx (syntax-disarm stx code-insp)])
(datum->syntax stx (disarm* (syntax-e stx)) stx stx))]
[(pair? stx) (cons (disarm* (car stx)) (disarm* (cdr stx)))]
[else stx]))
(define-for-syntax (do-define-package stx exp-stx)
(syntax-case exp-stx ()
[(_ pack-id mode exports form ...)
@ -155,8 +165,8 @@
[new-bindings (make-bound-identifier-mapping)]
[fixup-sub-package (lambda (renamed-exports renamed-defines def-ctxes)
(lambda (stx)
(syntax-case* stx (define-syntaxes #%plain-app make-package quote-syntax
list cons #%plain-lambda)
(syntax-case* (disarm* stx) (define-syntaxes #%plain-app make-package quote-syntax
list cons #%plain-lambda)
free-transformer-identifier=?
[(define-syntaxes (pack-id)
(#%plain-app