package binary strip: work on "info.rkt" files that use `(module ....)

This commit is contained in:
Matthew Flatt 2014-01-09 14:07:26 -06:00
parent 258aa82282
commit 33b7f6f92f

View File

@ -245,14 +245,19 @@
(with-module-reading-parameterization
(lambda () (read in)))))))
;; convert:
(define new-content
(match content
[`(module info ,info-lib (#%module-begin . ,defns))
(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))))]))
(map (fixup-info-definition get-info) defns)))))
(define new-content
(match content
[`(module info ,info-lib (#%module-begin . ,defns))
(convert-mod info-lib defns)]
;; In case of `(module ...)` instead of `#lang ...`:
[`(module info ,info-lib . ,defns)
(convert-mod info-lib defns)]))
;; write updated:
(call-with-output-file*
new-p