]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/unicode/data/data.factor
factor: trim some using lists
[factor.git] / basis / unicode / data / data.factor
index 875a310bc88e68ef92236758421dc0d0670ab381..459c3b017b927c49be95045b2167f5844d93c9c0 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays ascii assocs byte-arrays combinators
 combinators.short-circuit grouping hashtables interval-sets
-io.encodings.utf8 io.files kernel locals make math math.bitwise
-math.order math.parser math.ranges memoize namespaces sequences
+io.encodings.utf8 io.files kernel make math math.bitwise
+math.order math.parser ranges namespaces sequences
 sets simple-flat-file sorting splitting strings.parser ;
 IN: unicode.data
 
@@ -108,7 +108,7 @@ PRIVATE>
 : exclusions ( -- set )
     exclusions-file utf8 file-lines
     [ "#" split1 drop [ ascii:blank? ] trim-tail hex> ] map
-    [ 0 = ] reject ;
+    0 swap remove ;
 
 : unique ( seq -- assoc )
     [ dup ] H{ } map>assoc ;
@@ -141,7 +141,7 @@ PRIVATE>
     name-map sort-values keys
     [ { [ "first>" tail? ] [ "last>" tail? ] } 1|| ] filter
     2 group [
-        [ name-map at ] bi@ [ [a,b] ] [ table ?nth ] bi
+        [ name-map at ] bi@ [ [a..b] ] [ table ?nth ] bi
         [ swap table ?set-nth ] curry each
     ] assoc-each table ;
 
@@ -215,6 +215,8 @@ load-properties properties swap assoc-union! drop
 
 PRIVATE>
 
+ERROR: invalid-unicode-character name ;
+
 [
-    name-map at [ "Invalid character" throw ] unless*
+    name-map ?at [ invalid-unicode-character ] unless
 ] name>char-hook set-global