#lang racket' ->
#lang racket/base' conversions in demodularizer.
This commit is contained in:
parent
bffe336220
commit
4c8d1f67b2
|
@ -1,5 +1,6 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-parse)
|
|
||||||
|
(require racket/match racket/contract compiler/zo-parse)
|
||||||
|
|
||||||
(define (alpha-vary-ctop top)
|
(define (alpha-vary-ctop top)
|
||||||
(match top
|
(match top
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
|
|
||||||
#|
|
#|
|
||||||
Here's the idea:
|
Here's the idea:
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ Here's the idea:
|
||||||
|
|
||||||
(require racket/pretty
|
(require racket/pretty
|
||||||
racket/system
|
racket/system
|
||||||
|
racket/cmdline
|
||||||
"mpi.rkt"
|
"mpi.rkt"
|
||||||
"util.rkt"
|
"util.rkt"
|
||||||
"nodep.rkt"
|
"nodep.rkt"
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-parse
|
|
||||||
|
(require racket/match
|
||||||
|
racket/list
|
||||||
|
racket/dict
|
||||||
|
racket/contract
|
||||||
|
compiler/zo-parse
|
||||||
"util.rkt")
|
"util.rkt")
|
||||||
|
|
||||||
; XXX Use efficient set structure
|
; XXX Use efficient set structure
|
||||||
|
@ -150,8 +155,7 @@
|
||||||
(match (dict-ref g n)
|
(match (dict-ref g n)
|
||||||
[(struct refs (n-tls n-stxs))
|
[(struct refs (n-tls n-stxs))
|
||||||
(hash-set! visited? n #t)
|
(hash-set! visited? n #t)
|
||||||
(local
|
(define-values (new-tls1 new-stxs1)
|
||||||
[(define-values (new-tls1 new-stxs1)
|
|
||||||
(for/fold ([new-tls tls]
|
(for/fold ([new-tls tls]
|
||||||
[new-stxs stxs])
|
[new-stxs stxs])
|
||||||
([tl (in-list n-tls)])
|
([tl (in-list n-tls)])
|
||||||
|
@ -162,9 +166,9 @@
|
||||||
(define this-stx (visit-stx stx))
|
(define this-stx (visit-stx stx))
|
||||||
(if this-stx
|
(if this-stx
|
||||||
(list* this-stx new-stxs)
|
(list* this-stx new-stxs)
|
||||||
new-stxs)))]
|
new-stxs)))
|
||||||
(values (list* n new-tls1)
|
(values (list* n new-tls1)
|
||||||
new-stxs2))])))
|
new-stxs2)])))
|
||||||
(define stx-visited? (make-hasheq))
|
(define stx-visited? (make-hasheq))
|
||||||
(define (visit-stx n)
|
(define (visit-stx n)
|
||||||
(if (hash-has-key? stx-visited? n)
|
(if (hash-has-key? stx-visited? n)
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-parse
|
|
||||||
|
(require racket/list
|
||||||
|
racket/match
|
||||||
|
racket/contract
|
||||||
|
compiler/zo-parse
|
||||||
"util.rkt"
|
"util.rkt"
|
||||||
"mpi.rkt"
|
"mpi.rkt"
|
||||||
"nodep.rkt"
|
"nodep.rkt"
|
||||||
|
@ -156,12 +160,12 @@
|
||||||
(cond
|
(cond
|
||||||
[(mod-lift-start . <= . n)
|
[(mod-lift-start . <= . n)
|
||||||
; This is a lift
|
; This is a lift
|
||||||
(local [(define which-lift (- n mod-lift-start))
|
(define which-lift (- n mod-lift-start))
|
||||||
(define lift-tl (+ top-lift-start lift-offset which-lift))]
|
(define lift-tl (+ top-lift-start lift-offset which-lift))
|
||||||
(when (lift-tl . >= . max-toplevel)
|
(when (lift-tl . >= . max-toplevel)
|
||||||
(error 'merge-module "[~S] lift error: orig(~a) which(~a) max(~a) lifts(~a) now(~a)"
|
(error 'merge-module "[~S] lift error: orig(~a) which(~a) max(~a) lifts(~a) now(~a)"
|
||||||
name n which-lift num-mod-toplevels mod-num-lifts lift-tl))
|
name n which-lift num-mod-toplevels mod-num-lifts lift-tl))
|
||||||
lift-tl)]
|
lift-tl]
|
||||||
[else
|
[else
|
||||||
(list-ref toplevel-remap n)]))
|
(list-ref toplevel-remap n)]))
|
||||||
(lambda (n)
|
(lambda (n)
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-parse
|
|
||||||
|
(require racket/list
|
||||||
|
racket/match
|
||||||
|
racket/contract
|
||||||
|
compiler/zo-parse
|
||||||
"util.rkt")
|
"util.rkt")
|
||||||
|
|
||||||
(define (->module-path-index s)
|
(define (->module-path-index s)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require syntax/modresolve)
|
|
||||||
|
(require racket/contract
|
||||||
|
syntax/modresolve)
|
||||||
|
|
||||||
(define current-module-path (make-parameter #f))
|
(define current-module-path (make-parameter #f))
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-parse
|
|
||||||
|
(require racket/list
|
||||||
|
racket/match
|
||||||
|
racket/contract
|
||||||
|
compiler/zo-parse
|
||||||
"util.rkt"
|
"util.rkt"
|
||||||
"mpi.rkt"
|
"mpi.rkt"
|
||||||
racket/set)
|
racket/set)
|
||||||
|
@ -92,7 +96,8 @@
|
||||||
|
|
||||||
(define (nodep-form form phase)
|
(define (nodep-form form phase)
|
||||||
(if (mod? form)
|
(if (mod? form)
|
||||||
(local [(define-values (modvar-rewrite lang-info mods) (nodep-module form phase))]
|
(let-values ([(modvar-rewrite lang-info mods)
|
||||||
|
(nodep-module form phase)])
|
||||||
(values modvar-rewrite lang-info (make-splice mods)))
|
(values modvar-rewrite lang-info (make-splice mods)))
|
||||||
(error 'nodep-form "Doesn't support non mod forms")))
|
(error 'nodep-form "Doesn't support non mod forms")))
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require unstable/struct
|
|
||||||
|
(require racket/match
|
||||||
|
racket/vector
|
||||||
|
unstable/struct
|
||||||
"util.rkt")
|
"util.rkt")
|
||||||
|
|
||||||
(provide replace-modidx)
|
(provide replace-modidx)
|
||||||
|
|
||||||
(define (replace-modidx expr self-modidx)
|
(define (replace-modidx expr self-modidx)
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-structs
|
|
||||||
|
(require racket/match
|
||||||
|
racket/contract
|
||||||
|
compiler/zo-structs
|
||||||
"util.rkt")
|
"util.rkt")
|
||||||
|
|
||||||
(define (update-toplevels toplevel-updater topsyntax-updater topsyntax-new-midpt)
|
(define (update-toplevels toplevel-updater topsyntax-updater topsyntax-new-midpt)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#lang racket
|
#lang racket/base
|
||||||
(require compiler/zo-parse)
|
|
||||||
|
(require racket/contract
|
||||||
|
compiler/zo-parse)
|
||||||
|
|
||||||
(define (prefix-syntax-start pre)
|
(define (prefix-syntax-start pre)
|
||||||
(length (prefix-toplevels pre)))
|
(length (prefix-toplevels pre)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user