racket/racket/collects/syntax/moddep.rkt
Matthew Flatt d175c3949c move "scheme" collection to a "scheme-lib" package
Also, move remaining "srfi" libraries to "srfi-lite-lib".

In principle, "base" should depend on "scheme-lib" and
"srfi-lite-lib", and a new "base2" package would represent the new,
smaller base. But I don't think the window has yet closed on
determining the initial "base" package.

The "srfi" libraries moved to "srfi-lite-lib", instead of "srfi-lib",
to avoid creating many extra dependencies on "srfi-lib" and all of its
dependencies. The SRFIs in "srfi-lite-lib" depend only on "base",
and they are used relatively widely.
2013-08-27 15:19:24 -06:00

34 lines
1.3 KiB
Racket

(module moddep racket/base
(require "modread.rkt"
"modcode.rkt"
"modcollapse.rkt"
"modresolve.rkt")
(provide (all-from-out "modread.rkt")
(all-from-out "modcode.rkt")
(all-from-out "modcollapse.rkt")
(all-from-out "modresolve.rkt")
show-import-tree)
(define (show-import-tree module-path)
(let loop ([path (resolve-module-path module-path #f)][indent ""][fs ""])
(printf "~a~a~a\n" indent path fs)
(let ([code (get-module-code path)])
(let ([imports (module-compiled-imports code)])
(define ((mk-loop fs) i)
(let ([p (resolve-module-path-index i path)])
(unless (symbol? p)
(loop p
(format " ~a" indent)
fs))))
(for-each (lambda (i)
(for-each
(mk-loop (case (car i)
[(0) ""]
[(1) " [for-syntax]"]
[(-1) " [for-syntax]"]
[(#f) " [for-label]"]
[else (format " [for-meta ~a]" (car i))]))
(cdr i)))
imports))))))