added another case for all-from-module renames

This commit is contained in:
Blake Johnson 2010-07-28 14:39:01 -06:00 committed by Jay McCarthy
parent 8b195d1c3c
commit 2dfd340031
2 changed files with 24 additions and 31 deletions

View File

@ -576,12 +576,14 @@
(list* path phase export-name (encode-nominal-path nominal-path) nominal-export-name)]))) (list* path phase export-name (encode-nominal-path nominal-path) nominal-export-name)])))
encoded-bindings) encoded-bindings)
(define (encode-all-from-module all) (define encode-all-from-module
(match all (match-lambda
[(struct all-from-module (path phase src-phase exceptions prefix)) [(struct all-from-module (path phase src-phase (list) #f))
(if (and (empty? exceptions) (not prefix)) (list* path phase src-phase)]
(list* path phase src-phase) [(struct all-from-module (path phase src-phase exns #f))
(list* path phase src-phase (append exceptions prefix)))])) (list* path phase exns src-phase)]
[(struct all-from-module (path phase src-phase exns prefix))
(list* path phase src-phase (append exns prefix))]))
(define (encode-wraps wraps) (define (encode-wraps wraps)
(for/list ([wrap (in-list wraps)]) (for/list ([wrap (in-list wraps)])

View File

@ -594,31 +594,22 @@
(make-module-rename phase (make-module-rename phase
(if kind 'marked 'normal) (if kind 'marked 'normal)
set-id set-id
(let ([results (map (lambda (u) (map (local [(define (phase? v)
; u = (list path phase . src-phase) (or (number? v) (not v)))]
; or u = (list path phase src-phase exn ... . prefix) (match-lambda
(let ([just-phase? (let ([v (cddr u)]) [(list* path (? phase? phase) (? phase? src-phase) exn ... prefix)
(or (number? v) (not v)))]) (make-all-from-module
(let-values ([(exns prefix) (parse-module-path-index cp path)
(if just-phase? phase src-phase exn prefix)]
(values null #f) [(list* path (? phase? phase) (list exn ...) (? phase? src-phase))
(let loop ([u (if just-phase? null (cdddr u))] (make-all-from-module
[a null]) (parse-module-path-index cp path)
(if (pair? u) phase src-phase exn #f)]
(loop (cdr u) (cons (car u) a)) [(list* path (? phase? phase) (? phase? src-phase))
(values (reverse a) u))))]) (make-all-from-module
(make-all-from-module (parse-module-path-index cp path)
(parse-module-path-index cp (car u)) phase src-phase empty #f)]))
(cadr u) unmarshals)
(if just-phase?
(cddr u)
(caddr u))
exns
prefix))))
unmarshals)])
#;(printf "~nunmarshals: ~S~n" unmarshals)
#;(printf "~nunmarshal results: ~S~n" results)
results)
(decode-renames renames) (decode-renames renames)
mark-renames mark-renames
(and plus-kern? 'plus-kern)))] (and plus-kern? 'plus-kern)))]