fix 'disappeared-use prperty added by `syntax'
Effectively preserve `syntax-original?' of added identifiers.
This commit is contained in:
parent
f64408fe60
commit
f28e8a02d0
|
@ -574,7 +574,7 @@
|
|||
(syntax-e id)
|
||||
x))
|
||||
'disappeared-use
|
||||
(car all-varss))
|
||||
(map syntax-local-introduce (car all-varss)))
|
||||
(loop (cdr vars) (cdr bindings) (cdr all-varss)))]
|
||||
[else (loop (cdr vars) (cdr bindings) (cdr all-varss))]))])
|
||||
(if (identifier? pattern)
|
||||
|
|
|
@ -761,6 +761,27 @@
|
|||
,e)))
|
||||
exn:fail?))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Check that the `syntax' macro adds a
|
||||
;; 'disappeared-use property that is
|
||||
;; original (if it should be):
|
||||
|
||||
(parameterize ([current-namespace (make-base-namespace)])
|
||||
(define stx (expand #'(with-syntax ([x 1]) #'x)))
|
||||
(let sloop ([stx stx]
|
||||
[in-prop? #f])
|
||||
(cond
|
||||
[(and (identifier? stx)
|
||||
(eq? 'x (syntax-e stx)))
|
||||
(when in-prop?
|
||||
(test #t syntax-original? stx))]
|
||||
[(syntax? stx)
|
||||
(sloop (syntax-property stx 'disappeared-use) #t)
|
||||
(sloop (syntax-e stx) in-prop?)]
|
||||
[(pair? stx)
|
||||
(sloop (car stx) in-prop?)
|
||||
(sloop (cdr stx) in-prop?)])))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
(err/rt-test (syntax-local-lift-require 'abc #'def))
|
||||
|
|
Loading…
Reference in New Issue
Block a user