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:
parent
04667e02ac
commit
c7b5783088
|
@ -39,10 +39,13 @@ 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
|
||||||
(source-location->list src)
|
(datum->syntax stx*
|
||||||
stx))
|
(syntax-e stx*)
|
||||||
|
(source-location->list src)
|
||||||
|
stx*)
|
||||||
|
stx))
|
||||||
|
|
||||||
(define syntax-srcloc-lens
|
(define syntax-srcloc-lens
|
||||||
(make-lens
|
(make-lens
|
||||||
|
|
Loading…
Reference in New Issue
Block a user