]> gitweb.factorcode.org Git - factor.git/commitdiff
regexp.classes: remove dependency on mirrors vocab
authorSlava Pestov <slava@factorcode.org>
Tue, 11 Oct 2011 04:08:45 +0000 (21:08 -0700)
committerSlava Pestov <slava@factorcode.org>
Tue, 11 Oct 2011 04:09:59 +0000 (21:09 -0700)
basis/regexp/classes/classes.factor

index fd4c7e7e4fc16c4ea9fc55e7d39c2896acec62b5..f81962f5d8b8d1eb17054afaf62a9a7695b847fc 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2008, 2009 Doug Coleman, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel math math.order words combinators locals
-unicode.categories combinators.short-circuit sequences
-fry macros arrays assocs sets classes mirrors unicode.script
-unicode.data ;
+USING: accessors kernel math math.order words combinators
+combinators.smart combinators.short-circuit locals
+unicode.categories sequences fry macros arrays assocs sets
+classes unicode.script unicode.data ;
 FROM: ascii => ascii? ;
 FROM: sets => members ;
 IN: regexp.classes
@@ -168,7 +168,17 @@ TUPLE: class-partition integers not-integers simples not-simples and or other ;
     class-partition boa ;
 
 : class-partition>seq ( class-partition -- seq )
-    make-mirror values concat ;
+    [
+        {
+            [ integers>> ]
+            [ not-integers>> ]
+            [ simples>> ]
+            [ not-simples>> ]
+            [ and>> ]
+            [ or>> ]
+            [ other>> ]
+        } cleave
+    ] output>array concat ;
 
 : repartition ( partition -- partition' )
     ! This could be made more efficient; only and and or are effected