package binary strip: work on "info.rkt" files that use `(module ....)
This commit is contained in:
parent
258aa82282
commit
33b7f6f92f
|
@ -245,14 +245,19 @@
|
||||||
(with-module-reading-parameterization
|
(with-module-reading-parameterization
|
||||||
(lambda () (read in)))))))
|
(lambda () (read in)))))))
|
||||||
;; convert:
|
;; convert:
|
||||||
|
(define (convert-mod info-lib defns)
|
||||||
|
`(module info ,info-lib
|
||||||
|
(#%module-begin
|
||||||
|
(define assume-virtual-sources #t)
|
||||||
|
. ,(filter values
|
||||||
|
(map (fixup-info-definition get-info) defns)))))
|
||||||
(define new-content
|
(define new-content
|
||||||
(match content
|
(match content
|
||||||
[`(module info ,info-lib (#%module-begin . ,defns))
|
[`(module info ,info-lib (#%module-begin . ,defns))
|
||||||
`(module info ,info-lib
|
(convert-mod info-lib defns)]
|
||||||
(#%module-begin
|
;; In case of `(module ...)` instead of `#lang ...`:
|
||||||
(define assume-virtual-sources #t)
|
[`(module info ,info-lib . ,defns)
|
||||||
. ,(filter values
|
(convert-mod info-lib defns)]))
|
||||||
(map (fixup-info-definition get-info) defns))))]))
|
|
||||||
;; write updated:
|
;; write updated:
|
||||||
(call-with-output-file*
|
(call-with-output-file*
|
||||||
new-p
|
new-p
|
||||||
|
|
Loading…
Reference in New Issue
Block a user