Add some additional useful character sets.
authorChris Hanson <org/chris-hanson/cph>
Sun, 12 Feb 2017 05:51:34 +0000 (21:51 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 12 Feb 2017 05:51:34 +0000 (21:51 -0800)
src/runtime/runtime.pkg
src/runtime/ucd-glue.scm

index d0ffc2e942688840ce3f79ae82375909cbc93e54..0c6542577507f3f14882cd24b03334c956e47000 100644 (file)
@@ -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))
 
index 767717077fb15b7e481f44a381e89f4a05b52f0f..525a098048df2cf48f83089aa0467a0f1c2e060d 100644 (file)
@@ -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