racket/compiler-lib/compiler/demodularizer/alpha.rkt
Matthew Flatt 89d99b92da update for 6.2.900.15 bytecode change
The `compilation-top` bytecode form has a new `binding-namess` field.
2015-09-05 13:13:38 -06:00

21 lines
674 B
Racket

#lang racket/base
(require racket/match racket/contract compiler/zo-parse)
(define (alpha-vary-ctop top)
(match top
[(struct compilation-top (max-let-depth binding-namess prefix form))
(make-compilation-top max-let-depth binding-namess (alpha-vary-prefix prefix) form)]))
(define (alpha-vary-prefix p)
(struct-copy prefix p
[toplevels
(map (match-lambda
[(and sym (? symbol?))
(gensym sym)]
[other
other])
(prefix-toplevels p))]))
(provide/contract
[alpha-vary-ctop (compilation-top? . -> . compilation-top?)])