
* Another big chunk of v4-require-isms * Allow `#lang framework/keybinding-lang' for keybinding files * Move hierlist sources into "mrlib/hierlist", leave stub behind svn: r10689
20 lines
619 B
Scheme
20 lines
619 B
Scheme
#lang scheme/base
|
|
(require (for-syntax scheme/base))
|
|
(provide reconstitute)
|
|
|
|
(begin-for-syntax
|
|
(define-struct sloc (inside loc) #:omit-define-syntaxes #:prefab))
|
|
|
|
(define-syntax (reconstitute orig-stx)
|
|
(syntax-case orig-stx ()
|
|
[(_ arg src)
|
|
(let loop ([stx #'arg])
|
|
(cond
|
|
[(syntax? stx) (datum->syntax stx (loop (syntax-e stx)))]
|
|
[(pair? stx) (cons (loop (car stx)) (loop (cdr stx)))]
|
|
[(sloc? stx)
|
|
(datum->syntax #'src
|
|
(loop (syntax-e (sloc-inside stx)))
|
|
(syntax->datum (sloc-loc stx)))]
|
|
[else stx]))]))
|