From 97bfa9be18cbb049c86a997b15b111d635117e63 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 11 Feb 2017 21:51:34 -0800 Subject: [PATCH] Add some additional useful character sets. --- src/runtime/runtime.pkg | 6 +++++- src/runtime/ucd-glue.scm | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) 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 -- 2.25.1