diff --git a/collects/compiler/zo-marshal.rkt b/collects/compiler/zo-marshal.rkt index 27b7e7f7d8..5e47a7ea18 100644 --- a/collects/compiler/zo-marshal.rkt +++ b/collects/compiler/zo-marshal.rkt @@ -576,12 +576,14 @@ (list* path phase export-name (encode-nominal-path nominal-path) nominal-export-name)]))) encoded-bindings) -(define (encode-all-from-module all) - (match all - [(struct all-from-module (path phase src-phase exceptions prefix)) - (if (and (empty? exceptions) (not prefix)) - (list* path phase src-phase) - (list* path phase src-phase (append exceptions prefix)))])) +(define encode-all-from-module + (match-lambda + [(struct all-from-module (path phase src-phase (list) #f)) + (list* path phase src-phase)] + [(struct all-from-module (path phase src-phase exns #f)) + (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) (for/list ([wrap (in-list wraps)]) diff --git a/collects/compiler/zo-parse.rkt b/collects/compiler/zo-parse.rkt index 625de6963d..051b578d40 100644 --- a/collects/compiler/zo-parse.rkt +++ b/collects/compiler/zo-parse.rkt @@ -594,31 +594,22 @@ (make-module-rename phase (if kind 'marked 'normal) set-id - (let ([results (map (lambda (u) - ; u = (list path phase . src-phase) - ; or u = (list path phase src-phase exn ... . prefix) - (let ([just-phase? (let ([v (cddr u)]) - (or (number? v) (not v)))]) - (let-values ([(exns prefix) - (if just-phase? - (values null #f) - (let loop ([u (if just-phase? null (cdddr u))] - [a null]) - (if (pair? u) - (loop (cdr u) (cons (car u) a)) - (values (reverse a) u))))]) - (make-all-from-module - (parse-module-path-index cp (car u)) - (cadr u) - (if just-phase? - (cddr u) - (caddr u)) - exns - prefix)))) - unmarshals)]) - #;(printf "~nunmarshals: ~S~n" unmarshals) - #;(printf "~nunmarshal results: ~S~n" results) - results) + (map (local [(define (phase? v) + (or (number? v) (not v)))] + (match-lambda + [(list* path (? phase? phase) (? phase? src-phase) exn ... prefix) + (make-all-from-module + (parse-module-path-index cp path) + phase src-phase exn prefix)] + [(list* path (? phase? phase) (list exn ...) (? phase? src-phase)) + (make-all-from-module + (parse-module-path-index cp path) + phase src-phase exn #f)] + [(list* path (? phase? phase) (? phase? src-phase)) + (make-all-from-module + (parse-module-path-index cp path) + phase src-phase empty #f)])) + unmarshals) (decode-renames renames) mark-renames (and plus-kern? 'plus-kern)))]