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
|
||||
(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
|
||||
|
|
Loading…
Reference in New Issue
Block a user