File Coverage

blib/lib/re/engine/PCRE2.pm
Criterion Covered Total %
statement 8 10 80.0
branch 0 2 0.0
condition n/a
subroutine 3 5 60.0
pod n/a
total 11 17 64.7


line stmt bran cond sub pod time code
1             package re::engine::PCRE2;
2             our $VERSION = '0.14';
3             our $XS_VERSION = $VERSION;
4             $VERSION = eval $VERSION;
5              
6 16     16   1175313 use 5.010;
  16         72  
7 16     16   119 use strict;
  16         45  
  16         631  
8 16     16   113 use XSLoader ();
  16         45  
  16         2680  
9              
10             # All engines should subclass the core Regexp package
11             our @ISA = 'Regexp';
12              
13             XSLoader::load(__PACKAGE__, $XS_VERSION);
14              
15             # set'able via import
16             our @CONTEXT_OPTIONS = qw(
17             bsr max_pattern_length newline parenslimit
18             matchlimit offsetlimit recursionlimit heaplimit
19             );
20              
21             # TODO: set context options, and save prev. ones for unimport.
22             # compile-ctx and match-ctx (see above: @CONTEXT_OPTIONS)
23             sub import {
24 0     0     $^H{regcomp} = re::engine::PCRE2::ENGINE();
25             }
26              
27             sub unimport {
28 0 0   0     delete $^H{regcomp} if $^H{regcomp} == re::engine::PCRE2::ENGINE();
29             }
30              
31             1;
32              
33             __END__