disarm and rearm syntax in syntax-srcloc-lens

fixes part of
https://github.com/jackfirth/lens/issues/287
see also
https://github.com/racket/racket/pull/1448
This commit is contained in:
AlexKnauth 2016-09-09 20:25:53 -04:00
parent 04667e02ac
commit c7b5783088

View File

@ -39,10 +39,13 @@ module+ test
;; syntax-set-source-location : Syntax Source-Location -> Syntax
(define (syntax-set-source-location stx src)
(datum->syntax stx
(syntax-e stx)
(source-location->list src)
stx))
(define stx* (syntax-disarm stx #f))
(syntax-rearm
(datum->syntax stx*
(syntax-e stx*)
(source-location->list src)
stx*)
stx))
(define syntax-srcloc-lens
(make-lens