From 99c7fa04e209adf9da7e3921993db5e873d36308 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Mon, 26 Jul 2010 12:18:01 -0600 Subject: [PATCH] Fixing up a few things in zo-parse/etc original commit: 28432037af571e844cdcab35875e090d3800fc96 --- collects/compiler/zo-marshal.rkt | 17 ++++++++++------- collects/compiler/zo-parse.rkt | 1 - collects/tests/compiler/zo-test.rkt | 8 +++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/collects/compiler/zo-marshal.rkt b/collects/compiler/zo-marshal.rkt index f3b11324db..ff27685f18 100644 --- a/collects/compiler/zo-marshal.rkt +++ b/collects/compiler/zo-marshal.rkt @@ -1,6 +1,7 @@ #lang scheme/base (require compiler/zo-structs scheme/port + racket/vector scheme/match scheme/contract scheme/local @@ -633,6 +634,7 @@ (bloop b2))] [else (encode-wrapped b)])))] + ; XXX Cylic list error possible [len (let loop ([datum datum][len 0]) (cond [(null? datum) #f] @@ -643,14 +645,15 @@ (if len (cons len p) p))] - [(box x) (box (encode-wrapped x))] - [(vector a ...) (list->vector - (map encode-wrapped a))] + [(box x) + (box (encode-wrapped x))] + [(? vector? v) + (vector-map encode-wrapped v)] [(? prefab-struct-key) - (let ([l (vector->list (struct->vector datum))]) - (make-prefab-struct - (car l) - (map encode-wrapped (cdr l))))] + (define l (vector->list (struct->vector datum))) + (make-prefab-struct + (car l) + (map encode-wrapped (cdr l)))] [_ datum])] [p (cons enc-datum (encode-wraps wraps))]) diff --git a/collects/compiler/zo-parse.rkt b/collects/compiler/zo-parse.rkt index 8cca2af017..625de6963d 100644 --- a/collects/compiler/zo-parse.rkt +++ b/collects/compiler/zo-parse.rkt @@ -502,7 +502,6 @@ (if (integer? v) (unmarshal-stx-get/decode cp v decode-stx) (let loop ([v v]) - ;(printf "~s~n" v) (let-values ([(cert-marks v encoded-wraps) (match v [`#((,datum . ,wraps) ,cert-marks) (values cert-marks datum wraps)] diff --git a/collects/tests/compiler/zo-test.rkt b/collects/tests/compiler/zo-test.rkt index 56cd89db6e..81e86bd365 100755 --- a/collects/tests/compiler/zo-test.rkt +++ b/collects/tests/compiler/zo-test.rkt @@ -316,15 +316,15 @@ exec racket -t "$0" -- -s -t 60 -v -R $* [compare-marshalled-to-marshalled-marshalled #f (bytes-not-equal?-error marshal-parsed marshal-marshalled)] + #;[show-orig-and-marshal-parsed + #f + (print-bytes read-orig marshal-parsed)] #;[replace-with-marshalled #t (replace-file file marshal-marshalled)] [decompile-parsed #t (decompile parse-orig)] - [show-orig-and-marshal-parsed - #f - (print-bytes read-orig marshal-parsed)] [c-parse-marshalled #t (read-compiled-bytes marshal-parsed)] @@ -333,6 +333,8 @@ exec racket -t "$0" -- -s -t 60 -v -R $* (bytes-not-equal?-error read-orig marshal-parsed)]) (define (run-test file) + (when (debugging?) + (printf "~a\n" file)) (run-with-limit file (* 1024 1024 128)