From: Chris Hanson Date: Sun, 12 Feb 2017 05:51:34 +0000 (-0800) Subject: Add some additional useful character sets. X-Git-Tag: mit-scheme-pucked-9.2.12~220^2~125 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=97bfa9be18cbb049c86a997b15b111d635117e63;p=mit-scheme.git Add some additional useful character sets. --- diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index d0ffc2e94..0c6542577 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -1465,7 +1465,11 @@ USA. char-set:not-numeric char-set:not-upper-case char-set:not-whitespace - char-set:numeric + char-set:numeric) + (export (runtime) + char-set:folded-symbol-constituent + char-set:folded-symbol-initial + char-set:normal-printing char-set:symbol-constituent char-set:symbol-initial)) diff --git a/src/runtime/ucd-glue.scm b/src/runtime/ucd-glue.scm index 767717077..525a09804 100644 --- a/src/runtime/ucd-glue.scm +++ b/src/runtime/ucd-glue.scm @@ -96,5 +96,42 @@ USA. (define-deferred char-set:symbol-constituent (compute-char-set symbol-constituent?)) +(define-deferred char-set:folded-symbol-constituent + (char-set-difference char-set:symbol-constituent + char-set:changes-when-case-folded)) + (define-deferred char-set:symbol-initial - (compute-char-set (lambda (sv) (eq? #t (symbol-constituent? sv))))) \ No newline at end of file + (compute-char-set (lambda (sv) (eq? #t (symbol-constituent? sv))))) + +(define-deferred char-set:folded-symbol-initial + (char-set-difference char-set:symbol-initial + char-set:changes-when-case-folded)) + +(define-deferred char-set:normal-printing + (compute-char-set + (lambda (sv) + (case (unicode-code-point-general-category sv) + ((letter:uppercase + letter:lowercase + letter:titlecase + letter:modifier + letter:other + mark:nonspacing + mark:spacing-combining + mark:enclosing + number:decimal-digit + number:letter + number:other + punctuation:connector + punctuation:dash + punctuation:open + punctuation:close + punctuation:initial-quote + punctuation:final-quote + punctuation:other + symbol:math + symbol:currency + symbol:modifier + symbol:other) + #t) + (else #f))))) \ No newline at end of file