parent
1b3843bd9c
commit
1d54bf17a5
|
@ -709,10 +709,11 @@
|
||||||
(let loop ([need-car 0] [proper #f])
|
(let loop ([need-car 0] [proper #f])
|
||||||
(begin-with-definitions
|
(begin-with-definitions
|
||||||
(define ch (cp-getc cp))
|
(define ch (cp-getc cp))
|
||||||
(define-values (cpt-start cpt-tag) (let ([x (cpt-table-lookup ch)])
|
(define-values (cpt-start cpt-tag)
|
||||||
(unless x
|
(let ([x (cpt-table-lookup ch)])
|
||||||
(error 'read-compact "unknown code : ~a" ch))
|
(unless x
|
||||||
(values (car x) (cdr x))))
|
(error 'read-compact "unknown code : ~a" ch))
|
||||||
|
(values (car x) (cdr x))))
|
||||||
(define v
|
(define v
|
||||||
(case cpt-tag
|
(case cpt-tag
|
||||||
[(delayed)
|
[(delayed)
|
||||||
|
@ -1004,8 +1005,12 @@
|
||||||
|
|
||||||
(define cp (make-cport 0 shared-size port size* rst-start symtab so* (make-vector symtabsize #f) (make-hash) (make-hash)))
|
(define cp (make-cport 0 shared-size port size* rst-start symtab so* (make-vector symtabsize #f) (make-hash) (make-hash)))
|
||||||
|
|
||||||
(for/list ([i (in-range 1 symtabsize)])
|
(for ([i (in-range 1 symtabsize)])
|
||||||
(read-sym cp i))
|
(read-sym cp i))
|
||||||
|
|
||||||
|
#;(for ([i (in-naturals)]
|
||||||
|
[v (in-vector (cport-symtab cp))])
|
||||||
|
(printf "~a: ~s~n~n" i (placeholder-get v)))
|
||||||
(set-cport-pos! cp shared-size)
|
(set-cport-pos! cp shared-size)
|
||||||
(make-reader-graph
|
(make-reader-graph
|
||||||
(read-marshalled 'compilation-top-type cp))))
|
(read-marshalled 'compilation-top-type cp))))
|
||||||
|
|
|
@ -3,12 +3,28 @@
|
||||||
compiler/zo-marshal
|
compiler/zo-marshal
|
||||||
tests/eli-tester)
|
tests/eli-tester)
|
||||||
|
|
||||||
|
(define (read-compiled-bytes bs)
|
||||||
|
(parameterize ([read-accept-compiled #t])
|
||||||
|
(read (open-input-bytes bs))))
|
||||||
|
|
||||||
(define (roundtrip ct)
|
(define (roundtrip ct)
|
||||||
(define bs (zo-marshal ct))
|
(define bs (zo-marshal ct))
|
||||||
(test bs
|
(test #:failure-prefix (format "~S" ct)
|
||||||
(zo-parse (open-input-bytes bs)) => ct))
|
(test bs
|
||||||
|
(zo-parse (open-input-bytes bs)) => ct
|
||||||
|
(read-compiled-bytes bs))))
|
||||||
|
|
||||||
(test
|
(test
|
||||||
|
(roundtrip
|
||||||
|
(compilation-top 0
|
||||||
|
(prefix 0 empty empty)
|
||||||
|
(current-directory)))
|
||||||
|
|
||||||
|
(roundtrip
|
||||||
|
(compilation-top 0
|
||||||
|
(prefix 0 empty empty)
|
||||||
|
(list (current-directory))))
|
||||||
|
|
||||||
(local [(define (hash-test make-hash-placeholder)
|
(local [(define (hash-test make-hash-placeholder)
|
||||||
(roundtrip
|
(roundtrip
|
||||||
(compilation-top 0
|
(compilation-top 0
|
||||||
|
@ -19,17 +35,6 @@
|
||||||
(make-reader-graph ht)))))]
|
(make-reader-graph ht)))))]
|
||||||
(hash-test make-hash-placeholder)
|
(hash-test make-hash-placeholder)
|
||||||
(hash-test make-hasheq-placeholder)
|
(hash-test make-hasheq-placeholder)
|
||||||
(hash-test make-hasheqv-placeholder))
|
(hash-test make-hasheqv-placeholder)))
|
||||||
|
|
||||||
|
|
||||||
(roundtrip
|
|
||||||
(compilation-top 0
|
|
||||||
(prefix 0 empty empty)
|
|
||||||
(current-directory)))
|
|
||||||
|
|
||||||
(roundtrip
|
|
||||||
(compilation-top 0
|
|
||||||
(prefix 0 empty empty)
|
|
||||||
(list (current-directory)))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user