fix char-set-complement (PR 8624, patch from Jens Axel)
svn: r6016
This commit is contained in:
parent
b276366187
commit
fdf878cda5
|
@ -244,10 +244,10 @@
|
|||
[(cs . more)
|
||||
(fold-set char-set-delete cs more)]))
|
||||
|
||||
(define (char-set-complement cs)
|
||||
(make-char-set
|
||||
(union (complement (char-set-set cs) #x0 #xD7FF)
|
||||
(complement (char-set-set cs) #xE000 #x10FFFF))))
|
||||
(define (char-set-complement cs)
|
||||
(make-char-set
|
||||
(difference (complement (char-set-set cs) 0 #x10FFFF)
|
||||
(make-range #xD800 #xDFFF))))
|
||||
|
||||
(define-syntax define-set-op
|
||||
(syntax-rules ()
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
(test #t char-set-contains? char-set:letter+digit #\A)
|
||||
(test #t char-set-contains? char-set:letter+digit #\Z)
|
||||
|
||||
(test 90547 char-set-size char-set:letter)
|
||||
;; As of Unicode 4.1:
|
||||
(test 91395 char-set-size char-set:letter)
|
||||
|
||||
(test #t char-set= char-set:letter+digit (char-set-union char-set:letter char-set:digit))
|
||||
;; Slow!:
|
||||
|
@ -108,8 +109,9 @@
|
|||
|
||||
;; Iterating over character sets ----------------------------------------
|
||||
|
||||
;; The number 268 comes from "grep Nd UnicodeData.txt | wc -l"
|
||||
(test 268 char-set-size char-set:digit)
|
||||
;; The number 270 comes from "grep Nd UnicodeData.txt | wc -l"
|
||||
;; in Unicode 4.1
|
||||
(test 270 char-set-size char-set:digit)
|
||||
|
||||
(test #t char-set=
|
||||
char-set:digit
|
||||
|
@ -492,4 +494,9 @@
|
|||
|
||||
;; ----------------------------------------
|
||||
|
||||
;; PR 8624 --- make sure there's no error:
|
||||
(test #t values (string? (char-set->string (char-set-complement char-set:graphic))))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
(report-errs)
|
||||
|
|
Loading…
Reference in New Issue
Block a user