fix char-numeric?

The `char-numeric?` function was missing some Unicode characters that
have the numeric property, because it was calculated from the wrong
field of UnicodeData.txt.
This commit is contained in:
Matthew Flatt 2019-01-20 15:04:42 -07:00
parent c61e59fda5
commit 25a4f67912
3 changed files with 284 additions and 249 deletions

View File

@ -1586,11 +1586,12 @@
(char-symbolic? c)))) (char-symbolic? c))))
null) null)
;; Letter, digit, punct, and symbol are distinct ;; Letter+numeric, punct, and symbol are mostly distinct
(check-all-unicode (check-all-unicode
(lambda (c) (lambda (c)
(> (+ (if (char-alphabetic? c) 1 0) (> (+ (if (or (char-alphabetic? c)
(if (char-numeric? c) 1 0) (char-numeric? c))
1 0)
(if (char-punctuation? c) 1 0) (if (char-punctuation? c) 1 0)
(if (char-symbolic? c) (if (char-symbolic? c)
(if (or (char<=? #\u24B6 c #\u24E9) (if (or (char<=? #\u24B6 c #\u24E9)

View File

@ -322,7 +322,7 @@
(let loop ([prev-code 0]) (let loop ([prev-code 0])
(let ([l (read-line i)]) (let ([l (read-line i)])
(unless (eof-object? l) (unless (eof-object? l)
(let ([m (regexp-match #rx"^([0-9A-F]+);([^;]*);([^;]*);([^;]*);[^;]*;([^;]*);[^;]*;([^;]*);[^;]*;[^;]*;[^;]*;[^;]*;([^;]*);([^;]*);([^;]*)" (let ([m (regexp-match #rx"^([0-9A-F]+);([^;]*);([^;]*);([^;]*);[^;]*;([^;]*);[^;]*;[^;]*;([^;]*);[^;]*;[^;]*;[^;]*;([^;]*);([^;]*);([^;]*)"
l)]) l)])
(unless m (unless m
(printf "no match: ~a\n" l)) (printf "no match: ~a\n" l))

File diff suppressed because it is too large Load Diff