]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/unicode/data/data.factor
unicode: make this the API for all unicode things.
[factor.git] / basis / unicode / data / data.factor
index ebc3f6d9ef03b4898949f1f4ea61904f92d16033..0a759c625e975dfbc0892f8a8365a6d264aa1a7d 100644 (file)
@@ -28,17 +28,12 @@ PRIVATE>
 CONSTANT: name-map H{ }
 
 : canonical-entry ( char -- seq ) canonical-map at ; inline
-: combine-chars ( a b -- char/f ) >2ch combine-map at ; inline
 : compatibility-entry ( char -- seq ) compatibility-map at ; inline
+: combine-chars ( a b -- char/f ) >2ch combine-map at ; inline
 : combining-class ( char -- n ) class-map at ; inline
 : non-starter? ( char -- ? ) combining-class { 0 f } member? not ; inline
-: name>char ( name -- char ) name-map at ; inline
-: char>name ( char -- name ) name-map value-at ; inline
 : property ( property -- interval-map ) properties at ; foldable
 : property? ( char property -- ? ) property interval-sets:in? ; inline
-: ch>lower ( ch -- lower ) simple-lower ?at drop ; inline
-: ch>upper ( ch -- upper ) simple-upper ?at drop ; inline
-: ch>title ( ch -- title ) simple-title ?at drop ; inline
 : special-case ( ch -- casing-tuple ) special-casing at ; inline
 
 ! For non-existent characters, use Cn
@@ -143,7 +138,7 @@ PRIVATE>
     name-map sort-values keys
     [ { [ "first>" tail? ] [ "last>" tail? ] } 1|| ] filter
     2 group [
-        [ name>char ] bi@ [ [a,b] ] [ table ?nth ] bi
+        [ name-map at ] bi@ [ [a,b] ] [ table ?nth ] bi
         [ swap table ?set-nth ] curry each
     ] assoc-each table ;
 
@@ -208,14 +203,15 @@ load-data {
 } cleave
 
 combine-map keys [ 2ch> nip ] map
-[ combining-class ] reject
+[ class-map at ] reject
 [ 0 swap class-map set-at ] each
 
 load-special-casing special-casing swap assoc-union! drop
 
 load-properties properties swap assoc-union! drop
 
-[ name>char [ "Invalid character" throw ] unless* ]
-name>char-hook set-global
-
 PRIVATE>
+
+[
+    name-map at [ "Invalid character" throw ] unless*
+] name>char-hook set-global