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,9 +39,12 @@ module+ test
;; syntax-set-source-location : Syntax Source-Location -> Syntax ;; syntax-set-source-location : Syntax Source-Location -> Syntax
(define (syntax-set-source-location stx src) (define (syntax-set-source-location stx src)
(datum->syntax stx (define stx* (syntax-disarm stx #f))
(syntax-e stx) (syntax-rearm
(datum->syntax stx*
(syntax-e stx*)
(source-location->list src) (source-location->list src)
stx*)
stx)) stx))
(define syntax-srcloc-lens (define syntax-srcloc-lens