zo-marshal fixes and read.c fix for hash tables in symbol table
original commit: 9599304ca9
This commit is contained in:
parent
817b3186d9
commit
ae4b770939
|
@ -8,7 +8,9 @@
|
|||
racket/local
|
||||
racket/list
|
||||
racket/dict
|
||||
racket/function)
|
||||
racket/function
|
||||
racket/pretty
|
||||
racket/path)
|
||||
|
||||
(provide/contract
|
||||
[zo-marshal (compilation-top? . -> . bytes?)]
|
||||
|
@ -305,8 +307,8 @@
|
|||
(list* path phase export-name (encode-nominal-path nominal-path) nominal-export-name)])))
|
||||
encoded-bindings)
|
||||
|
||||
(define encode-all-from-module
|
||||
(match-lambda
|
||||
(define (encode-all-from-module afm)
|
||||
(match afm
|
||||
[(struct all-from-module (path phase src-phase #f #f))
|
||||
(list* path phase src-phase)]
|
||||
[(struct all-from-module (path phase src-phase exns #f))
|
||||
|
@ -814,7 +816,7 @@
|
|||
(lambda (v mode port)
|
||||
(display "#^" port)
|
||||
(write (path->bytes (make-relative v)) port))])
|
||||
(pretty-write expr s))
|
||||
(pretty-write v s))
|
||||
(out-byte CPT_ESCAPE out)
|
||||
(let ([bstr (get-output-bytes s)])
|
||||
(out-number (bytes-length bstr) out)
|
||||
|
@ -986,5 +988,12 @@
|
|||
|
||||
(define-struct svector (vec))
|
||||
|
||||
(define (make-relative v)
|
||||
(let ([r (current-write-relative-directory)])
|
||||
(if r
|
||||
(find-relative-path r v)
|
||||
v)))
|
||||
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
|
|
|
@ -1043,10 +1043,10 @@
|
|||
(for ([i (in-range 1 symtabsize)])
|
||||
(read-sym cp i))
|
||||
|
||||
(for ([i (in-naturals)]
|
||||
#;(for ([i (in-naturals)]
|
||||
[v (in-vector debug-symrefs)])
|
||||
(printf "~a: ~a~n" i v))
|
||||
|
||||
#;(printf "SYMBOL TABLE:~n~n")
|
||||
#;(for ([i (in-naturals)]
|
||||
[v (in-vector (cport-symtab cp))])
|
||||
(printf "~a: ~s~n~n" i (placeholder-get v)))
|
||||
|
|
|
@ -9,23 +9,33 @@
|
|||
|
||||
(define (roundtrip ct)
|
||||
(define bs (zo-marshal ct))
|
||||
(with-output-to-file "test_rkt.zo" (λ () (write-bytes bs)) #:exists 'replace)
|
||||
(test #:failure-prefix (format "~S" ct)
|
||||
(test bs
|
||||
(zo-parse (open-input-bytes bs)) => ct
|
||||
(read-compiled-bytes bs))))
|
||||
|
||||
(define mpi (module-path-index-join #f #f))
|
||||
|
||||
(test
|
||||
(roundtrip
|
||||
#;(roundtrip
|
||||
(compilation-top 0
|
||||
(prefix 0 empty empty)
|
||||
(current-directory)))
|
||||
|
||||
(roundtrip
|
||||
#;(roundtrip
|
||||
(compilation-top 0
|
||||
(prefix 0 empty empty)
|
||||
(list (current-directory))))
|
||||
|
||||
(local [(define (hash-test make-hash-placeholder)
|
||||
(roundtrip
|
||||
(compilation-top
|
||||
0
|
||||
(prefix 0 empty empty)
|
||||
(cons #hasheq()
|
||||
#hasheq())))
|
||||
|
||||
#;(local [(define (hash-test make-hash-placeholder)
|
||||
(roundtrip
|
||||
(compilation-top 0
|
||||
(prefix 0 empty empty)
|
||||
|
|
Loading…
Reference in New Issue
Block a user