From b2fa4e2f077a8aa1977f6dea0d66c84dd13345ae Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 5 Apr 2008 07:57:26 -0500 Subject: [PATCH] unicode no longer depends on *.lib --- extra/unicode/breaks/breaks.factor | 6 +++--- extra/unicode/case/case.factor | 4 +++- extra/unicode/data/data.factor | 4 ++-- extra/unicode/normalize/normalize.factor | 5 ++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/extra/unicode/breaks/breaks.factor b/extra/unicode/breaks/breaks.factor index 4c8c6491ca..7bb5776e78 100644 --- a/extra/unicode/breaks/breaks.factor +++ b/extra/unicode/breaks/breaks.factor @@ -1,6 +1,6 @@ USING: unicode.categories kernel math combinators splitting sequences math.parser io.files io assocs arrays namespaces -combinators.lib assocs.lib math.ranges unicode.normalize +math.ranges unicode.normalize unicode.syntax unicode.data compiler.units alien.syntax io.encodings.ascii ; IN: unicode.breaks @@ -27,7 +27,7 @@ CATEGORY: grapheme-control Zl Zp Cc Cf ; [ "#" split1 drop ";" split1 drop trim-blank ] map [ empty? not ] subset [ ".." split1 [ dup ] unless* [ hex> ] bi@ [a,b] ] map - concat >set ; + concat [ dup ] H{ } map>assoc ; : other-extend-lines ( -- lines ) "extra/unicode/PropList.txt" resource-path ascii file-lines ; @@ -36,7 +36,7 @@ VALUE: other-extend CATEGORY: (extend) Me Mn ; : extend? ( ch -- ? ) - [ (extend)? ] [ other-extend key? ] either ; + dup (extend)? [ ] [ other-extend key? ] ?if ; : grapheme-class ( ch -- class ) { diff --git a/extra/unicode/case/case.factor b/extra/unicode/case/case.factor index 092a247204..06d22f0f63 100755 --- a/extra/unicode/case/case.factor +++ b/extra/unicode/case/case.factor @@ -1,8 +1,10 @@ USING: kernel unicode.data sequences sequences.next namespaces -assocs.lib unicode.normalize math unicode.categories combinators +unicode.normalize math unicode.categories combinators assocs strings splitting ; IN: unicode.case +: at-default ( key assoc -- value/key ) over >r at r> or ; + : ch>lower ( ch -- lower ) simple-lower at-default ; : ch>upper ( ch -- upper ) simple-upper at-default ; : ch>title ( ch -- title ) simple-title at-default ; diff --git a/extra/unicode/data/data.factor b/extra/unicode/data/data.factor index d8e1e8937a..ba9c0370cc 100755 --- a/extra/unicode/data/data.factor +++ b/extra/unicode/data/data.factor @@ -1,5 +1,5 @@ USING: assocs math kernel sequences io.files hashtables -quotations splitting arrays math.parser combinators.lib hash2 +quotations splitting arrays math.parser hash2 byte-arrays words namespaces words compiler.units parser io.encodings.ascii ; IN: unicode.data @@ -44,7 +44,7 @@ IN: unicode.data dup [ swap (chain-decomposed) ] curry assoc-map ; : first* ( seq -- ? ) - second [ empty? ] [ first ] either ; + second dup empty? [ ] [ first ] ?if ; : (process-decomposed) ( data -- alist ) 5 swap (process-data) diff --git a/extra/unicode/normalize/normalize.factor b/extra/unicode/normalize/normalize.factor index d62beb1a2c..951430b2b5 100644 --- a/extra/unicode/normalize/normalize.factor +++ b/extra/unicode/normalize/normalize.factor @@ -1,5 +1,4 @@ -USING: sequences namespaces unicode.data kernel combinators.lib -math arrays ; +USING: sequences namespaces unicode.data kernel math arrays ; IN: unicode.normalize ! Conjoining Jamo behavior @@ -19,7 +18,7 @@ IN: unicode.normalize ! These numbers come from UAX 29 : initial? ( ch -- ? ) - [ HEX: 1100 HEX: 1159 ?between? ] [ HEX: 115F = ] either ; + dup HEX: 1100 HEX: 1159 ?between? [ ] [ HEX: 115F = ] ?if ; : medial? ( ch -- ? ) HEX: 1160 HEX: 11A2 ?between? ; : final? ( ch -- ? ) HEX: 11A8 HEX: 11F9 ?between? ;