Made #!eof invalid in #!r6rs mode.
This commit is contained in:
parent
86d8cd0854
commit
e461f4374f
|
@ -116,23 +116,6 @@
|
||||||
(void))))))))
|
(void))))))))
|
||||||
|
|
||||||
|
|
||||||
(define unlink!
|
|
||||||
(lambda (h b)
|
|
||||||
(let ([vec (hasht-vec h)]
|
|
||||||
[next ($tcbucket-next b)])
|
|
||||||
;;; first remove it from its old place
|
|
||||||
(let ([idx
|
|
||||||
(if (fixnum? next)
|
|
||||||
next
|
|
||||||
(get-bucket-index next))])
|
|
||||||
(let ([fst ($vector-ref vec idx)])
|
|
||||||
(cond
|
|
||||||
[(eq? fst b)
|
|
||||||
($vector-set! vec idx next)]
|
|
||||||
[else
|
|
||||||
(replace! fst b next)])))
|
|
||||||
;;; set next to be #f, denoting, not in table
|
|
||||||
($set-tcbucket-next! b #f))))
|
|
||||||
|
|
||||||
(define (get-bucket h x)
|
(define (get-bucket h x)
|
||||||
(let ([pv (pointer-value x)]
|
(let ([pv (pointer-value x)]
|
||||||
|
@ -153,10 +136,28 @@
|
||||||
(and (get-bucket h x) #t))
|
(and (get-bucket h x) #t))
|
||||||
|
|
||||||
(define (del-hash h x)
|
(define (del-hash h x)
|
||||||
|
(define unlink!
|
||||||
|
(lambda (h b)
|
||||||
|
(let ([vec (hasht-vec h)]
|
||||||
|
[next ($tcbucket-next b)])
|
||||||
|
;;; first remove it from its old place
|
||||||
|
(let ([idx
|
||||||
|
(if (fixnum? next)
|
||||||
|
next
|
||||||
|
(get-bucket-index next))])
|
||||||
|
(let ([fst ($vector-ref vec idx)])
|
||||||
|
(cond
|
||||||
|
[(eq? fst b)
|
||||||
|
($vector-set! vec idx next)]
|
||||||
|
[else
|
||||||
|
(replace! fst b next)])))
|
||||||
|
;;; set next to be #f, denoting, not in table
|
||||||
|
($set-tcbucket-next! b #f))))
|
||||||
(cond
|
(cond
|
||||||
[(get-bucket h x) =>
|
[(get-bucket h x) =>
|
||||||
(lambda (b)
|
(lambda (b)
|
||||||
(unlink! h b)
|
(unlink! h b)
|
||||||
|
;;; don't forget the count.
|
||||||
(set-hasht-count! h (- (hasht-count h) 1)))]))
|
(set-hasht-count! h (- (hasht-count h) 1)))]))
|
||||||
|
|
||||||
(define put-hash!
|
(define put-hash!
|
||||||
|
|
|
@ -357,6 +357,8 @@
|
||||||
(error 'tokenize "invalid eof near #!"))
|
(error 'tokenize "invalid eof near #!"))
|
||||||
(case e
|
(case e
|
||||||
[(#\e)
|
[(#\e)
|
||||||
|
(when (eq? (port-mode p) 'r6rs-mode)
|
||||||
|
(error 'tokenize "invalid syntax: #!e"))
|
||||||
(read-char* p '(#\e) "of" "eof sequence" #f #f)
|
(read-char* p '(#\e) "of" "eof sequence" #f #f)
|
||||||
(cons 'datum (eof-object))]
|
(cons 'datum (eof-object))]
|
||||||
[(#\r)
|
[(#\r)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1128
|
1129
|
||||||
|
|
Loading…
Reference in New Issue