pcre: pcre-fullinfo throws on error

db4
Björn Lindqvist 2013-11-29 16:17:33 +01:00 committed by John Benediktsson
parent 175b00797c
commit 7986d9edc9
2 changed files with 7 additions and 1 deletions

View File

@ -46,6 +46,11 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when
{ 0 $ PCRE_CONFIG_UTF32 } member? { 0 $ PCRE_CONFIG_UTF32 } member?
] unit-test ] unit-test
[ 33 ]
[
[ "foo" <pcre> f 33 pcre-fullinfo ] [ what>> ] recover
] unit-test
! Tests for findall ! Tests for findall
[ [
{ { f "1999-01-12" } { "year" "1999" } { "month" "01" } { "day" "12" } } { { f "1999-01-12" } { "year" "1999" } { "month" "01" } { "day" "12" } }

View File

@ -38,7 +38,8 @@ ERROR: pcre-error value ;
rot 0 = [ drop ] [ bad-option ] if ; rot 0 = [ drop ] [ bad-option ] if ;
: pcre-fullinfo ( pcre extra what -- obj ) : 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 ) : pcre-substring-list ( subject match-array count -- alien )
{ void* } [ pcre_get_substring_list drop ] with-out-parameters ; { void* } [ pcre_get_substring_list drop ] with-out-parameters ;