]> gitweb.factorcode.org Git - factor.git/commitdiff
pcre: pcre-fullinfo throws on error
authorBjörn Lindqvist <bjourne@gmail.com>
Fri, 29 Nov 2013 15:17:33 +0000 (16:17 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 3 Dec 2013 01:07:17 +0000 (17:07 -0800)
extra/pcre/pcre-tests.factor
extra/pcre/pcre.factor

index 96cd03cbe7a74aa6d6a09c41e76fb0238c3e0235..7ad2997f566eef459a5013688c8a0d6f225cca82 100644 (file)
@@ -46,6 +46,11 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when
     { 0 $ PCRE_CONFIG_UTF32 } member?
 ] unit-test
 
+[ 33 ]
+[
+    [ "foo" <pcre> f 33 pcre-fullinfo ] [ what>> ] recover
+] unit-test
+
 ! Tests for findall
 [
     { { f "1999-01-12" } { "year" "1999" } { "month" "01" } { "day" "12" } }
index 585ab4743e7f125e9d712050a5f3e3c5c390ef17..25707a07aa34b01835ec449d9904cfdd8d6d205a 100644 (file)
@@ -38,7 +38,8 @@ ERROR: pcre-error value ;
     rot 0 = [ drop ] [ bad-option ] if ;
 
 : pcre-fullinfo ( pcre extra what -- obj )
-    { int } [ pcre_fullinfo ] with-out-parameters nip ;
+    [ { int } [ pcre_fullinfo ] with-out-parameters ] keep
+    rot 0 = [ drop ] [ bad-option ] if ;
 
 : pcre-substring-list ( subject match-array count -- alien )
     { void* } [ pcre_get_substring_list drop ] with-out-parameters ;