blib/lib/re/engine/TRE.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 52 CC 4 SCAR 16.4
CC
4
Cov
0%
import
12.0
unimport
6.0
BEGIN
2.0
CRAP 5.2
1 package re::engine::TRE;
2 # ABSTRACT: TRE regular expression engine
3  
4  
5 use strict;
6 use utf8;
7 use warnings qw(all);
8  
9 use 5.010000;
10 use Scalar::Util qw(looks_like_number);
11 use XSLoader ();
12  
13 # All engines should subclass the core Regexp package
14 our @ISA = 'Regexp';
15  
16 BEGIN {
17 our $VERSION = '0.09'; # VERSION
18 XSLoader::load __PACKAGE__, $VERSION;
19 }
20  
21  
22 sub import {
23 shift;
24  
25 $^H{regcomp} = ENGINE;
26  
27 if (@_) {
28 my %args = @_;
29 $^H{__PACKAGE__ . '::' . $_} =
30 $args{$_} < 0
31 ? 0x7fff
32 : int($args{$_})
33 for grep {
34 exists $args{$_}
35 and looks_like_number($args{$_})
36 } qw(
37 cost_ins
38 cost_del
39 cost_subst
40 max_cost
41 max_ins
42 max_del
43 max_subst
44 max_err
45 );
46 }
47 }
48  
49 sub unimport {
50 delete $^H{regcomp}
51 if $^H{regcomp} == ENGINE;
52 }
53  
54 1;
55  
56 __END__