     [ <alien> 1 alien-unsigned-1 ] 
     [ 2 + <alien> utf8 alien>string ] bi ; 
 
-: options ( pcre -- opts ) 
+: options ( pcre -- opts )
     f PCRE_INFO_OPTIONS fullinfo ;
 
 : name-table-entries ( pcre extra -- addrs )
     [ name-table ] [ name-entry-size ] [ name-count ] 2tri
     gen-array-addrs [ name-table-entry 2array ] map ;
 
-PRIVATE>
-
-ERROR: malformed-regexp expr error ;
-ERROR: pcre-error value ;
-
-TUPLE: compiled-pcre pcre extra nametable ;
-
-: default-opts ( -- opts )
-    PCRE_UTF8 PCRE_UCP bitor ;
+CONSTANT: default-opts flags{ PCRE_UTF8 PCRE_UCP }
 
 : (pcre) ( expr -- pcre err-message err-offset )
     default-opts { c-string int } [ f pcre_compile ] with-out-parameters ;

USING: accessors alien alien.accessors alien.c-types alien.data
alien.enums alien.strings arrays assocs fry io.encodings.string
io.encodings.utf8 kernel math math.bitwise mirrors pcre.ffi
sequences sequences.generalizations splitting strings ;
QUALIFIED: regexp
IN: pcre

<PRIVATE

: 2with ( param1 param2 obj quot -- obj curry )
    [ -rot ] dip [ [ rot ] dip call ] 3curry ; inline

        ] 2bi
    ] if ;

: substring-list ( subject match-array count -- alien )
    { void* } [ pcre_get_substring_list drop ] with-out-parameters ;

