 ! Copyright (C) 2008, 2009 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: unicode.data kernel math sequences parser
+USING: unicode.data kernel math sequences parser unicode.data.private
 bit-arrays namespaces sequences.private arrays classes.parser
 assocs classes.predicate sets fry splitting accessors ;
 IN: unicode.categories.syntax


: parse-category ( -- word tokens quot )
    CREATE-CLASS \ ; parse-until { | } split1
    [ [ name>> ] map ]
    [ [ [ ] like ] [ [ drop f ] ] if* ] bi* ;

PRIVATE>


<PRIVATE

: [category] ( categories code -- quot )
    '[ dup category# _ member? [ drop t ] _ if ] ;

: integer-predicate-class ( word predicate -- )
    integer swap define-predicate-class ;
