Skip to content

Commit

Permalink
repair char-foldcase for some single-character special cases
Browse files Browse the repository at this point in the history
For example, `(char-foldcase #\x1E9E)` should be `#\xDF`, in contrast
to the `(string-foldcase (string #\x1E9E))` result of "ss". The
character foldings that that are different here correspond to cases
that are "S" status in "CaseFolding.txt".

Thanks to Marc Feeley for noticing and reporting the bug.

Also, repair some dependencies in "s/build.zuo".
  • Loading branch information
mflatt committed Oct 22, 2023
1 parent 3e936f2 commit c13dfb1
Show file tree
Hide file tree
Showing 4 changed files with 1,164 additions and 1,162 deletions.
3 changes: 3 additions & 0 deletions mats/5_4.ms
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@
(error? (char-foldcase 'a))
(eqv? (char-foldcase #\a) #\a)
(eqv? (char-foldcase #\Z) #\z)
(eqv? (char-foldcase #\Z) #\z)
(eqv? (char-foldcase #\x1e9e) #\xDF)
(eqv? (char-foldcase #\x1f8d) #\x1f85)
)

(mat integer->char
Expand Down
6 changes: 3 additions & 3 deletions s/build.zuo
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@
(append (map at-source
(list "debug.ss" "primdata.ss" "layout.ss"))
(append type-srcs
cpnanopass-srcs)))
cpnanopass-srcs
unicode-srcs)))

(define other-srcs
;; files that are used to initialize the compiler
Expand Down Expand Up @@ -447,8 +448,7 @@
;; independent of whether dependencies changed:
[:target all (bootall ,@output-headers)
,void]
[:target bootall (,@all-srcs ,@(add-patchfile macro-objs) ,nanopass.so ,@type-srcs
,@cpnanopass-srcs ,@unicode-srcs)
[:target bootall (,@all-srcs ,@(add-patchfile macro-objs) ,nanopass.so)
,(lambda (token)
(mkdir-p (at-boot "."))
(run-scheme "all at once"
Expand Down
2 changes: 1 addition & 1 deletion unicode/extract-char-cases.ss
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
[offset (codes->off (caddr fields) n)])
(chardata-fcchar-set! cdrec offset)
(chardata-fcstr-set! cdrec offset))))
(filter (lambda (fields) (equal? (cadr fields) "C")) data))
(filter (lambda (fields) (member (cadr fields) '("C" "S"))) data))
(for-each
(lambda (fields)
(let ([n (hex->num (car fields))])
Expand Down
Loading

0 comments on commit c13dfb1

Please sign in to comment.