Fixed module-specs->non-lib-paths which was very broken in several different ways (PR10305)

svn: r15180
This commit is contained in:
Eli Barzilay 2009-06-15 21:44:54 +00:00
parent 5f7e052469
commit 233df48709

View File

@ -237,7 +237,7 @@
(define (lib? x)
(if (module-path-index? x)
(let-values ([(m base) (module-path-index-split x)]) (lib? m))
(and (pair? x) (eq? 'lib (car x)))))
(or (symbol? x) (and (pair? x) (eq? 'lib (car x))))))
;; turns a module spec to a simple one (except for lib specs)
(define (simple-modspec mod)
(cond [(and (pair? mod) (eq? 'lib (car mod))) #f]
@ -253,24 +253,21 @@
[(and (eq? 'prefix (car mod)) (pair? (cddr mod)))
(simple-modspec (caddr mod))]
[else #f]))
(let loop ([todo (filter values (map simple-modspec mods))]
(let loop ([todo (filter-map simple-modspec mods)]
[r '()])
(cond
[(null? todo) r]
[(member (car todo) r) (loop (cdr todo) r)]
[else
(let ([path (car todo)])
(loop (filter values
(map (lambda (i)
(loop (append (cdr todo)
(filter-map
(lambda (i)
(simplify-path* (resolve-module-path-index i path)))
(filter (lambda (i)
(and (module-path-index? i) (not (lib? i))))
(apply append
(call-with-values
(lambda ()
(module-compiled-imports
(get-module-code (car todo))))
list)))))
(append-map cdr (module-compiled-imports
(get-module-code path))))))
(cons path r)))])))
;; Resources ----------------------------------------------------------------