X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2Fre%2Fre.pm;h=0c4974645f7529e7d5e8adcc3140c45aa9774306;hb=a1787f2408f7a147f42c53fb9c4380c9d71502ea;hp=e06602da3384584c4bd379504b6e398d8bef9715;hpb=28d8d7f41ab202dd5f7611033d27ecad44cadd60;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/re/re.pm b/ext/re/re.pm index e06602d..0c49746 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -4,11 +4,13 @@ package re; use strict; use warnings; -our $VERSION = "0.08"; +our $VERSION = "0.09"; our @ISA = qw(Exporter); -our @EXPORT_OK = qw(is_regexp regexp_pattern regmust - regname regnames - regnames_count regnames_iterinit regnames_iternext); +my @XS_FUNCTIONS = qw(regmust); +my %XS_FUNCTIONS = map { $_ => 1 } @XS_FUNCTIONS; +our @EXPORT_OK = (@XS_FUNCTIONS, + qw(is_regexp regexp_pattern + regname regnames regnames_count)); our %EXPORT_OK = map { $_ => 1 } @EXPORT_OK; # *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** @@ -54,6 +56,7 @@ my %flags = ( OPTIMISE => 0x000002, TRIEC => 0x000004, DUMP => 0x000008, + FLAGS => 0x000010, EXECUTE => 0x00FF00, INTUIT => 0x000100, @@ -142,8 +145,15 @@ sub bits { last; } elsif (exists $bitmask{$s}) { $bits |= $bitmask{$s}; + } elsif ($XS_FUNCTIONS{$s}) { + _do_install(); + if (! $installed) { + require Carp; + Carp::croak("\"re\" function '$s' not available"); + } + require Exporter; + re->export_to_level(2, 're', $s); } elsif ($EXPORT_OK{$s}) { - _do_install(); require Exporter; re->export_to_level(2, 're', $s); } else { @@ -485,18 +495,6 @@ Returns a list of all of the named buffers defined in the last successful match. If $all is true, then it returns all names defined, if not it returns only names which were involved in the match. -=item regnames_iterinit() - -Initializes the internal hash iterator associated to the last successful -matches named capture buffers. - -=item regnames_iternext($all) - -Gets the next key from the named capture buffer hash associated with the -last successful match. If $all is true returns the keys of all of the -distinct named buffers in the pattern, if not returns only those names -used in the last successful match. - =item regnames_count() Returns the number of distinct names defined in the pattern used