tokenize recognizes #@ as a fasl header and calls $fasl-read (in
libfasl.ss).
This commit is contained in:
parent
903023592d
commit
4fa2bdf0d9
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -226,3 +226,21 @@
|
||||||
(error 'fasl-write "~s is not an output port" port))
|
(error 'fasl-write "~s is not an output port" port))
|
||||||
(do-fasl-write x port)])))
|
(do-fasl-write x port)])))
|
||||||
|
|
||||||
|
|
||||||
|
(let ()
|
||||||
|
(define who 'fasl-read)
|
||||||
|
(define (assert-eq? x y)
|
||||||
|
(unless (eq? x y)
|
||||||
|
(error who "Expected ~s, got ~s\n" y x)))
|
||||||
|
(define (do-read p)
|
||||||
|
(let ([h (read-char p)])
|
||||||
|
(case h
|
||||||
|
[else
|
||||||
|
(error who "Unexpected ~s as a fasl object header" h)])))
|
||||||
|
(primitive-set! '$fasl-read
|
||||||
|
(lambda (p)
|
||||||
|
(assert-eq? (read-char p) #\I)
|
||||||
|
(assert-eq? (read-char p) #\K)
|
||||||
|
(assert-eq? (read-char p) #\0)
|
||||||
|
(assert-eq? (read-char p) #\1)
|
||||||
|
(do-read p))))
|
||||||
|
|
|
@ -405,6 +405,8 @@
|
||||||
[else
|
[else
|
||||||
(error 'tokenize
|
(error 'tokenize
|
||||||
"invalid char ~a inside gensym" c)])))]))]
|
"invalid char ~a inside gensym" c)])))]))]
|
||||||
|
[($char= #\@ c)
|
||||||
|
(cons 'datum ($fasl-read p))]
|
||||||
[else
|
[else
|
||||||
(unread-char c p)
|
(unread-char c p)
|
||||||
(error 'tokenize "invalid syntax #~a" c)])))
|
(error 'tokenize "invalid syntax #~a" c)])))
|
||||||
|
|
|
@ -115,6 +115,7 @@
|
||||||
trace-symbol! untrace-symbol! make-traced-procedure
|
trace-symbol! untrace-symbol! make-traced-procedure
|
||||||
fixnum->string
|
fixnum->string
|
||||||
$interrupted? $unset-interrupted! $do-event
|
$interrupted? $unset-interrupted! $do-event
|
||||||
|
$fasl-read
|
||||||
;;; TODO: must open-code
|
;;; TODO: must open-code
|
||||||
|
|
||||||
$make-port/input $make-port/output $make-port/both
|
$make-port/input $make-port/output $make-port/both
|
||||||
|
|
Loading…
Reference in New Issue