pcre: new word 'version' for getting the version of the library
parent
5603e3ff67
commit
3ea34c667d
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax sequences strings ;
|
||||
USING: help.markup help.syntax math sequences strings ;
|
||||
IN: pcre
|
||||
|
||||
ARTICLE: "pcre" "PCRE binding"
|
||||
|
@ -36,4 +36,8 @@ HELP: findall
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: version
|
||||
{ $values { "f" float } }
|
||||
{ $description "Version number of the PCRE library, expressed as a float." } ;
|
||||
|
||||
ABOUT: "pcre"
|
||||
|
|
|
@ -105,7 +105,7 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when
|
|||
|
||||
! This used to work in 8.36, but might have changed in later versions.
|
||||
! See: https://bugs.exim.org/show_bug.cgi?id=1875
|
||||
pcre_version " " splitting:split1 drop string>number 8.36 <= [
|
||||
version 8.36 <= [
|
||||
{ t t } [
|
||||
"(?s)." <compiled-pcre> PCRE_DOTALL has-option?
|
||||
"(?i)x" <compiled-pcre> PCRE_CASELESS has-option?
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
! Copyright (C) 2013 Björn Lindqvist
|
||||
! Copyright (C) 2013, 2016 Björn Lindqvist
|
||||
! See http://factorcode.org/license.txt for BSD license
|
||||
|
||||
USING: accessors alien alien.accessors alien.c-types alien.data
|
||||
alien.enums alien.strings arrays assocs combinators fry
|
||||
io.encodings.string io.encodings.utf8 kernel literals math
|
||||
math.bitwise pcre.ffi sequences splitting strings ;
|
||||
math.bitwise math.parser pcre.ffi sequences splitting strings ;
|
||||
QUALIFIED: regexp
|
||||
IN: pcre
|
||||
|
||||
|
@ -155,3 +155,6 @@ M: regexp:regexp findall
|
|||
|
||||
: split ( subject obj -- strings )
|
||||
dupd findall [ first second ] map split-subseqs ;
|
||||
|
||||
: version ( -- r )
|
||||
pcre_version " " splitting:split1 drop string>number ;
|
||||
|
|
Loading…
Reference in New Issue